def test_confs(self): self.assert_(self.app.QueryConf(IRootConf)) self.assert_(self.app.QueryConf("nive.definitions.IRootConf")) self.assert_(self.app.QueryConf(IToolConf, _GlobalObject())) self.assertFalse(self.app.QueryConf("nive.definitions.no_conf")) self.assert_(self.app.QueryConfByName(IRootConf, "root")) self.assert_(self.app.QueryConfByName("nive.definitions.IRootConf", "root")) self.assert_(self.app.QueryConfByName(IToolConf, "tool", _GlobalObject())) self.assertFalse(self.app.QueryConfByName("nive.definitions.no_conf", "root")) self.assert_(self.app.Factory(IRootConf, "root")) self.assert_(self.app.Factory("nive.definitions.IRootConf", "root")) self.assert_(self.app.Factory(IToolConf, "tool", _GlobalObject())) self.assertFalse(self.app.Factory("nive.definitions.no_conf", "root"))
def GetTool(self, toolID, contextObject=None): """ Load tool object. *toolID* must be the tool.id or dotted python name. returns the tool object. """ return self._GetToolObj(toolID, contextObject or _GlobalObject())
def GetWorkflow(self, wfProcID, contextObject=None): """ Load workflow process. *wfProcID* must be the wf.id or dotted python name. returns the workflow object """ if not self.configuration.workflowEnabled: return None return self._GetWfObj(wfProcID, contextObject or _GlobalObject())
def GetWorkflowConf(self, processID, contextObject=None): """ Get the workflow process configuration. returns configuration or None """ v = self.registry.queryAdapter(contextObject or _GlobalObject(), IWfProcessConf, name=processID) if v: return v[0] return None
def GetToolConf(self, toolID, contextObject=None): """ Get the tool configuration. returns configuration or None """ if not contextObject: contextObject = _GlobalObject() v = self.registry.queryAdapter(contextObject, IToolConf, name=toolID) if v: return v[0] return None