Example #1
0
 def _GetToolObj(self, name, contextObject):
     """
     creates the tool object
     """
     if isinstance(name, basestring):
         conf = self.GetToolConf(name, contextObject)
         if isinstance(conf, (list, tuple)):
             conf = conf[0]
     else:
         conf = name
     if not conf:
         iface, conf = ResolveConfiguration(name)
         if not conf:
             raise ImportError, "Tool not found. Please load the tool by referencing the tool id. (%s)" % (str(name))
     tag = conf.context
     toolObj = GetClassRef(tag, self.reloadExtensions, True, None)
     toolObj = toolObj(conf, self)
     if not _IGlobal.providedBy(contextObject):
         toolObj.__parent__ = contextObject
     return toolObj
Example #2
0
    def _GetWfObj(self, name, contextObject):
        """
        creates the root object
        """
        wfConf = None
        if isinstance(name, basestring):
            wfConf = self.GetWorkflowConf(name, contextObject)
            if isinstance(wfConf, (list, tuple)):
                wfConf = wfConf[0]
        if not wfConf:
            iface, wfConf = ResolveConfiguration(name)
            if not wfConf:
                raise ImportError, "Workflow process not found. Please load the workflow by referencing the process id. (%s)" % (str(name))

        wfTag = wfConf.context
        wfObj = GetClassRef(wfTag, self.reloadExtensions, True, None)
        wfObj = wfObj(wfConf, self)
        if not _IGlobal.providedBy(contextObject):
            wfObj.__parent__ = contextObject
        return wfObj
Example #3
0
    def _GetWfObj(self, name, contextObject):
        """
        creates the root object
        """
        wfConf = None
        if isinstance(name, basestring):
            wfConf = self.GetWorkflowConf(name, contextObject)
            if isinstance(wfConf, (list, tuple)):
                wfConf = wfConf[0]
        if not wfConf:
            iface, wfConf = ResolveConfiguration(name)
            if not wfConf:
                raise ImportError, "Workflow process not found. Please load the workflow by referencing the process id. (%s)" % (
                    str(name))

        wfTag = wfConf.context
        wfObj = GetClassRef(wfTag, self.reloadExtensions, True, None)
        wfObj = wfObj(wfConf, self)
        if not _IGlobal.providedBy(contextObject):
            wfObj.__parent__ = contextObject
        return wfObj
Example #4
0
 def _GetToolObj(self, name, contextObject):
     """
     creates the tool object
     """
     if isinstance(name, basestring):
         conf = self.GetToolConf(name, contextObject)
         if isinstance(conf, (list, tuple)):
             conf = conf[0]
     else:
         conf = name
     if not conf:
         iface, conf = ResolveConfiguration(name)
         if not conf:
             raise ImportError, "Tool not found. Please load the tool by referencing the tool id. (%s)" % (
                 str(name))
     tag = conf.context
     toolObj = GetClassRef(tag, self.reloadExtensions, True, None)
     toolObj = toolObj(conf, self)
     if not _IGlobal.providedBy(contextObject):
         toolObj.__parent__ = contextObject
     return toolObj