Ignore:
Timestamp:
Aug 5, 2011, 3:02:43 PM (13 years ago)
Author:
djay
Message:

Merge branch-1.2 r268:r296.

Location:
branches/branch-1.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1.2

  • branches/branch-1.2/zoo-api/js/ZOO-api.js

    r217 r301  
    60676067   *          needs to be interpreted.
    60686068   */
    6069   Execute: function(inputs) {
     6069  Execute: function(inputs,outputs) {
    60706070    if (this.identifier == null)
    60716071      return null;
    6072     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)+'</wps:Execute>');
     6072    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>');
    60736073    body = body.toXMLString();
    60746074    var response = ZOO.Request.Post(this.url,body,['Content-Type: text/xml; charset=UTF-8']);
    60756075    return response;
    60766076  },
    6077   /**
    6078    * Property: buildInput
    6079    * Object containing methods to build WPS inputs.
    6080    */
    6081   buildInput: {
    6082     /**
    6083      * Method: buildInput.complex
    6084      * Given an E4XElement representing the WPS complex data input.
     6077  buildOutput:{
     6078    /**
     6079     * Method: buildOutput.ResponseDocument
     6080     * Given an E4XElement representing the WPS ResponseDocument output.
    60856081     *
    60866082     * Parameters:
     
    60916087     * {E4XElement} A WPS Input node.
    60926088     */
     6089    'ResponseDocument': function(identifier,obj) {
     6090      var output = new XML('<wps:ResponseForm xmlns:wps="'+this.namespaces['wps']+'"><wps:ResponseDocument><wps:Output'+(obj["mimeType"]?' mimeType="'+obj["mimeType"]+'" ':'')+(obj["encoding"]?' encoding="'+obj["encoding"]+'" ':'')+(obj["asReference"]?' asReference="'+obj["asReference"]+'" ':'')+'><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier></wps:Output></wps:ResponseDocument></wps:ResponseForm>');
     6091      if (obj.encoding)
     6092        output.*::Data.*::ComplexData.@encoding = obj.encoding;
     6093      if (obj.schema)
     6094        output.*::Data.*::ComplexData.@schema = obj.schema;
     6095      output = output.toXMLString();
     6096      return output;
     6097    },
     6098    'RawDataOutput': function(identifier,obj) {
     6099      var output = new XML('<wps:ResponseForm xmlns:wps="'+this.namespaces['wps']+'"><wps:RawDataOutput><wps:Output '+(obj["mimeType"]?' mimeType="'+obj["mimeType"]+'" ':'')+(obj["encoding"]?' encoding="'+obj["encoding"]+'" ':'')+'><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier></wps:Output></wps:RawDataOutput></wps:ResponseForm>');
     6100      if (obj.encoding)
     6101        output.*::Data.*::ComplexData.@encoding = obj.encoding;
     6102      if (obj.schema)
     6103        output.*::Data.*::ComplexData.@schema = obj.schema;
     6104      output = output.toXMLString();
     6105      return output;
     6106    }
     6107
     6108  },
     6109  /**
     6110   * Property: buildInput
     6111   * Object containing methods to build WPS inputs.
     6112   */
     6113  buildInput: {
     6114    /**
     6115     * Method: buildInput.complex
     6116     * Given an E4XElement representing the WPS complex data input.
     6117     *
     6118     * Parameters:
     6119     * identifier - {String} the input indetifier
     6120     * data - {Object} A WPS complex data input.
     6121     *
     6122     * Returns:
     6123     * {E4XElement} A WPS Input node.
     6124     */
    60936125    'complex': function(identifier,data) {
    6094       var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Data><wps:ComplexData>'+data.value+'</wps:ComplexData></wps:Data></wps:Input>');
    6095       input.*::Data.*::ComplexData.@mimeType = data.mimetype ? data.mimetype : 'text/plain';
     6126      var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Data><wps:ComplexData><![CDATA['+data.value+']]></wps:ComplexData></wps:Data></wps:Input>');
     6127      input.*::Data.*::ComplexData.@mimeType = data.mimetype ? data.mimetype : 'application/json';
    60966128      if (data.encoding)
    60976129        input.*::Data.*::ComplexData.@encoding = data.encoding;
     
    61606192    return '<wps:DataInputs xmlns:wps="'+this.namespaces['wps']+'">'+inputsArray.join('\n')+'</wps:DataInputs>';
    61616193  },
     6194
     6195  buildDataOutputsNode:function(outputs){
     6196    var data, builder, outputsArray=[];
     6197    for (var attr in outputs) {
     6198      data = outputs[attr];
     6199      builder = this.buildOutput[data.type];
     6200      outputsArray.push(builder.apply(this,[attr,data]));
     6201    }
     6202    return outputsArray.join('\n');
     6203  },
     6204
    61626205  CLASS_NAME: "ZOO.Process"
    61636206});
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