Changeset 883


Ignore:
Timestamp:
Sep 13, 2018, 3:52:14 PM (6 years ago)
Author:
djay
Message:

Add the capability to parse Execute response when service has been called asynchronously

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-api/js/ZOO-api.js

    r879 r883  
    36863686      }
    36873687      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    }
    36903708  },
    36913709  /**
     
    61436161  identifier: null,
    61446162  /**
     6163   * Property: async
     6164   * {Bool} Define if the process should run asyncrhonously (true) or not (false, default).
     6165   */
     6166  async: null,
     6167  /**
    61456168   * Constructor: ZOO.Process
    61466169   * Create a new Process
     
    61546177    this.url = url;
    61556178    this.identifier = identifier;
     6179    this.async = (arguments.length>2?arguments[2]:false);
    61566180  },
    61576181  /**
     
    61696193    if (this.identifier == null)
    61706194      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>');
    61726196    body = body.toXMLString();
    61736197    var headers=['Content-Type: text/xml; charset=UTF-8'];
     
    63226346    }
    63236347    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']+'">'+
    63256349                                   outputsArray[0].join('\n')+
    63266350                                   '</wps:ResponseDocument>')
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png