]>
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
b3e30349636dff62386a2a21e741ee7917c90668
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(){
58 * Add an execution flow to this module
59 * @param executionFlow {org.argeo.slc.ria.execution.Flow}
61 addExecutionFlow : function(executionFlow
){
62 var spec
= this.getExecutionSpecByName(executionFlow
.getExecutionSpecName());
64 executionFlow
.setExecutionSpec(spec
);
66 this.error("Warning, reference to an unknown ExecutionSpec : "+executionFlow
.getExecutionSpecName());
68 this.getExecutionFlows()[executionFlow
.getName()] = executionFlow
;
72 * Add an execution Spec to this module
73 * @param executionSpec {org.argeo.slc.ria.execution.Spec}
75 addExecutionSpec : function(executionSpec
){
76 this.getExecutionSpecs()[executionSpec
.getName()] = executionSpec
;
79 getExecutionSpecByName : function(name
){
80 return this.getExecutionSpecs()[name
];
83 getExecutionFlowByName : function(name
){
84 return this.getExecutionFlows()[name
];
88 * An xml node containing the castor mapped description of this object
89 * @param xmlNode {Node}
91 _applyXmlNode : function(xmlNode
){
93 this.setName(org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_NAME
));
94 this.setVersion(org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_VERSION
));
96 var specs
= org
.argeo
.ria
.util
.Element
.selectNodes(xmlNode
, this.self(arguments
).XPATH_EXECUTION_SPECS
);
97 for(i
=0; i
< specs
.length
;i
++){
98 var execSpec
= new org
.argeo
.slc
.ria
.execution
.Spec();
99 execSpec
.setXmlNode(specs
[i
]);
100 this.addExecutionSpec(execSpec
);
102 // Now parse Flows : to do AFTER specs
103 var flows
= org
.argeo
.ria
.util
.Element
.selectNodes(xmlNode
, this.self(arguments
).XPATH_EXECUTION_FLOWS
);
104 for(var i
=0;i
<flows
.length
;i
++){
105 var execFlow
= new org
.argeo
.slc
.ria
.execution
.Flow();
106 execFlow
.setXmlNode(flows
[i
]);
107 this.addExecutionFlow(execFlow
);