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

Use accessors.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27103 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a7a90190
...@@ -98,21 +98,21 @@ class BaseCategoryDocumentationHelper(DocumentationHelper): ...@@ -98,21 +98,21 @@ class BaseCategoryDocumentationHelper(DocumentationHelper):
""" """
Returns the acquisition base categories of the documented base category Returns the acquisition base categories of the documented base category
""" """
return getattr(self.getDocumentedObject(), 'acquisition_base_category', []) return self.getDocumentedObject().getAcquisitionBaseCategoryList()
security.declareProtected(Permissions.AccessContentsInformation, 'getAcquisitionObjectIds') security.declareProtected(Permissions.AccessContentsInformation, 'getAcquisitionObjectIds')
def getAcquisitionObjectIds(self): def getAcquisitionObjectIds(self):
""" """
Returns the acquisitions ids of the documented base category Returns the acquisitions ids of the documented base category
""" """
return getattr(self.getDocumentedObject(), 'acquisition_object_id', []) return self.getDocumentedObject().getAcquisitionObjectIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getAcquisitionPortalType') security.declareProtected(Permissions.AccessContentsInformation, 'getAcquisitionPortalType')
def getAcquisitionPortalType(self): def getAcquisitionPortalType(self):
""" """
Returns the acquisitions ids of the documented base category Returns the acquisitions ids of the documented base category
""" """
return getattr(self.getDocumentedObject(), 'acquisition_portal_type', '') return self.getDocumentedObject().getAcquisitionPortalTypeList()
security.declareProtected(Permissions.AccessContentsInformation, 'getAcquisitionCategoryType') security.declareProtected(Permissions.AccessContentsInformation, 'getAcquisitionCategoryType')
def getAcquisitionCategoryType(self): def getAcquisitionCategoryType(self):
......
...@@ -97,14 +97,14 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper): ...@@ -97,14 +97,14 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
""" """
Returns the version of the business template Returns the version of the business template
""" """
return getattr(self.getDocumentedObject(), 'version', '') self.getDocumentedObject().getVersion()
security.declareProtected(Permissions.AccessContentsInformation, 'getRevisionNumber') security.declareProtected(Permissions.AccessContentsInformation, 'getRevisionNumber')
def getRevisionNumber(self): def getRevisionNumber(self):
""" """
Returns the revision number of the documentation helper Returns the revision number of the documentation helper
""" """
return getattr(self.getDocumentedObject(), 'revision', '') return self.getDocumentedObject().getRevision()
security.declareProtected(Permissions.AccessContentsInformation, 'getBuildingState') security.declareProtected(Permissions.AccessContentsInformation, 'getBuildingState')
def getBuildingState(self): def getBuildingState(self):
...@@ -125,21 +125,21 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper): ...@@ -125,21 +125,21 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
""" """
Returns the list of maintainers of the business template Returns the list of maintainers of the business template
""" """
return getattr(self.getDocumentedObject(), 'maintainer', '') return self.getDocumentedObject().getMaintainerList()
security.declareProtected(Permissions.AccessContentsInformation, 'getDependencyList') security.declareProtected(Permissions.AccessContentsInformation, 'getDependencyList')
def getDependencyList(self): def getDependencyList(self):
""" """
Returns the list of dependencies of the business template Returns the list of dependencies of the business template
""" """
return getattr(self.getDocumentedObject(), 'dependency', '') return self.getDocumentedObject().getDependencyList()
security.declareProtected(Permissions.AccessContentsInformation, 'getPortalTypeIdList') security.declareProtected(Permissions.AccessContentsInformation, 'getPortalTypeIdList')
def getPortalTypeIdList(self): def getPortalTypeIdList(self):
""" """
""" """
return getattr(self.getDocumentedObject(), 'template_portal_type_id', []) return self.getDocumentedObject().getTemplatePortalTypeIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getPortalTypeUriList') security.declareProtected(Permissions.AccessContentsInformation, 'getPortalTypeUriList')
def getPortalTypeUriList(self): def getPortalTypeUriList(self):
...@@ -153,7 +153,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper): ...@@ -153,7 +153,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
def getSkinFolderIdList(self): def getSkinFolderIdList(self):
""" """
""" """
return getattr(self.getDocumentedObject(), 'template_skin_id', []) return self.getDocumentedObject().getTemplateSkinIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getSkinFolderUriList') security.declareProtected(Permissions.AccessContentsInformation, 'getSkinFolderUriList')
def getSkinFolderUriList(self): def getSkinFolderUriList(self):
...@@ -168,9 +168,9 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper): ...@@ -168,9 +168,9 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
""" """
""" """
dc_workflow_list = [] dc_workflow_list = []
template_workflow_id_list = getattr(self.getDocumentedObject(), 'template_workflow_id', []) template_workflow_id_list = self.getDocumentedObject().getTemplateWorkflowIdList()
for wf in template_workflow_id_list: for wf in template_workflow_id_list:
url = '/' + self.getPortalObject().id + '/portal_workflow/' + wf url = '/' + self.getPortalObject().getId() + '/portal_workflow/' + wf
wf_object = self.getPortalObject().unrestrictedTraverse(url) wf_object = self.getPortalObject().unrestrictedTraverse(url)
if wf_object.__class__.__name__ == 'DCWorkflowDefinition': if wf_object.__class__.__name__ == 'DCWorkflowDefinition':
dc_workflow_list.append(wf) dc_workflow_list.append(wf)
...@@ -189,9 +189,9 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper): ...@@ -189,9 +189,9 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
""" """
""" """
workflow_list = [] workflow_list = []
template_workflow_id_list = getattr(self.getDocumentedObject(), 'template_workflow_id', []) template_workflow_id_list = self.getDocumentedObject().getTemplateWorkflowIdList()
for wf in template_workflow_id_list: for wf in template_workflow_id_list:
url = '/' + self.getPortalObject().id + '/portal_workflow/' + wf url = '/' + self.getPortalObject().getId() + '/portal_workflow/' + wf
wf_object = self.getPortalObject().unrestrictedTraverse(url) wf_object = self.getPortalObject().unrestrictedTraverse(url)
if wf_object.__class__.__name__ == 'InteractionWorkflowDefinition': if wf_object.__class__.__name__ == 'InteractionWorkflowDefinition':
workflow_list.append(wf) workflow_list.append(wf)
...@@ -209,7 +209,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper): ...@@ -209,7 +209,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
def getBaseCategoryList(self): def getBaseCategoryList(self):
""" """
""" """
return getattr(self.getDocumentedObject(), 'template_base_category', '') return self.getDocumentedObject().getTemplateBaseCategoryList()
security.declareProtected(Permissions.AccessContentsInformation, 'getBaseCategoryUriList') security.declareProtected(Permissions.AccessContentsInformation, 'getBaseCategoryUriList')
def getBaseCategoryUriList(self): def getBaseCategoryUriList(self):
...@@ -223,7 +223,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper): ...@@ -223,7 +223,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
def getModuleIdList(self): def getModuleIdList(self):
""" """
""" """
return getattr(self.getDocumentedObject(), 'template_module_id', []) return self.getDocumentedObject().getTemplateModuleIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getModuleUriList') security.declareProtected(Permissions.AccessContentsInformation, 'getModuleUriList')
def getModuleUriList(self): def getModuleUriList(self):
...@@ -237,7 +237,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper): ...@@ -237,7 +237,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
def getCatalogMethodIdList(self): def getCatalogMethodIdList(self):
""" """
""" """
return getattr(self.getDocumentedObject(), 'template_catalog_method_id', []) return self.getDocumentedObject().getTemplateCatalogMethodIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getCatalogMethodUriList') security.declareProtected(Permissions.AccessContentsInformation, 'getCatalogMethodUriList')
def getCatalogMethodUriList(self): def getCatalogMethodUriList(self):
......
...@@ -50,14 +50,13 @@ class CatalogMethodDocumentationHelper(ZSQLMethodDocumentationHelper): ...@@ -50,14 +50,13 @@ class CatalogMethodDocumentationHelper(ZSQLMethodDocumentationHelper):
""" """
Returns the title of the documentation helper Returns the title of the documentation helper
""" """
return getattr(self.getDocumentedObject(), 'connection_id', '') return getattr(self.getDocumentedObject(), 'connection_id')
security.declareProtected(Permissions.AccessContentsInformation, 'getArgumentList') security.declareProtected(Permissions.AccessContentsInformation, 'getArgumentList')
def getArgumentList(self): def getArgumentList(self):
""" """
Returns the arguments of the documentation helper Returns the arguments of the documentation helper
""" """
#return self.getDocumentedObject()._arg._keys
keys = [] keys = []
arg = getattr(self.getDocumentedObject(), '_arg', None) arg = getattr(self.getDocumentedObject(), '_arg', None)
if arg is not None: if arg is not None:
...@@ -69,11 +68,10 @@ class CatalogMethodDocumentationHelper(ZSQLMethodDocumentationHelper): ...@@ -69,11 +68,10 @@ class CatalogMethodDocumentationHelper(ZSQLMethodDocumentationHelper):
""" """
Returns the catalog name of the documentation helper Returns the catalog name of the documentation helper
""" """
#return self.getDocumentedObject().aq_parent.__name__
catalog = '' catalog = ''
parent = getattr(self.getDocumentedObject(), 'aq_parent', None) parent = getattr(self.getDocumentedObject(), 'aq_parent', None)
if parent is not None: if parent is not None:
catalog = getattr(parent, '__name__', '') catalog = getattr(parent, '__name__')
return catalog return catalog
InitializeClass(CatalogMethodDocumentationHelper) InitializeClass(CatalogMethodDocumentationHelper)
...@@ -196,7 +196,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper): ...@@ -196,7 +196,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
worklists = getattr(self.getDocumentedObject(), "worklists", None) worklists = getattr(self.getDocumentedObject(), "worklists", None)
if worklists is not None: if worklists is not None:
for wl in worklists.objectValues(): for wl in worklists.objectValues():
worklist_list.append(getattr(wl, "__name__", '')) worklist_list.append(getattr(wl, "__name__"))
return worklist_list return worklist_list
security.declareProtected(Permissions.AccessContentsInformation, 'getWorklistItemList') security.declareProtected(Permissions.AccessContentsInformation, 'getWorklistItemList')
...@@ -245,7 +245,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper): ...@@ -245,7 +245,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
scripts = getattr(self.getDocumentedObject(), "scripts", None) scripts = getattr(self.getDocumentedObject(), "scripts", None)
if scripts is not None: if scripts is not None:
for script in scripts.objectValues(): for script in scripts.objectValues():
script_list.append(getattr(script, "__name__", '')) script_list.append(getattr(script, "__name__"))
return script_list return script_list
security.declareProtected(Permissions.AccessContentsInformation, 'getScriptItemList') security.declareProtected(Permissions.AccessContentsInformation, 'getScriptItemList')
...@@ -256,8 +256,8 @@ class DCWorkflowDocumentationHelper(DocumentationHelper): ...@@ -256,8 +256,8 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
scripts = getattr(self.getDocumentedObject(), "scripts", None) scripts = getattr(self.getDocumentedObject(), "scripts", None)
if scripts is not None: if scripts is not None:
for script in scripts.objectValues(): for script in scripts.objectValues():
script_list.append((getattr(script, "__name__", ''), script_list.append((getattr(script, "__name__"),
getattr(script, "title", '') getattr(script, "title")
)) ))
return script_list return script_list
...@@ -291,7 +291,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper): ...@@ -291,7 +291,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
""" """
Returns the graphic representation of the workflow as a PNG file Returns the graphic representation of the workflow as a PNG file
""" """
return getGraph(self, wf_id=getattr(self.getDocumentedObject(), "__name__", ''), format=format) return getGraph(self, wf_id=getattr(self.getDocumentedObject(), "__name__"), format=format)
InitializeClass(DCWorkflowDocumentationHelper) InitializeClass(DCWorkflowDocumentationHelper)
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