Changeset 383 for trunk/zoo-project/zoo-api
- Timestamp:
- Jan 8, 2013, 3:54:57 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-api/js/ZOO-api.js
r377 r383 6159 6159 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>'); 6160 6160 body = body.toXMLString(); 6161 var response = ZOO.Request.Post(this.url,body,['Content-Type: text/xml; charset=UTF-8']); 6161 var headers=['Content-Type: text/xml; charset=UTF-8']; 6162 if(arguments.length>2){ 6163 headers[headers.length]=arguments[2]; 6164 } 6165 var response = ZOO.Request.Post(this.url,body,headers); 6162 6166 return response; 6163 6167 }, … … 6249 6253 */ 6250 6254 'literal': function(identifier,data) { 6251 var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Data><wps:LiteralData>'+data.value+'</wps:LiteralData></wps:Data></wps:Input>'); 6255 if(data && !eval(data["isArray"])){ 6256 var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Data><wps:LiteralData>'+data.value+'</wps:LiteralData></wps:Data></wps:Input>'); 6252 6257 if (data.type) 6253 6258 input.*::Data.*::LiteralData.@dataType = data.type; … … 6256 6261 input = input.toXMLString(); 6257 6262 return input; 6263 }else if(data){ 6264 var inputf=""; 6265 for(i=0;i<parseInt(data["length"]);i++){ 6266 var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Data><wps:LiteralData>'+data.value[i]+'</wps:LiteralData></wps:Data></wps:Input>'); 6267 if (data.type) 6268 input.*::Data.*::LiteralData.@dataType = data.type; 6269 if (data.uom) 6270 input.*::Data.*::LiteralData.@uom = data.uom; 6271 inputf += input.toXMLString(); 6272 } 6273 return inputf; 6274 } 6275 6258 6276 } 6259 6277 }, … … 6272 6290 for (var attr in inputs) { 6273 6291 data = inputs[attr]; 6274 if (data.mimetype || data.type == 'complex')6292 if (data && (data.mimetype || data.type == 'complex')) 6275 6293 builder = this.buildInput['complex']; 6276 else if (data.type == 'reference' || data.type == 'url')6294 else if (data && (data.type == 'reference' || data.type == 'url')) 6277 6295 builder = this.buildInput['reference']; 6278 6296 else
Note: See TracChangeset
for help on using the changeset viewer.