]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Module.js
8e69c92b2b3b574294c78a2857bcc05bf893690f
2 * Wrapper for ExecutionModule server object
4 qx
.Class
.define("org.argeo.slc.ria.execution.Module", {
6 extend
: qx
.core
.Object
,
10 * The name of the module
17 * The version of the module
24 * All execution flows registered by their name
31 * All execution specs registered by their name
38 * XML description (castor)
41 apply
: "_applyXmlNode"
46 XPATH_NAME
: "slc:execution-module-descriptor/slc:name",
47 XPATH_VERSION
: "slc:execution-module-descriptor/slc:version",
48 XPATH_EXECUTION_FLOWS
: "slc:execution-module-descriptor/slc:executionFlows/slc:execution-flow-descriptor",
49 XPATH_EXECUTION_SPECS
: "slc:execution-module-descriptor/slc:executionSpecs/slc:simple-execution-spec"
52 construct : function(){},
56 * Add an execution flow to this module
57 * @param executionFlow {org.argeo.slc.ria.execution.Flow}
59 addExecutionFlow : function(executionFlow
){
60 var spec
= this.getExecutionSpecByName(executionFlow
.getExecutionSpecName());
62 executionFlow
.setExecutionSpec(spec
);
64 this.error("Warning, reference to an unknown ExecutionSpec : "+executionFlow
.getExecutionSpecName());
66 this.getExecutionFlows()[executionFlow
.getName()] = executionFlow
;
70 * Add an execution Spec to this module
71 * @param executionSpec {org.argeo.slc.ria.execution.Spec}
73 addExecutionSpec : function(executionSpec
){
74 this.getExecutionSpecs()[executionSpec
.getName()] = executionSpec
;
77 getExecutionSpecByName : function(name
){
78 return this.getExecutionSpecs()[name
];
81 getExecutionFlowByName : function(name
){
82 return this.getExecutionFlows()[name
];
86 * An xml node containing the castor mapped description of this object
87 * @param xmlNode {Node}
89 _applyXmlNode : function(xmlNode
){
91 this.setName(org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_NAME
));
92 this.setVersion(org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_VERSION
));
94 var specs
= org
.argeo
.ria
.util
.Element
.selectNodes(xmlNode
, this.self(arguments
).XPATH_EXECUTION_SPECS
);
95 for(i
=0; i
< specs
.length
;i
++){
96 var execSpec
= new org
.argeo
.slc
.ria
.execution
.Spec();
97 execSpec
.setXmlNode(specs
[i
]);
98 this.addExecutionSpec(execSpec
);
100 // Now parse Flows : to do AFTER specs
101 var flows
= org
.argeo
.ria
.util
.Element
.selectNodes(xmlNode
, this.self(arguments
).XPATH_EXECUTION_FLOWS
);
102 for(var i
=0;i
<flows
.length
;i
++){
103 var execFlow
= new org
.argeo
.slc
.ria
.execution
.Flow();
104 execFlow
.setXmlNode(flows
[i
]);
105 this.addExecutionFlow(execFlow
);