Commit 26279634 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Premises of new documentation system.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17607 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8d4c2a58
......@@ -86,7 +86,7 @@ class ClassToolMixIn:
# 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
......@@ -105,6 +105,18 @@ class ClassToolMixIn:
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():
class TemporaryInstanceHome(TM):
......@@ -856,13 +868,6 @@ def initialize( context ):
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')
def asDocumentationHelper(self, class_id):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment