Commit e55fef28 authored by Mayoro Diagne's avatar Mayoro Diagne

Do not add empty section in getSectionList of documentations

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24078 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1bf517b4
......@@ -63,50 +63,71 @@ class BusinessTemplateDocumentationHelper(DocumentationHelper):
"""
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='dc_workflow',
title='DC Workflows',
class_name='DCWorkflowDocumentationHelper',
uri_list=self.getDCWorkflowURIList(),
),
DocumentationSection(
id='interaction_workflow',
title='Interaction Workflows',
class_name='InteractionWorkflowDocumentationHelper',
uri_list=self.getInteractionWorkflowURIList(),
),
DocumentationSection(
id='skin_folder',
title='Skin Folders',
class_name='SkinFolderDocumentationHelper',
uri_list=self.getSkinFolderURIList(),
),
DocumentationSection(
id='module',
title='Module',
class_name='PortalTypeInstanceDocumentationHelper',
uri_list=self.getModuleURIList(),
),
DocumentationSection(
id='catalog_method',
title='Catalog Method',
class_name='CatalogMethodDocumentationHelper',
uri_list=self.getCatalogMethodURIList(),
),
DocumentationSection(
id='base_category',
title='Base Category',
class_name='BaseCategoryDocumentationHelper',
uri_list=self.getBaseCategoryURIList(),
),
])
section_list = []
if self.getPortalTypeURIList() != []:
section_list.append(
DocumentationSection(
id='portal_type',
title='Portal Types',
class_name='PortalTypeDocumentationHelper',
uri_list=self.getPortalTypeURIList(),
)
)
if self.getDCWorkflowURIList() != []:
section_list.append(
DocumentationSection(
id='dc_workflow',
title='DC Workflows',
class_name='DCWorkflowDocumentationHelper',
uri_list=self.getDCWorkflowURIList(),
)
)
if self.getInteractionWorkflowURIList() != []:
section_list.append(
DocumentationSection(
id='interaction_workflow',
title='Interaction Workflows',
class_name='InteractionWorkflowDocumentationHelper',
uri_list=self.getInteractionWorkflowURIList(),
)
)
if self.getSkinFolderURIList() != []:
section_list.append(
DocumentationSection(
id='skin_folder',
title='Skin Folders',
class_name='SkinFolderDocumentationHelper',
uri_list=self.getSkinFolderURIList(),
)
)
if self.getModuleURIList() != []:
section_list.append(
DocumentationSection(
id='module',
title='Module',
class_name='PortalTypeInstanceDocumentationHelper',
uri_list=self.getModuleURIList(),
)
)
if self.getCatalogMethodURIList() != []:
section_list.append(
DocumentationSection(
id='catalog_method',
title='Catalog Method',
class_name='CatalogMethodDocumentationHelper',
uri_list=self.getCatalogMethodURIList(),
)
)
if self.getBaseCategoryURIList() != []:
section_list.append(
DocumentationSection(
id='base_category',
title='Base Category',
class_name='BaseCategoryDocumentationHelper',
uri_list=self.getBaseCategoryURIList(),
)
)
return map(lambda x: x.__of__(self), section_list)
# Specific methods
security.declareProtected( Permissions.AccessContentsInformation, 'getDescription' )
......
......@@ -105,44 +105,62 @@ class DCWorkflowDocumentationHelper(DocumentationHelper):
"""
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.getTransitionUriList(),
),
DocumentationSection(
id='variable',
title='Workflow Variables',
class_name='DCWorkflowVariableDocumentationHelper',
uri_list=self.getVariableUriList(),
),
DocumentationSection(
id='permission',
title='Workflow Permissions',
class_name='DCWorkflowPermissionDocumentationHelper',
uri_list=self.getPermissionUriList(),
),
DocumentationSection(
id='worklist',
title='Workflow Worklists',
class_name='DCWorkflowWorklistDocumentationHelper',
uri_list=self.getWorklistUriList(),
),
DocumentationSection(
id='script',
title='Workflow Scripts',
class_name='DCWorkflowScriptDocumentationHelper',
uri_list=self.getScriptUriList(),
),
])
section_list = []
if self.getStateUriList() != []:
section_list.append(
DocumentationSection(
id='state',
title='Workflow States',
class_name='DCWorkflowStateDocumentationHelper',
uri_list=self.getStateUriList(),
)
)
if self.getTransitionUriList() != []:
section_list.append(
DocumentationSection(
id='transition',
title='Workflow Transitions',
class_name='DCWorkflowTransitionDocumentationHelper',
uri_list=self.getTransitionUriList(),
)
)
if self.getVariableUriList() != []:
section_list.append(
DocumentationSection(
id='variable',
title='Workflow Variables',
class_name='DCWorkflowVariableDocumentationHelper',
uri_list=self.getVariableUriList(),
)
)
if self.getPermissionUriList() != []:
section_list.append(
DocumentationSection(
id='permission',
title='Workflow Permissions',
class_name='DCWorkflowPermissionDocumentationHelper',
uri_list=self.getPermissionUriList(),
)
)
if self.getWorklistUriList() != []:
section_list.append(
DocumentationSection(
id='worklist',
title='Workflow Worklists',
class_name='DCWorkflowWorklistDocumentationHelper',
uri_list=self.getWorklistUriList(),
)
)
if self.getScriptUriList() != []:
section_list.append(
DocumentationSection(
id='script',
title='Workflow Scripts',
class_name='DCWorkflowScriptDocumentationHelper',
uri_list=self.getScriptUriList(),
)
)
return map(lambda x: x.__of__(self), section_list)
# Specific methods
security.declareProtected( Permissions.AccessContentsInformation, 'getStateIdList' )
......
......@@ -97,56 +97,89 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
"""
Returns a list of documentation sections
"""
return map(lambda x: x.__of__(self), [
DocumentationSection(
id='action',
title='Actions',
class_name='PortalTypeActionDocumentationHelper',
uri_list=self.getActionUriList(),
),
DocumentationSection(
id='role',
title='Role Definitions',
class_name='PortalTypeRoleDocumentationHelper',
uri_list=self.getRoleUriList(),
),
DocumentationSection(
id='allowed_content_type',
title='Allowed Content Type',
class_name='PortalTypeDocumentationHelper',
uri_list=self.getAllowedContentTypeURIList(),
),
DocumentationSection(
id='hidden_content_type',
title='Hidden Content Type',
class_name='PortalTypeDocumentationHelper',
uri_list=self.getHiddenContentTypeURIList(),
),
DocumentationSection(
id='property_sheet',
title='Property Sheet',
class_name='PortalTypePropertySheetDocumentationHelper',
uri_list=self.getPropertySheetURIList(),
),
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),
),
])
section_list = []
if self.getActionUriList() != []:
section_list.append(
DocumentationSection(
id='action',
title='Actions',
class_name='PortalTypeActionDocumentationHelper',
uri_list=self.getActionUriList(),
)
)
if self.getRoleUriList() != []:
section_list.append(
DocumentationSection(
id='role',
title='Role Definitions',
class_name='PortalTypeRoleDocumentationHelper',
uri_list=self.getRoleUriList(),
)
)
if self.getRoleUriList() != []:
section_list.append(
DocumentationSection(
id='role',
title='Role Definitions',
class_name='PortalTypeRoleDocumentationHelper',
uri_list=self.getRoleUriList(),
)
)
if self.getAllowedContentTypeURIList() != []:
section_list.append(
DocumentationSection(
id='allowed_content_type',
title='Allowed Content Type',
class_name='PortalTypeDocumentationHelper',
uri_list=self.getAllowedContentTypeURIList(),
)
)
if self.getHiddenContentTypeURIList() != []:
section_list.append(
DocumentationSection(
id='hidden_content_type',
title='Hidden Content Type',
class_name='PortalTypeDocumentationHelper',
uri_list=self.getHiddenContentTypeURIList(),
)
)
if self.getPropertySheetURIList() != []:
section_list.append(
DocumentationSection(
id='property_sheet',
title='Property Sheet',
class_name='PortalTypePropertySheetDocumentationHelper',
uri_list=self.getPropertySheetURIList(),
)
)
if self.getWorkflowMethodUriList(inherited=0) != []:
section_list.append(
DocumentationSection(
id='workflow_method',
title='Workflow Method',
class_name='WorkflowMethodDocumentationHelper',
uri_list=self.getWorkflowMethodUriList(inherited=0),
)
)
if self.getAccessorMethodUriList(inherited=0) != []:
section_list.append(
DocumentationSection(
id='accessor',
title='Accessor',
class_name='AccessorMethodDocumentationHelper',
uri_list=self.getAccessorMethodUriList(inherited=0),
)
)
if self.getClassMethodURIList(inherited=0) != []:
section_list.append(
DocumentationSection(
id='class_method',
title='Class Methods',
class_name='ClassMethodDocumentationHelper',
uri_list=self.getClassMethodURIList(inherited=0),
)
)
return map(lambda x: x.__of__(self), section_list)
# Specific methods
security.declareProtected( Permissions.AccessContentsInformation, 'getDescription' )
......
......@@ -68,26 +68,35 @@ class PortalTypeInstanceDocumentationHelper(DocumentationHelper):
"""
Returns a list of documentation sections
"""
return [
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()),
]
section_list = []
if self.getWorkflowMethodURIList(inherited=0) != []:
section_list.append(
DocumentationSection(
id='workflow_method',
title='Workflow Method',
class_name='WorkflowMethodDocumentationHelper',
uri_list=self.getWorkflowMethodURIList(inherited=0),
)
)
if self.getAccessorMethodURIList(inherited=0) != []:
section_list.append(
DocumentationSection(
id='accessor',
title='Accessor',
class_name='AccessorMethodDocumentationHelper',
uri_list=self.getAccessorMethodURIList(inherited=0),
)
)
if self.getClassMethodURIList(inherited=0) != []:
section_list.append(
DocumentationSection(
id='class_method',
title='Class Methods',
class_name='ClassMethodDocumentationHelper',
uri_list=self.getClassMethodURIList(inherited=0),
)
)
return map(lambda x: x.__of__(self.getInstance()), section_list)
# Specific methods
security.declareProtected( Permissions.AccessContentsInformation, 'getPortalType' )
......
......@@ -48,32 +48,44 @@ class SkinFolderDocumentationHelper(DocumentationHelper):
"""
Returns a list of documentation sections
"""
return map(lambda x: x.__of__(self), [
DocumentationSection(
id='erp5_form',
title='ERP5 Form',
class_name='ERP5FormDocumentationHelper',
uri_list=self.getFileURIList(meta_type='ERP5 Form'),
),
DocumentationSection(
id='zsql_method',
title='Z SQL Method',
class_name='ZSQLMethodDocumentationHelper',
uri_list=self.getFileURIList(meta_type='Z SQL Method'),
),
DocumentationSection(
id='page_template',
title='Page Template',
class_name='PageTemplateDocumentationHelper',
uri_list=self.getFileURIList(meta_type='Page Template'),
),
DocumentationSection(
id='script_python',
title='Script (Python)',
class_name='ScriptPythonDocumentationHelper',
uri_list=self.getFileURIList(meta_type='Script (Python)'),
),
])
section_list = []
if self.getFileURIList(meta_type='ERP5 Form') != []:
section_list.append(
DocumentationSection(
id='erp5_form',
title='ERP5 Form',
class_name='ERP5FormDocumentationHelper',
uri_list=self.getFileURIList(meta_type='ERP5 Form'),
)
)
if self.getFileURIList(meta_type='Z SQL Method') != []:
section_list.append(
DocumentationSection(
id='zsql_method',
title='Z SQL Method',
class_name='ZSQLMethodDocumentationHelper',
uri_list=self.getFileURIList(meta_type='Z SQL Method'),
)
)
if self.getFileURIList(meta_type='Page Template') != []:
section_list.append(
DocumentationSection(
id='page_template',
title='Page Template',
class_name='PageTemplateDocumentationHelper',
uri_list=self.getFileURIList(meta_type='Page Template'),
)
)
if self.getFileURIList(meta_type='Script (Python)') != []:
section_list.append(
DocumentationSection(
id='script_python',
title='Script (Python)',
class_name='ScriptPythonDocumentationHelper',
uri_list=self.getFileURIList(meta_type='Script (Python)'),
)
)
return map(lambda x: x.__of__(self), section_list)
security.declareProtected(Permissions.AccessContentsInformation, 'getType' )
def getType(self):
......
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