Commit 9840e315 authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

Base.py, InteractionWorkflow.py, State.py, Transition.py: clean up.

parent 2cc6b43c
...@@ -3006,7 +3006,7 @@ class Base( CopyContainer, ...@@ -3006,7 +3006,7 @@ class Base( CopyContainer,
local_permission_list = (local_permission_list,) local_permission_list = (local_permission_list,)
setattr(self,permission_name,tuple(local_permission_list)) setattr(self,permission_name,tuple(local_permission_list))
### Content accessor methods # Content accessor methods
security.declareProtected(Permissions.View, 'getSearchableText') security.declareProtected(Permissions.View, 'getSearchableText')
def getSearchableText(self, md=None): def getSearchableText(self, md=None):
""" """
......
...@@ -102,16 +102,6 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject): ...@@ -102,16 +102,6 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
self.generateGuard() self.generateGuard()
return self.guard return self.guard
def getVarExprText(self, id):
if not self.var_exprs:
return ''
else:
expr = self.var_exprs.get(id, None)
if expr is not None:
return expr.text
else:
return ''
def generateGuard(self): def generateGuard(self):
if self.trigger_type == TRIGGER_USER_ACTION: if self.trigger_type == TRIGGER_USER_ACTION:
if self.guard == None: if self.guard == None:
...@@ -119,7 +109,6 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject): ...@@ -119,7 +109,6 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
roles=self.getRoleList(), roles=self.getRoleList(),
groups=self.getGroupList(), groups=self.getGroupList(),
expr=self.getExpression()) expr=self.getExpression())
if self.guard.roles != self.getRoleList(): if self.guard.roles != self.getRoleList():
self.guard.roles = self.getRoleList() self.guard.roles = self.getRoleList()
elif self.guard.permissions != self.getPermissionList(): elif self.guard.permissions != self.getPermissionList():
...@@ -133,16 +122,3 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject): ...@@ -133,16 +122,3 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
if type(self.method_id) is type(''): if type(self.method_id) is type(''):
self.method_id = self.method_id.split() self.method_id = self.method_id.split()
return self.method_id return self.method_id
def getVarExprText(self, id):
if not self.var_exprs:
return ''
else:
expr = self.var_exprs.get(id, None)
if expr is not None:
return expr.text
else:
return ''
def getWorkflow(self):
return aq_parent(aq_inner(aq_parent(aq_inner(self))))
...@@ -121,24 +121,3 @@ class State(IdAsReferenceMixin("state_", "prefix"), XMLObject, XMLMatrix): ...@@ -121,24 +121,3 @@ class State(IdAsReferenceMixin("state_", "prefix"), XMLObject, XMLMatrix):
for tr in self.getDestinationValueList(): for tr in self.getDestinationValueList():
ref_list.append(tr.getReference()) ref_list.append(tr.getReference())
return ref_list return ref_list
def setGroups(self, REQUEST, RESPONSE=None):
"""Set the group to role mappings in REQUEST for this State.
"""
map = self.group_roles
if map is None:
self.group_roles = map = PersistentMapping()
map.clear()
all_roles = self.getWorkflow().getRoles()
for group in self.getWorkflow().getGroups():
roles = []
for role in all_roles:
if REQUEST.get('%s|%s' % (group, role), 0):
roles.append(role)
roles.sort()
roles = tuple(roles)
map[group] = roles
if RESPONSE is not None:
RESPONSE.redirect(
"%s/manage_groups?manage_tabs_message=Groups+changed."
% self.absolute_url())
...@@ -94,16 +94,6 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject): ...@@ -94,16 +94,6 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
self.generateGuard() self.generateGuard()
return self.guard return self.guard
def getVarExprText(self, id):
if not self.var_exprs:
return ''
else:
expr = self.var_exprs.get(id, None)
if expr is not None:
return expr.text
else:
return ''
def generateGuard(self): def generateGuard(self):
if self.trigger_type == TRIGGER_USER_ACTION: if self.trigger_type == TRIGGER_USER_ACTION:
if self.guard == None: if self.guard == None:
......
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