Changeset 883 for branches/prototype-v0
- Timestamp:
- Sep 13, 2018, 3:52:14 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-api/js/ZOO-api.js
r879 r883 3686 3686 } 3687 3687 return res.length>1?res:res[0]; 3688 } else 3689 return null; 3688 } 3689 else{ 3690 var hasPercentCompleted=true; 3691 var status = node.*::Status.*::ProcessStarted; 3692 var msg = node.*::Status.*::ProcessStarted.*::*[0]; 3693 if(!status || !msg){ 3694 status = node.*::Status.*::ProcessAccepted; 3695 msg = node.*::Status.*::ProcessAccepted.*::*[0]; 3696 msg=msg.toString(); 3697 hasPercentCompleted=false; 3698 }else 3699 msg=msg.toString(); 3700 if(status!=null && node.@statusLocation){ 3701 var res={"status": node.@statusLocation.toXMLString(), "message": msg}; 3702 if(hasPercentCompleted) 3703 res["percentCompleted"]=status.@percentCompleted.toXMLString(); 3704 return res; 3705 }else 3706 return null; 3707 } 3690 3708 }, 3691 3709 /** … … 6143 6161 identifier: null, 6144 6162 /** 6163 * Property: async 6164 * {Bool} Define if the process should run asyncrhonously (true) or not (false, default). 6165 */ 6166 async: null, 6167 /** 6145 6168 * Constructor: ZOO.Process 6146 6169 * Create a new Process … … 6154 6177 this.url = url; 6155 6178 this.identifier = identifier; 6179 this.async = (arguments.length>2?arguments[2]:false); 6156 6180 }, 6157 6181 /** … … 6169 6193 if (this.identifier == null) 6170 6194 return null; 6171 var body = new XML('<wps:Execute service="WPS" version="1.0.0" xmlns:wps="'+this.namespaces['wps']+'" xmlns:ows="'+this.namespaces['ows']+'" xmlns:xlink="'+this.namespaces['xlink']+'" xmlns:xsi="'+this.namespaces['xsi']+'" xsi:schemaLocation="'+this.schemaLocation+'"><ows:Identifier>'+this.identifier+'</ows:Identifier>'+this.buildDataInputsNode(inputs)+this.buildDataOutputsNode(outputs)+'</wps:Execute>');6195 var body = new XML('<wps:Execute service="WPS" version="1.0.0" xmlns:wps="'+this.namespaces['wps']+'" xmlns:ows="'+this.namespaces['ows']+'" xmlns:xlink="'+this.namespaces['xlink']+'" xmlns:xsi="'+this.namespaces['xsi']+'" xsi:schemaLocation="'+this.schemaLocation+'"><ows:Identifier>'+this.identifier+'</ows:Identifier>'+this.buildDataInputsNode(inputs)+this.buildDataOutputsNode(outputs)+'</wps:Execute>'); 6172 6196 body = body.toXMLString(); 6173 6197 var headers=['Content-Type: text/xml; charset=UTF-8']; … … 6322 6346 } 6323 6347 var responseDocuments=(outputsArray[0].length>0? 6324 new XML('<wps:ResponseDocument xmlns:wps="'+this.namespaces['wps']+'">'+6348 new XML('<wps:ResponseDocument '+(this.async?'storeExecuteResponse="true" status="true"':'')+' xmlns:wps="'+this.namespaces['wps']+'">'+ 6325 6349 outputsArray[0].join('\n')+ 6326 6350 '</wps:ResponseDocument>')
Note: See TracChangeset
for help on using the changeset viewer.