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):
"""
"""
action_list = []
actions = getattr(self.getDocumentedObject(), "_actions")
for action in actions:
action_list.append(action.getId())
for action in self.getDocumentedObject().getActionInformationList():
action_list.append(action.getReference())
return action_list
security.declareProtected(Permissions.AccessContentsInformation, 'getActionItemList')
......@@ -214,11 +213,11 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
"""
action_list = []
TITLE =['No', 'Yes']
for action in self.getDocumentedObject()._actions:
permission = ', '.join(x for x in action.permissions)
visible = TITLE[action.visible]
category = action.category
action_list.append((action.getId(), action.title, action.Description(), permission, visible, category))
for action in self.getDocumentedObject().getActionInformationList():
permission = ', '.join(x for x in action.getActionPermissionList())
visible = TITLE[int(action.isVisible())]
category = action.getActionType()
action_list.append((action.getReference(), action.getTitle(), action.getDescription(), permission, visible, category))
return action_list
security.declareProtected(Permissions.AccessContentsInformation, 'getActionUriList')
......@@ -226,15 +225,14 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
"""
"""
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')
def getRoleIdList(self):
"""
"""
role_list = []
roles = getattr(self.getDocumentedObject(), "_roles")
for role in roles:
for role in self.getDocumentedObject().getRoleInformationList():
role_list.append(role.Title())
return role_list
......@@ -243,8 +241,8 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
"""
"""
role_list = []
for role in self.getDocumentedObject()._roles:
role_list.append((role.__name__, role.Title(), role.Description()))
for role in self.getDocumentedObject().getRoleInformationList():
role_list.append((';'.join(role.getRoleNameList()), role.getTitle(), role.getDescription()))
return role_list
security.declareProtected(Permissions.AccessContentsInformation, 'getRoleURIList')
......@@ -263,7 +261,7 @@ class PortalTypeDocumentationHelper(DocumentationHelper):
"""
"""
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):
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