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):
"""
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')
def getAcquisitionObjectIds(self):
"""
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')
def getAcquisitionPortalType(self):
"""
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')
def getAcquisitionCategoryType(self):
......
......@@ -97,14 +97,14 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
"""
Returns the version of the business template
"""
return getattr(self.getDocumentedObject(), 'version', '')
self.getDocumentedObject().getVersion()
security.declareProtected(Permissions.AccessContentsInformation, 'getRevisionNumber')
def getRevisionNumber(self):
"""
Returns the revision number of the documentation helper
"""
return getattr(self.getDocumentedObject(), 'revision', '')
return self.getDocumentedObject().getRevision()
security.declareProtected(Permissions.AccessContentsInformation, 'getBuildingState')
def getBuildingState(self):
......@@ -125,21 +125,21 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
"""
Returns the list of maintainers of the business template
"""
return getattr(self.getDocumentedObject(), 'maintainer', '')
return self.getDocumentedObject().getMaintainerList()
security.declareProtected(Permissions.AccessContentsInformation, 'getDependencyList')
def getDependencyList(self):
"""
Returns the list of dependencies of the business template
"""
return getattr(self.getDocumentedObject(), 'dependency', '')
return self.getDocumentedObject().getDependencyList()
security.declareProtected(Permissions.AccessContentsInformation, 'getPortalTypeIdList')
def getPortalTypeIdList(self):
"""
"""
return getattr(self.getDocumentedObject(), 'template_portal_type_id', [])
return self.getDocumentedObject().getTemplatePortalTypeIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getPortalTypeUriList')
def getPortalTypeUriList(self):
......@@ -153,7 +153,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
def getSkinFolderIdList(self):
"""
"""
return getattr(self.getDocumentedObject(), 'template_skin_id', [])
return self.getDocumentedObject().getTemplateSkinIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getSkinFolderUriList')
def getSkinFolderUriList(self):
......@@ -168,9 +168,9 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
"""
"""
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:
url = '/' + self.getPortalObject().id + '/portal_workflow/' + wf
url = '/' + self.getPortalObject().getId() + '/portal_workflow/' + wf
wf_object = self.getPortalObject().unrestrictedTraverse(url)
if wf_object.__class__.__name__ == 'DCWorkflowDefinition':
dc_workflow_list.append(wf)
......@@ -189,9 +189,9 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
"""
"""
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:
url = '/' + self.getPortalObject().id + '/portal_workflow/' + wf
url = '/' + self.getPortalObject().getId() + '/portal_workflow/' + wf
wf_object = self.getPortalObject().unrestrictedTraverse(url)
if wf_object.__class__.__name__ == 'InteractionWorkflowDefinition':
workflow_list.append(wf)
......@@ -209,7 +209,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
def getBaseCategoryList(self):
"""
"""
return getattr(self.getDocumentedObject(), 'template_base_category', '')
return self.getDocumentedObject().getTemplateBaseCategoryList()
security.declareProtected(Permissions.AccessContentsInformation, 'getBaseCategoryUriList')
def getBaseCategoryUriList(self):
......@@ -223,7 +223,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
def getModuleIdList(self):
"""
"""
return getattr(self.getDocumentedObject(), 'template_module_id', [])
return self.getDocumentedObject().getTemplateModuleIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getModuleUriList')
def getModuleUriList(self):
......@@ -237,7 +237,7 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
def getCatalogMethodIdList(self):
"""
"""
return getattr(self.getDocumentedObject(), 'template_catalog_method_id', [])
return self.getDocumentedObject().getTemplateCatalogMethodIdList()
security.declareProtected(Permissions.AccessContentsInformation, 'getCatalogMethodUriList')
def getCatalogMethodUriList(self):
......
......@@ -50,14 +50,13 @@ class CatalogMethodDocumentationHelper(ZSQLMethodDocumentationHelper):
"""
Returns the title of the documentation helper
"""
return getattr(self.getDocumentedObject(), 'connection_id', '')
return getattr(self.getDocumentedObject(), 'connection_id')
security.declareProtected(Permissions.AccessContentsInformation, 'getArgumentList')
def getArgumentList(self):
"""
Returns the arguments of the documentation helper
"""
#return self.getDocumentedObject()._arg._keys
keys = []
arg = getattr(self.getDocumentedObject(), '_arg', None)
if arg is not None:
......@@ -69,11 +68,10 @@ class CatalogMethodDocumentationHelper(ZSQLMethodDocumentationHelper):
"""
Returns the catalog name of the documentation helper
"""
#return self.getDocumentedObject().aq_parent.__name__
catalog = ''
parent = getattr(self.getDocumentedObject(), 'aq_parent', None)
if parent is not None:
catalog = getattr(parent, '__name__', '')
catalog = getattr(parent, '__name__')
return catalog
InitializeClass(CatalogMethodDocumentationHelper)
......@@ -196,7 +196,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
worklists = getattr(self.getDocumentedObject(), "worklists", None)
if worklists is not None:
for wl in worklists.objectValues():
worklist_list.append(getattr(wl, "__name__", ''))
worklist_list.append(getattr(wl, "__name__"))
return worklist_list
security.declareProtected(Permissions.AccessContentsInformation, 'getWorklistItemList')
......@@ -245,7 +245,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
scripts = getattr(self.getDocumentedObject(), "scripts", None)
if scripts is not None:
for script in scripts.objectValues():
script_list.append(getattr(script, "__name__", ''))
script_list.append(getattr(script, "__name__"))
return script_list
security.declareProtected(Permissions.AccessContentsInformation, 'getScriptItemList')
......@@ -256,8 +256,8 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
scripts = getattr(self.getDocumentedObject(), "scripts", None)
if scripts is not None:
for script in scripts.objectValues():
script_list.append((getattr(script, "__name__", ''),
getattr(script, "title", '')
script_list.append((getattr(script, "__name__"),
getattr(script, "title")
))
return script_list
......@@ -291,7 +291,7 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
"""
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)
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