Commit 39ac8423 authored by iv's avatar iv

ERP5Workflow: rename getXXX to getGuardXXX (properties defined in Guard property sheet)

parent 37040ea8
...@@ -94,10 +94,10 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject): ...@@ -94,10 +94,10 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
return res return res
def getGuard(self): def getGuard(self):
if self.getRoleList() is None and\ if self.getGuardRole() is None and\
self.getPermissionList() is None and\ self.getGuardPermission() is None and\
self.getGroupList() is None and\ self.getGuardGroup() is None and\
self.getExpression() is None and\ self.getGuardExpression() is None and\
self.guard is None: self.guard is None:
return Guard().__of__(self) return Guard().__of__(self)
elif self.guard is None: elif self.guard is None:
...@@ -106,11 +106,11 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject): ...@@ -106,11 +106,11 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
def generateGuard(self): def generateGuard(self):
self.guard = Guard() self.guard = Guard()
if self.getRoleList() is not None: if self.getGuardRole() is not None:
self.guard.roles = self.getRoleList() self.guard.roles = self.getGuardRole()
if self.getPermissionList() is not None: if self.getGuardPermission() is not None:
self.guard.permissions = self.getPermissionList() self.guard.permissions = self.getGuardPermission()
if self.getGroupList() is not None: if self.getGuardGroup() is not None:
self.guard.groups = self.getGroupList() self.guard.groups = self.getGuardGroup()
if self.getExpression() is not None: if self.getGuardExpression() is not None:
self.guard.expr = Expression(self.getExpression()) self.guard.expr = Expression(self.getGuardExpression())
...@@ -430,7 +430,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow): ...@@ -430,7 +430,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
property_value = tuple(property_value) property_value = tuple(property_value)
sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration')) sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration'))
elif property_id == 'expr': elif property_id == 'expr':
property_value = tdef.getExpression() property_value = tdef.getGuardExpression()
sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration')) sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration'))
# no-property definded action box configuration # no-property definded action box configuration
elif property_id in ['actbox_name', 'actbox_url', 'actbox_category', 'trigger_type']: elif property_id in ['actbox_name', 'actbox_url', 'actbox_category', 'trigger_type']:
......
...@@ -99,11 +99,11 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject): ...@@ -99,11 +99,11 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
def generateGuard(self): def generateGuard(self):
if self.guard is None: if self.guard is None:
self.guard = Guard() self.guard = Guard()
if self.getRoleList() is not None: if self.getGuardRole() is not None:
self.guard.roles = self.getRoleList() self.guard.roles = self.getGuardRole()
if self.getPermissionList() is not None: if self.getGuardPermission() is not None:
self.guard.permissions = self.getPermissionList() self.guard.permissions = self.getGuardPermission()
if self.getGroupList() is not None: if self.getGuardGroup() is not None:
self.guard.groups = self.getGroupList() self.guard.groups = self.getGuardGroup()
if self.getExpression() is not None: if self.getGuardExpression() is not None:
self.guard.expr = Expression(self.getExpression()) self.guard.expr = Expression(self.getGuardExpression())
...@@ -850,13 +850,13 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -850,13 +850,13 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
for property_id in sorted(transition_prop_id_to_show): for property_id in sorted(transition_prop_id_to_show):
if property_id in ('roles', 'groups', 'permissions', 'expr',): if property_id in ('roles', 'groups', 'permissions', 'expr',):
if property_id == 'roles': if property_id == 'roles':
property_value = tdef.getRoleList() property_value = tdef.getGuardRole()
if property_id == 'groups': if property_id == 'groups':
property_value = tdef.getGroupList() property_value = tdef.getGuardGroup()
if property_id == 'permissions': if property_id == 'permissions':
property_value = tdef.getPermissionList() property_value = tdef.getGuardPermission()
if property_id == 'expr': if property_id == 'expr':
property_value = tdef.getExpression() property_value = tdef.getGuardExpression()
if property_value is None or property_value == [] or property_value == (): if property_value is None or property_value == [] or property_value == ():
property_value = '' property_value = ''
elif property_id != 'expr': elif property_id != 'expr':
...@@ -949,13 +949,13 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -949,13 +949,13 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
# show guard configuration: # show guard configuration:
if property_id in ('roles', 'groups', 'permissions', 'expr',): if property_id in ('roles', 'groups', 'permissions', 'expr',):
if property_id == 'roles': if property_id == 'roles':
property_value = qdef.getRoleList() property_value = qdef.getGuardRole()
if property_id == 'groups': if property_id == 'groups':
property_value = qdef.getGroupList() property_value = qdef.getGuardGroup()
if property_id == 'permissions': if property_id == 'permissions':
property_value = qdef.getPermissionList() property_value = qdef.getGuardPermission()
if property_id == 'expr': if property_id == 'expr':
property_value = qdef.getExpression() property_value = qdef.getGuardExpression()
if property_value is not None: if property_value is not None:
property_value = tuple(property_value) property_value = tuple(property_value)
sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration')) sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration'))
......
...@@ -72,10 +72,10 @@ class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject): ...@@ -72,10 +72,10 @@ class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
return res return res
def getInfoGuard(self): def getInfoGuard(self):
if self.getRoleList() is None and\ if self.getGuardRole() is None and\
self.getPermissionList() is None and\ self.getGuardPermission() is None and\
self.getGroupList() is None and\ self.getGuardGroup() is None and\
self.getExpression() is None and\ self.getGuardExpression() is None and\
self.info_guard is None: self.info_guard is None:
return Guard().__of__(self) return Guard().__of__(self)
elif self.info_guard is None: elif self.info_guard is None:
...@@ -84,11 +84,11 @@ class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject): ...@@ -84,11 +84,11 @@ class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
def generateInfoGuard(self): def generateInfoGuard(self):
self.info_guard = Guard() self.info_guard = Guard()
if self.getRoleList() is not None: if self.getGuardRole() is not None:
self.info_guard.roles = self.getRoleList() self.info_guard.roles = self.getGuardRole()
if self.getPermissionList() is not None: if self.getGuardPermission() is not None:
self.info_guard.permissions = self.getPermissionList() self.info_guard.permissions = self.getGuardPermission()
if self.getGroupList() is not None: if self.getGuardGroup() is not None:
self.info_guard.groups = self.getGroupList() self.info_guard.groups = self.getGuardGroup()
if self.getExpression() is not None: if self.getGuardExpression() is not None:
self.info_guard.expr = Expression(self.getExpression()) self.info_guard.expr = Expression(self.getGuardExpression())
...@@ -84,10 +84,10 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject): ...@@ -84,10 +84,10 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
return res return res
def getGuard(self): def getGuard(self):
if self.getRoleList() is None and\ if self.getGuardRole() is None and\
self.getPermissionList() is None and\ self.getGuardPermission() is None and\
self.getGroupList() is None and\ self.getGuardGroup() is None and\
self.getExpression() is None and\ self.getGuardExpression() is None and\
self.guard is None: self.guard is None:
return Guard().__of__(self) return Guard().__of__(self)
elif self.guard is None: elif self.guard is None:
...@@ -96,14 +96,14 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject): ...@@ -96,14 +96,14 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
def generateGuard(self): def generateGuard(self):
self.guard = Guard() self.guard = Guard()
if self.getRoleList() is not None: if self.getGuardRole() is not None:
self.guard.roles = self.getRoleList() self.guard.roles = self.getGuardRole()
if self.getPermissionList() is not None: if self.getGuardPermission() is not None:
self.guard.permissions = self.getPermissionList() self.guard.permissions = self.getGuardPermission()
if self.getGroupList() is not None: if self.getGuardGroup() is not None:
self.guard.groups = self.getGroupList() self.guard.groups = self.getGuardGroup()
if self.getExpression() is not None: if self.getGuardExpression() is not None:
self.guard.expr = Expression(self.getExpression()) self.guard.expr = Expression(self.getGuardExpression())
def getAvailableCatalogVars(self): def getAvailableCatalogVars(self):
res = [] res = []
......
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