Commit ffa4d424 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

follow the changes of Portal Type implementation.

* we no longer have _actions and _roles in portal type itself.
* use new APIs to get action / role informations.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29916 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1b70bf17
...@@ -203,9 +203,8 @@ class PortalTypeDocumentationHelper(DocumentationHelper): ...@@ -203,9 +203,8 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
""" """
""" """
action_list = [] action_list = []
actions = getattr(self.getDocumentedObject(), "_actions") for action in self.getDocumentedObject().getActionInformationList():
for action in actions: action_list.append(action.getReference())
action_list.append(action.getId())
return action_list return action_list
security.declareProtected(Permissions.AccessContentsInformation, 'getActionItemList') security.declareProtected(Permissions.AccessContentsInformation, 'getActionItemList')
...@@ -214,11 +213,11 @@ class PortalTypeDocumentationHelper(DocumentationHelper): ...@@ -214,11 +213,11 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
""" """
action_list = [] action_list = []
TITLE =['No', 'Yes'] TITLE =['No', 'Yes']
for action in self.getDocumentedObject()._actions: for action in self.getDocumentedObject().getActionInformationList():
permission = ', '.join(x for x in action.permissions) permission = ', '.join(x for x in action.getActionPermissionList())
visible = TITLE[action.visible] visible = TITLE[int(action.isVisible())]
category = action.category category = action.getActionType()
action_list.append((action.getId(), action.title, action.Description(), permission, visible, category)) action_list.append((action.getReference(), action.getTitle(), action.getDescription(), permission, visible, category))
return action_list return action_list
security.declareProtected(Permissions.AccessContentsInformation, 'getActionUriList') security.declareProtected(Permissions.AccessContentsInformation, 'getActionUriList')
...@@ -226,15 +225,14 @@ class PortalTypeDocumentationHelper(DocumentationHelper): ...@@ -226,15 +225,14 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
""" """
""" """
action_id_list = self.getActionIdList() action_id_list = self.getActionIdList()
return map(lambda x: ('%s?_actions#%s' % (self.uri, x)), action_id_list) return map(lambda x: ('%s/%s' % (self.uri, x)), action_id_list)
security.declareProtected(Permissions.AccessContentsInformation, 'getRoleIdList') security.declareProtected(Permissions.AccessContentsInformation, 'getRoleIdList')
def getRoleIdList(self): def getRoleIdList(self):
""" """
""" """
role_list = [] role_list = []
roles = getattr(self.getDocumentedObject(), "_roles") for role in self.getDocumentedObject().getRoleInformationList():
for role in roles:
role_list.append(role.Title()) role_list.append(role.Title())
return role_list return role_list
...@@ -243,8 +241,8 @@ class PortalTypeDocumentationHelper(DocumentationHelper): ...@@ -243,8 +241,8 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
""" """
""" """
role_list = [] role_list = []
for role in self.getDocumentedObject()._roles: for role in self.getDocumentedObject().getRoleInformationList():
role_list.append((role.__name__, role.Title(), role.Description())) role_list.append((';'.join(role.getRoleNameList()), role.getTitle(), role.getDescription()))
return role_list return role_list
security.declareProtected(Permissions.AccessContentsInformation, 'getRoleURIList') security.declareProtected(Permissions.AccessContentsInformation, 'getRoleURIList')
...@@ -263,7 +261,7 @@ class PortalTypeDocumentationHelper(DocumentationHelper): ...@@ -263,7 +261,7 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
""" """
""" """
role_id_list = self.getRoleIdList() role_id_list = self.getRoleIdList()
return map(lambda x: ('%s?_roles#%s' % (self.uri, x)), role_id_list) return map(lambda x: ('%s/%s' % (self.uri, x)), role_id_list)
def _getPropertyHolder(self): def _getPropertyHolder(self):
portal_type = getPortalType(self.uri) portal_type = getPortalType(self.uri)
......
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