]> 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/BatchEntrySpec.js
Do not use Node.ELEMENT_NODE constant (FF only!), use 1 instead.
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-lib / slc / class / org / argeo / slc / ria / execution / BatchEntrySpec.js
1 /**
2 * Data model for an entry of the Batch list : original Spec, flow and module, and currently computed value.
3 */
4 qx.Class.define("org.argeo.slc.ria.execution.BatchEntrySpec", {
5 extend : org.argeo.slc.ria.execution.Spec,
6
7 properties : {
8 module :{},
9 flow : {},
10 originalSpec : {}
11 },
12
13 construct : function(module, flow){
14 this.base(arguments);
15 this.setModule(module);
16 this.setFlow(flow);
17 this.setOriginalSpec(flow.getExecutionSpec());
18 this.setName(flow.getExecutionSpec().getName());
19 this.fetchInstanceValues();
20 },
21
22 members : {
23
24 getLabel : function(){
25 var label = this.getModule().getName();
26 label += "/" + this.getModule().getVersion();
27 label += "/" + this.getFlow().getName();
28 return label;
29 },
30
31 toXml : function(){
32 return this.getLabel() + "\n";
33 },
34
35 /**
36 * Fetch the Spec Values with the Flow Values to make the current instance value
37 */
38 fetchInstanceValues : function(){
39 var specValues = this.getOriginalSpec().getValues();
40 var flow = this.getFlow();
41 var instanceValues = {};
42 for(var key in specValues){
43 var flowValue = flow.getValue(
44 key,
45 specValues[key].getSpecType(),
46 specValues[key].getSpecSubType()
47 );
48 var instValue = specValues[key].clone();
49 if(flowValue){
50 instValue.setValue(flowValue);
51 }
52 instanceValues[key] = instValue;
53 }
54 this.setValues(instanceValues);
55 this.debug(instanceValues);
56 }
57 }
58 });