示例#1
0
def add_worklists(self):
    wft = getToolByName(self, 'portal_workflow')
    for wf in wft.objectValues():
        if not IWorkflowDefinition.providedBy(wf):
            continue
        if not getattr(wf, 'worklists', None):
            wf._addObject(Worklists('worklists'))
示例#2
0
 def getWorkflowIds(self):
     """ Return the list of workflow ids.
     """
     wf_ids = []
     for obj_name, obj in self.objectItems():
         if IWorkflowDefinition.providedBy(obj):
             wf_ids.append(obj_name)
     return tuple(wf_ids)
示例#3
0
 def getWorkflowById(self, wf_id):
     """ Retrieve a given workflow.
     """
     wf = getattr(self, wf_id, None)
     if IWorkflowDefinition.providedBy(wf):
         return wf
     else:
         return None
示例#4
0
 def getWorkflowIds(self):
     """ Return the list of workflow ids.
     """
     wf_ids = []
     for obj_name, obj in self.objectItems():
         if IWorkflowDefinition.providedBy(obj):
             wf_ids.append(obj_name)
     return tuple(wf_ids)
示例#5
0
 def getWorkflowById(self, wf_id):
     """ Retrieve a given workflow.
     """
     wf = getattr(self, wf_id, None)
     if IWorkflowDefinition.providedBy(wf):
         return wf
     else:
         return None
示例#6
0
def check_workflow_definitions(tool):
    """2.1.x to 2.2.0 upgrade step checker
    """
    wtool = getToolByName(tool, 'portal_workflow')
    for obj in wtool.objectValues():
        if IWorkflowDefinition.providedBy(obj):
            for t in obj.transitions.values():
                if not t.actbox_icon and t.getId() in _ACTION_ICONS:
                    return True
            for w in obj.worklists.values():
                if not w.actbox_icon and w.getId() in _ACTION_ICONS:
                    return True
    return False
示例#7
0
 def getWorkflowById(self, wf_id):
     """ Retrieve a given workflow.
     """
     wf = getattr(self, wf_id, None)
     if IWorkflowDefinition.providedBy(wf):
         return wf
     if getattr(wf, '_isAWorkflow', False):
         # BBB
         warn("The '_isAWorkflow' marker attribute for workflow "
              "definitions is deprecated and will be removed in "
              "CMF 2.3;  please mark the definition with "
              "'IWorkflowDefinition' instead.",
              DeprecationWarning, stacklevel=2)
         return wf
     else:
         return None
示例#8
0
 def getWorkflowById(self, wf_id):
     """ Retrieve a given workflow.
     """
     wf = getattr(self, wf_id, None)
     if IWorkflowDefinition.providedBy(wf):
         return wf
     if getattr(wf, '_isAWorkflow', False):
         # BBB
         warn(
             "The '_isAWorkflow' marker attribute for workflow "
             "definitions is deprecated and will be removed in "
             "CMF 2.3;  please mark the definition with "
             "'IWorkflowDefinition' instead.",
             DeprecationWarning,
             stacklevel=2)
         return wf
     else:
         return None
示例#9
0
    def getWorkflowIds(self):

        """ Return the list of workflow ids.
        """
        wf_ids = []

        for obj_name, obj in self.objectItems():
            if IWorkflowDefinition.providedBy(obj):
                wf_ids.append(obj_name)
            elif getattr(obj, '_isAWorkflow', 0):
                # BBB
                warn("The '_isAWorkflow' marker attribute for workflow "
                     "definitions is deprecated and will be removed in "
                     "CMF 2.3;  please mark the definition with "
                     "'IWorkflowDefinition' instead.",
                     DeprecationWarning, stacklevel=2)
                wf_ids.append(obj_name)

        return tuple(wf_ids)
示例#10
0
def upgrade_workflow_definitions(tool):
    """2.1.x to 2.2.0 upgrade step handler
    """
    logger = logging.getLogger('GenericSetup.upgrade')
    wtool = getToolByName(tool, 'portal_workflow')
    for wf in wtool.objectValues():
        changed = False
        if IWorkflowDefinition.providedBy(wf):
            for t in wf.transitions.values():
                if not t.actbox_icon and t.getId() in _ACTION_ICONS:
                    icon = _ACTION_ICONS[t.getId()]
                    t.actbox_icon = '%(portal_url)s/' + icon
                    changed = True
            for w in wf.worklists.values():
                if not w.actbox_icon and w.getId() in _ACTION_ICONS:
                    icon = _ACTION_ICONS[w.getId()]
                    w.actbox_icon = '%(portal_url)s/' + icon
                    changed = True
        if changed:
            logger.info("WorkflowDefinition '%s' changed." % wf.getId())
示例#11
0
    def getWorkflowIds(self):
        """ Return the list of workflow ids.
        """
        wf_ids = []

        for obj_name, obj in self.objectItems():
            if IWorkflowDefinition.providedBy(obj):
                wf_ids.append(obj_name)
            elif getattr(obj, '_isAWorkflow', 0):
                # BBB
                warn(
                    "The '_isAWorkflow' marker attribute for workflow "
                    "definitions is deprecated and will be removed in "
                    "CMF 2.3;  please mark the definition with "
                    "'IWorkflowDefinition' instead.",
                    DeprecationWarning,
                    stacklevel=2)
                wf_ids.append(obj_name)

        return tuple(wf_ids)