[Erp5-report] r18604 - /erp5/trunk/products/ERP5Type/DocumentationHelper/
nobody at svn.erp5.org
nobody at svn.erp5.org
Sat Jan 5 23:40:17 CET 2008
Author: jp
Date: Sat Jan 5 23:40:17 2008
New Revision: 18604
URL: http://svn.erp5.org?rev=18604&view=rev
Log:
Moved code to separate files.
Added:
erp5/trunk/products/ERP5Type/DocumentationHelper/
erp5/trunk/products/ERP5Type/DocumentationHelper/AccessorMethodDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/BusinessTemplateDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/CallableDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/ClassDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/ClassMethodDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/DCWorkflowDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/DocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/DocumentationSection.py
erp5/trunk/products/ERP5Type/DocumentationHelper/InstancePropertyDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/PortalDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeInstanceDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/PropertyDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/WorkflowMethodDocumentationHelper.py
erp5/trunk/products/ERP5Type/DocumentationHelper/__init__.py
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/AccessorMethodDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/AccessorMethodDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/AccessorMethodDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/AccessorMethodDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,119 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+#return the definition string of an object representing a workflow method or a class method or an accessor
+def getDefinitionString(obj=None):
+ if obj == None:
+ return ""
+ else:
+ fc_var_names = obj.func_code.co_varnames
+ fc = []
+ for i in range(len(fc_var_names)):
+ if fc_var_names[i] == 'args':
+ fc.append('*args')
+ elif fc_var_names[i] == 'kw':
+ fc.append('**kw')
+ else:
+ fc.append(fc_var_names[i])
+ fd = obj.func_defaults
+ acc_def = obj.__name__ + ' ('
+ if fd == None:
+ acc_def += ', '.join(fc)
+ else:
+ for x in range(len(fc)):
+ if (len(fc)-(x+1)<len(fd)):
+ if (x == len(fc)-1):
+ acc_def += " "+str(fc[x])+"='"+str(fd[x-len(fd)])+"'"
+ else:
+ acc_def += " "+str(fc[x])+"='"+str(fd[x-len(fd)])+"',"
+ else:
+ if (x == len(fc)-1):
+ acc_def += " "+str(fc[x])
+ else:
+ acc_def += " "+str(fc[x])+","
+ acc_def += ")"
+ return acc_def
+
+
+class AccessorMethodDocumentationHelper(DocumentationHelper):
+ """
+ Provides documentation about an accessor
+ """
+ security = ClassSecurityInfo()
+ security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+ def __init__(self, uri):
+ self.uri = uri
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getDescription')
+ def getDescription(self):
+ return self.getDocumentedObject().__doc__
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getType' )
+ def getType(self):
+ """
+ Returns the type of the documentation helper
+ """
+ return "Accessor Method"
+ #return self.getDocumentedObject().func_code.__module__
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getTitle' )
+ def getTitle(self):
+ """
+ Returns the title of the documentation helper
+ """
+ return self.getDocumentedObject().__name__
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getArgCount' )
+ def getArgCount(self):
+ """
+ Returns the number of args of the accessor
+ """
+ return self.getDocumentedObject().func_code.co_argcount
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getVarNames' )
+ def getVarNames(self):
+ """
+ Returns the list of args of the accessor
+ """
+ return self.getDocumentedObject().func_code.co_varnames
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getDefinition' )
+ def getDefinition(self):
+ """
+ Returns the definition of the accessor_method with the name and arguments
+ """
+ return getDefinitionString(self.getDocumentedObject())
+
+
+InitializeClass(AccessorMethodDocumentationHelper)
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/BusinessTemplateDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/BusinessTemplateDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/BusinessTemplateDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/BusinessTemplateDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,101 @@
+
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+
+class BusinessTemplateDocumentationHelper(DocumentationHelper):
+ """
+ Provides access to all documentation information
+ of a business template.
+ """
+
+ security = ClassSecurityInfo()
+ security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+ # API Implementation
+ security.declareProtected( Permissions.AccessContentsInformation, 'getTitle' )
+ def getTitle(self):
+ """
+ Returns the title of the documentation helper
+ """
+ return self.getDocumentedObject().getTitleOrId()
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getType' )
+ def getType(self):
+ """
+ Returns the type of the documentation helper
+ """
+ return "Business Template"
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getSectionList' )
+ def getSectionList(self):
+ """
+ Returns a list of documentation sections
+ """
+ return map(lambda x: x.__of__(self), [
+ DocumentationSection(
+ id='portal_type',
+ title='Portal Types',
+ class_name='PortalTypeDocumentationHelper',
+ uri_list=self.getPortalTypeURIList(),
+ ),
+ DocumentationSection(
+ id='workflow',
+ title='Workflows',
+ class_name='DCWorkflowDocumentationHelper',
+ uri_list=self.getDCWorkflowURIList(),
+ ),
+ DocumentationSection(
+ id='interaction',
+ title='Interaction Workflows',
+ class_name='InteractionWorkflowStateDocumentationHelper',
+ uri_list=self.getInteractionWorkflowURIList(),
+ ),
+ DocumentationSection(
+ id='skin_folder',
+ title='Skin Folders',
+ class_name='SkinFolderDocumentationHelper',
+ uri_list=self.getSkinFolderURIList(),
+ ),
+ ])
+
+ # Specific methods
+ security.declareProtected( Permissions.AccessContentsInformation, 'getDescription' )
+ def getDescription(self):
+ """
+ Returns the title of the documentation helper
+ """
+ raise NotImplemented
+
+
+InitializeClass(BusinessTemplateDocumentationHelper)
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/CallableDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/CallableDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/CallableDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/CallableDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+class CallableDocumentationHelper(DocumentationHelper):
+ """
+ """
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/ClassDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/ClassDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/ClassDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/ClassDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+class ClassDocumentationHelper(DocumentationHelper):
+ """
+ """
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/ClassMethodDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/ClassMethodDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/ClassMethodDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/ClassMethodDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,67 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+class ClassMethodDocumentationHelper(DocumentationHelper):
+ """
+ Provides documentation about a class method
+ """
+ security = ClassSecurityInfo()
+ security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getDescription')
+ def getDescription(self):
+ return self.getDocumentedObject().__doc__
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getType' )
+ def getType(self):
+ """
+ Returns the type of the documentation helper
+ """
+ return "Class Method"
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getTitle' )
+ def getTitle(self):
+ """
+ Returns the type of the documentation helper
+ """
+ return self.getDocumentedObject().__name__
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getDefinition' )
+ def getDefinition(self):
+ """
+ Returns the definition of the class_method with the name and arguments
+ """
+ return getDefinitionString(self.getDocumentedObject())
+
+
+InitializeClass(ClassMethodDocumentationHelper)
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/DCWorkflowDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/DCWorkflowDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/DCWorkflowDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/DCWorkflowDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,136 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+class DCWorkflowDocumentationHelper(DocumentationHelper):
+ """
+ Provides access to all documentation information
+ of a workflow.
+ """
+
+ security = ClassSecurityInfo()
+ security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+ # API Implementation
+ security.declareProtected( Permissions.AccessContentsInformation, 'getTitle' )
+ def getTitle(self):
+ """
+ Returns the title of the documentation helper
+ """
+ return self.getDocumentedObject().getTitleOrId()
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getType' )
+ def getType(self):
+ """
+ Returns the type of the documentation helper
+ """
+ return "DC Workflow"
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getSectionList' )
+ def getSectionList(self):
+ """
+ Returns a list of documentation sections
+ """
+ return map(lambda x: x.__of__(self), [
+ DocumentationSection(
+ id='state',
+ title='Workflow States',
+ class_name='DCWorkflowStateDocumentationHelper',
+ uri_list=self.getStateURIList(),
+ ),
+ DocumentationSection(
+ id='transition',
+ title='Workflow Transitions',
+ class_name='DCWorkflowTransitionDocumentationHelper',
+ uri_list=self.getStateURIList(),
+ ),
+ DocumentationSection(
+ id='variable',
+ title='Workflow Variables',
+ class_name='DCWorkflowVariableDocumentationHelper',
+ uri_list=self.getVariableURIList(),
+ ),
+ DocumentationSection(
+ id='variable',
+ title='Workflow Permissions',
+ class_name='PermissionDocumentationHelper',
+ uri_list=self.getPermissionURIList(),
+ ),
+ ])
+
+ # Specific methods
+ security.declareProtected( Permissions.AccessContentsInformation, 'getDescription' )
+ def getDescription(self):
+ """
+ Returns the title of the documentation helper
+ """
+ raise NotImplemented
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getVariableURIList' )
+ def getVariableURIList(self):
+ """
+ """
+ raise NotImplemented
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getStateURIList' )
+ def getStateURIList(self):
+ """
+ """
+ raise NotImplemented
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getVariableURIList' )
+ def getVariableURIList(self):
+ """
+ """
+ raise NotImplemented
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getPermissionURIList' )
+ def getPermissionURIList(self):
+ """
+ """
+ raise NotImplemented
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getGraphImageURL' )
+ def getGraphImageURL(self):
+ """
+ Returns a URL to a graphic representation of the workflow
+ """
+ raise NotImplemented
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getGraphImageData' )
+ def getGraphImageData(self):
+ """
+ Returns the graphic representation of the workflow as a PNG file
+ """
+ raise NotImplemented
+
+InitializeClass(DCWorkflowDocumentationHelper)
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/DocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/DocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/DocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/DocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,143 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from Products.ERP5Type import Permissions
+
+class DocumentationHelper(Implicit):
+ """
+ Example URIs
+
+ person_module/23
+ person_module/23#title
+ person_module/23#getTitle
+ portal_worklows/validation_workflow
+ portal_worklows/validation_workflow/states/draft
+ portal_worklows/validation_workflow/states/draft#title
+ Products.ERP5Type.Document.Person.notify
+ Products.ERP5Type.Document.Person.isRAD
+ portal_types/Person
+ portal_types/Person/actions#view
+ """
+ security = ClassSecurityInfo()
+ security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+ # Methods to override
+ def __init__(self, uri):
+ self.uri = uri
+
+ def getDocumentedObject(self):
+ if '/' in self.uri and '#' not in self.uri:
+ # URI refers to a portal object
+ # and is a relative URL
+ documented_object = self.getPortalObject().portal_categories.resolveCategory(self.uri)
+ elif '/' in self.uri and '#' in self.uri:
+ url, method = self.uri.split('#')
+ # if / in method, method's not an acessor but a workflow method
+ documented_object = self.getPortalObject().unrestrictedTraverse(url)
+ if '/' not in method:
+ documented_object = self.getPortalObject().unrestrictedTraverse(url)
+ documented_object = getattr(documented_object, method, None)
+ else:
+ #wf_url = 'erp5/portal_workflow/'+method
+ #documented_object = self.getPortalObject().unrestrictedTraverse(wf_url)
+ path_method = method.split('/')
+ wf_method = path_method[len(path_method)-1]
+ documented_object = getattr(documented_object, wf_method, None)
+ else:
+ # URI refers to a python class / method
+ import imp
+ module_list = self.uri.split('.')
+ base_module = module_list[0]
+ if base_module == 'Products':
+ # For now, we do not even try to import
+ # or locate objects which are not in Products
+ import Products
+ documented_object = Products
+ for key in module_list[1:]:
+ LOG('loop in module_list', 0, repr(documented_object))
+ documented_object = getattr(documented_object, key)
+ else:
+ raise NotImplemented
+ #fp, pathname, description = imp.find_module(base_module)
+ #documented_object = imp.load_module(fp, pathname, description)
+
+ return documented_object
+
+ def getTitle(self):
+ """
+ Returns the title of the documentation helper
+ (ex. class name)
+ """
+ raise NotImplemented
+
+ def getType(self):
+ """
+ Returns the type of the documentation helper
+ (ex. Class, float, string, Portal Type, etc.)
+ """
+ raise NotImplemented
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getSectionList')
+ def getSectionList(self):
+ """
+ Returns a list of documentation sections
+ """
+ raise NotImplemented
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getURI')
+ def getURI(self):
+ """
+ Returns a URI to later access this documentation
+ from portal_classes
+ """
+ return self.uri
+
+ # Generic methods which all subclasses should inherit
+ security.declareProtected(Permissions.AccessContentsInformation, 'getClassName')
+ def getClassName(self):
+ """
+ Returns our own class name
+ """
+ return self.__class__.__name__
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'view')
+ def view(self):
+ """
+ Renders the documentation with a standard form
+ ex. PortalTypeInstanceDocumentationHelper_view
+ """
+ return getattr(self, '%s_view' % self.getClassName())()
+
+ security.declareProtected(Permissions.AccessContentsInformation, '__call__')
+ def __call__(self):
+ return self.view()
+
+InitializeClass(DocumentationHelper)
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/DocumentationSection.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/DocumentationSection.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/DocumentationSection.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/DocumentationSection.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,56 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from Products.ERP5Type import Permissions
+
+
+class DocumentationSection(Implicit):
+
+ security = ClassSecurityInfo()
+ security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+ def __init__(self, id, title, class_name, uri_list):
+ self.id = id
+ self.title = title
+ self.class_name = class_name
+ self.uri_list = uri_list
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getClassName')
+ def getClassName(self):
+ return self.class_name
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getURIList')
+ def getURIList(self):
+ return self.uri_list
+
+ # more API needed XXX
+
+InitializeClass(DocumentationSection)
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/InstancePropertyDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/InstancePropertyDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/InstancePropertyDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/InstancePropertyDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+class InstancePropertyDocumentationHelper(DocumentationHelper):
+ """
+ """
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/PortalDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/PortalDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/PortalDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/PortalDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+class PortalDocumentationHelper(DocumentationHelper):
+ """
+ """
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,91 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+class PortalTypeDocumentationHelper(DocumentationHelper):
+ """
+ Provides access to all documentation information
+ of a portal type. Accessors and methods are documented
+ by generating a temporary instance which provides
+ an access to the property holder and allows
+ reusing PortalTypeInstanceDocumentationHelper
+ """
+
+ security = ClassSecurityInfo()
+ security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+ # API Implementation
+ security.declareProtected( Permissions.AccessContentsInformation, 'getTitle' )
+ def getTitle(self):
+ """
+ Returns the title of the documentation helper
+ """
+ return self.getDocumentedObject().getTitleOrId()
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getType' )
+ def getType(self):
+ """
+ Returns the type of the documentation helper
+ """
+ return "Portal Type"
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getSectionList' )
+ def getSectionList(self):
+ """
+ Returns a list of documentation sections
+ """
+ return map(lambda x: x.__of__(self), [
+ DocumentationSection(
+ id='action',
+ title='Actions',
+ class_name='ActionDocumentationHelper',
+ uri_list=self.getActionURIList(),
+ ),
+ DocumentationSection(
+ id='local_role',
+ title='Local Role Definitions',
+ class_name='LocalRoleDefinitionDocumentationHelper',
+ uri_list=self.getDCWorkflowURIList(),
+ ),
+ # XXX - add here all sections of a portal type instance
+ ])
+
+ # Specific methods
+ security.declareProtected( Permissions.AccessContentsInformation, 'getDescription' )
+ def getDescription(self):
+ """
+ Returns the title of the documentation helper
+ """
+ raise NotImplemented
+
+
+InitializeClass(PortalTypeDocumentationHelper)
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeInstanceDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeInstanceDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeInstanceDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeInstanceDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,228 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+
+class PortalTypeInstanceDocumentationHelper(DocumentationHelper):
+ """
+ Provides access to all documentation information
+ of a portal type instance.
+ """
+
+ security = ClassSecurityInfo()
+ security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+ def __init__(self, uri):
+ self.uri = uri
+
+ def getInstance(self):
+ return self.getPortalObject().restrictedTraverse(self.uri)
+
+ # API Implementation
+ security.declareProtected( Permissions.AccessContentsInformation, 'getTitle' )
+ def getTitle(self):
+ """
+ Returns the title of the documentation helper
+ """
+ return self.getInstance().getTitleOrId()
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getType' )
+ def getType(self):
+ """
+ Returns the type of the documentation helper
+ """
+ return "Portal Type Instance"
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getSectionList' )
+ def getSectionList(self):
+ """
+ Returns a list of documentation sections
+ """
+ return [
+ #DocumentationSection(
+ #id='instance_property',
+ #title='Instance Properties',
+ #class_name='InstancePropertyDocumentationHelper',
+ #uri_list=self.getClassPropertyURIList(),
+ #),
+ DocumentationSection(
+ id='workflow_method',
+ title='Workflow Method',
+ class_name='WorkflowMethodDocumentationHelper',
+ uri_list=self.getWorkflowMethodURIList(inherited=0),
+ ),
+ DocumentationSection(
+ id='accessor',
+ title='Accessor',
+ class_name='AccessorMethodDocumentationHelper',
+ uri_list=self.getAccessorMethodURIList(inherited=0),
+ ),
+ DocumentationSection(
+ id='class_method',
+ title='Class Methods',
+ class_name='ClassMethodDocumentationHelper',
+ uri_list=self.getClassMethodURIList(inherited=0),
+ ).__of__(self.getInstance()),
+ ]
+
+ # Specific methods
+ security.declareProtected( Permissions.AccessContentsInformation, 'getPortalType' )
+ def getPortalType(self):
+ """
+ """
+ return self.getInstance().getPortalType()
+
+ def _getPropertyHolder(self):
+ from Products.ERP5Type.Base import Base
+ return Base.aq_portal_type[(self.getPortalType(), self.getInstance().__class__)]
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getAccessorMethodItemList' )
+ def getAccessorMethodItemList(self):
+ """
+ """
+ return self._getPropertyHolder().getAccessorMethodItemList()
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getAccessorMethodIdList' )
+ def getAccessorMethodIdList(self):
+ """
+ """
+ return self._getPropertyHolder().getAccessorMethodIdList()
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getAccessorMethodURIList' )
+ def getAccessorMethodURIList(self, inherited=1, local=1):
+ """
+ Returns a list of URIs to accessor methods
+ """
+ method_id_list = self.getAccessorMethodIdList(inherited=inherited, local=local)
+ klass = self.getInstance().__class__
+ class_name = klass.__name__
+ module = klass.__module__
+ uri_prefix = '%s.%s.' % (module, class_name)
+ return map(lambda x: '%s%s' % (uri_prefix, x), method_id_list)
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getWorkflowMethodItemList' )
+ def getWorkflowMethodItemList(self):
+ """
+ """
+ return self._getPropertyHolder().getWorkflowMethodItemList()
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getWorkflowObject' )
+ def getWorkflowObject(self):
+ """
+ """
+ return self._getPropertyHolder()
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getWorkflowMethodIdList' )
+ def getWorkflowMethodIdList(self):
+ """
+ """
+ return self._getPropertyHolder().getWorkflowMethodIdList()
+
+ def getWorkflowMethodURIList(self, inherited=1, local=1):
+ """
+ Returns a list of URIs to workflow methods
+ """
+ method_id_list = self.getWorkflowMethodIdList(inherited=inherited, local=local)
+ klass = self.getInstance().__class__
+ class_name = klass.__name__
+ module = klass.__module__
+ uri_prefix = '%s.%s.' % (module, class_name)
+ return map(lambda x: '%s%s' % (uri_prefix, x), method_id_list)
+
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getActionMethodItemList' )
+ def getActionMethodItemList(self):
+ """
+ """
+ return self._getPropertyHolder().getActionMethodItemList()
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getActionMethodIdList' )
+ def getActionMethodIdList(self):
+ """
+ """
+ return self._getPropertyHolder().getActionMethodIdList()
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getClassMethodItemList' )
+ def getClassMethodItemList(self, inherited=1, local=1):
+ """
+ Return a list of tuple (id, method) for every class method
+ """
+ klass = self.getInstance().__class__
+ return self._getPropertyHolder().getClassMethodItemList(klass, inherited=inherited, local=local)
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getClassMethodIdList' )
+ def getClassMethodIdList(self, inherited=1, local=1):
+ """
+ Return a list of tuple (id, method) for every class method
+ """
+ klass = self.getInstance().__class__
+ return self._getPropertyHolder().getClassMethodIdList(klass, inherited=inherited, local=local)
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getClassMethodURIList' )
+ def getClassMethodURIList(self, inherited=1, local=1):
+ """
+ Returns a list of URIs to class methods
+ """
+ method_id_list = self.getClassMethodIdList(inherited=inherited, local=local)
+ klass = self.getInstance().__class__
+ class_name = klass.__name__
+ module = klass.__module__
+ uri_prefix = '%s.%s.' % (module, class_name)
+ return map(lambda x: '%s%s' % (uri_prefix, x), method_id_list)
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getClassPropertyItemList' )
+ def getClassPropertyItemList(self, inherited=1, local=1):
+ """
+ Return a list of tuple (id, method) for every class method
+ """
+ klass = self.getInstance().__class__
+ return self._getPropertyHolder().getClassPropertyItemList(klass, inherited=inherited, local=local)
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getClassPropertyIdList' )
+ def getClassPropertyIdList(self, inherited=1, local=1):
+ """
+ Return a list of tuple (id, method) for every class method
+ """
+ klass = self.getInstance().__class__
+ return self._getPropertyHolder().getClassPropertyIdList(klass, inherited=inherited, local=local)
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getGeneratedPropertyIdList' )
+ def getGeneratedPropertyIdList(self):
+ """
+ """
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getGeneratedBaseCategoryIdList' )
+ def getGeneratedBaseCategoryIdList(self):
+ """
+ """
+
+InitializeClass(PortalTypeInstanceDocumentationHelper)
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/PropertyDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/PropertyDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/PropertyDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/PropertyDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,37 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+class PropertyDocumentationHelper(DocumentationHelper):
+ """
+ """
+
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/WorkflowMethodDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/WorkflowMethodDocumentationHelper.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/WorkflowMethodDocumentationHelper.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/WorkflowMethodDocumentationHelper.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,101 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from Acquisition import Implicit
+from AccessControl import ClassSecurityInfo
+from Globals import InitializeClass
+from DocumentationHelper import DocumentationHelper
+
+class WorkflowMethodDocumentationHelper(DocumentationHelper):
+ """
+ Provides documentation about a workflow method
+ """
+ security = ClassSecurityInfo()
+ security.declareObjectProtected(Permissions.AccessContentsInformation)
+
+ def __init__(self, uri):
+ self.uri = uri
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getDescription')
+ def getDescription(self):
+ return self.getDocumentedObject().__doc__
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getType' )
+ def getType(self):
+ """
+ Returns the type of the documentation helper
+ """
+ return "Workflow Method"
+ #return self.getDocumentedObject().__module__
+
+ security.declareProtected(Permissions.AccessContentsInformation, 'getTitle' )
+ def getTitle(self):
+ """
+ Returns the title of the documentation helper
+ """
+ return self.getDocumentedObject().__name__
+
+ #security.declareProtected(Permissions.AccessContentsInformation, 'getDestinationState' )
+ #def getDestinationState(self):
+ # """
+ # Returns the destination_state of the transition workflow method
+ # """
+ # return self.getDocumentedObject().__dict__['new_state_id']
+
+ #security.declareProtected(Permissions.AccessContentsInformation, 'getTriggerType' )
+ #def getTriggerType(self):
+ # """
+ # Returns the trigger type of the workflow method
+ # """
+ # TT = ['Automatic','Initiated by user action','Initiated by WorkflowMethod']
+ # TT_id = self.getDocumentedObject().__dict__['trigger_type']
+ # return TT[TT_id]
+
+ #security.declareProtected(Permissions.AccessContentsInformation, 'getLocalRoles' )
+ #def getLocalRoles(self):
+ # """
+ # Returns the local roles of the workflow method
+ # """
+ # return self.getDocumentedObject().__ac_local_roles__
+
+ #security.declareProtected(Permissions.AccessContentsInformation, 'getAvailableStateIds' )
+ #def getAvailableStateIds(self):
+ # """
+ # Returns available states in the workflow
+ # """
+ # return self.getDocumentedObject().getAvailableStateIds()
+
+ security.declareProtected( Permissions.AccessContentsInformation, 'getDefinition' )
+ def getDefinition(self):
+ """
+ Returns the definition of the workflow_method with the name and arguments
+ """
+ return getDefinitionString(self.getDocumentedObject())
+
+
+InitializeClass(WorkflowMethodDocumentationHelper)
Added: erp5/trunk/products/ERP5Type/DocumentationHelper/__init__.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/__init__.py?rev=18604&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/__init__.py (added)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/__init__.py Sat Jan 5 23:40:17 2008
@@ -1,0 +1,45 @@
+##############################################################################
+#
+# Copyright (c) 2007-2008 Nexedi SA and Contributors. All Rights Reserved.
+# Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from DocumentationSection import DocumentationSection
+
+# Automatic import "Ã la" Document would be more consistent
+# I even wonder whether using Document classes everywhere would be better
+# from a reflexive point of view (ie. to build persistent documentation)
+from DocumentationHelper import DocumentationHelper
+from AccessorMethodDocumentationHelper import AccessorMethodDocumentationHelper
+from BusinessTemplateDocumentationHelper import BusinessTemplateDocumentationHelper
+from CallableDocumentationHelper import CallableDocumentationHelper
+from ClassMethodDocumentationHelper import ClassMethodDocumentationHelper
+from DCWorkflowDocumentationHelper import DCWorkflowDocumentationHelper
+from InstancePropertyDocumentationHelper import InstancePropertyDocumentationHelper
+from PortalDocumentationHelper import PortalDocumentationHelper
+from PortalTypeDocumentationHelper import PortalTypeDocumentationHelper
+from PortalTypeInstanceDocumentationHelper import PortalTypeInstanceDocumentationHelper
+from PropertyDocumentationHelper import PropertyDocumentationHelper
+from WorkflowMethodDocumentationHelper import WorkflowMethodDocumentationHelper
More information about the Erp5-report
mailing list