[Erp5-report] r17607 - /erp5/trunk/products/ERP5Type/Tool/ClassTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Nov 15 11:09:00 CET 2007


Author: jp
Date: Thu Nov 15 11:09:00 2007
New Revision: 17607

URL: http://svn.erp5.org?rev=17607&view=rev
Log:
Premises of new documentation system.

Modified:
    erp5/trunk/products/ERP5Type/Tool/ClassTool.py

Modified: erp5/trunk/products/ERP5Type/Tool/ClassTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Tool/ClassTool.py?rev=17607&r1=17606&r2=17607&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Tool/ClassTool.py (original)
+++ erp5/trunk/products/ERP5Type/Tool/ClassTool.py Thu Nov 15 11:09:00 2007
@@ -86,7 +86,7 @@
   # Declarative Security
   security = ClassSecurityInfo()
 
-  security.declareProtected( Permissions.ManagePortal, 'getPropertySheetPropertyIdList' )
+  security.declareProtected(Permissions.ManagePortal, 'getPropertySheetPropertyIdList')
   def getPropertySheetPropertyIdList(self):
     """
     Returns the sorted list of property IDs defined in the current instance
@@ -104,6 +104,18 @@
     result = result_dict.keys()
     result.sort()
     return result
+
+  security.declareProtected(Permissions.ManagePortal, 'getDocumentationHelper')
+  def getDocumentationHelper(self, class_name, uri, REQUEST=None):
+    """
+    Builds a documentation helper class with given URI and type
+    """
+    from Products.ERP5Type import DocumentationHelper
+    class_object = getattr(DocumentationHelper, class_name)
+    helper = class_object(uri).__of__(self)
+    if REQUEST is not None:
+      return helper.view()
+    return helper
 
 if allowClassTool():
 
@@ -855,13 +867,6 @@
 
         if REQUEST is not None:
           REQUEST.RESPONSE.redirect('%s/manage_viewProductGeneration?manage_tabs_message=New+Product+Saved+In+%s' % (self.absolute_url(), base_path))
-
-      security.declareProtected(Permissions.ManagePortal, 'getDocumentationHelper')
-      def getDocumentationHelper(self, uri, helper_class):
-        """
-        Returns a documentation of the appropriate class (helper_class)
-        for a given uri
-        """
 
       security.declareProtected( Permissions.ManagePortal,
                                  'asDocumentationHelper')




More information about the Erp5-report mailing list