Changeset 101 for trunk


Ignore:
Timestamp:
Jan 31, 2011, 4:49:49 PM (14 years ago)
Author:
reluc
Message:

Ending the ZOO-api documentation
Adding the capability to parse WPS Reference Response.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-api/js/ZOO-api.js

    r86 r101  
    36283628        result.uom = node.@uom;
    36293629      return result;
     3630    },
     3631    /**
     3632     * Method: parseData.reference
     3633     * Given an Object representing the WPS reference response.
     3634     *
     3635     * Parameters:
     3636     * node - {E4XElement} A WPS node.
     3637     *
     3638     * Returns:
     3639     * {Object} A WPS reference response.
     3640     */
     3641    'reference': function(node) {
     3642      var result = {type:'reference',value:node.*::href};
     3643      return result;
    36303644    }
    36313645  },
     
    38493863});
    38503864/**
    3851  * Function: OpenLayers.Geometry.fromWKT
     3865 * Function: ZOO.Geometry.fromWKT
    38523866 * Generate a geometry given a Well-Known Text string.
    38533867 *
     
    39924006};
    39934007/**
    3994  * Class: OpenLayers.Geometry.Collection
     4008 * Class: ZOO.Geometry.Collection
    39954009 * A Collection is exactly what it sounds like: A collection of different
    39964010 * Geometries. These are stored in the local parameter <components> (which
     
    52605274 *
    52615275 * Inherits:
    5262  *  - <OpenLayers.Geometry.LineString>
     5276 *  - <ZOO.Geometry.LineString>
    52635277 */
    52645278ZOO.Geometry.LinearRing = ZOO.Class(
     
    52725286  componentTypes: ["ZOO.Geometry.Point"],
    52735287  /**
    5274    * Constructor: OpenLayers.Geometry.LinearRing
     5288   * Constructor: ZOO.Geometry.LinearRing
    52755289   * Linear rings are constructed with an array of points.  This array
    52765290   *     can represent a closed or open ring.  If the ring is open (the last
     
    57865800  componentTypes: ["ZOO.Geometry.LinearRing"],
    57875801  /**
    5788    * Constructor: OpenLayers.Geometry.Polygon
     5802   * Constructor: ZOO.Geometry.Polygon
    57895803   * Constructor for a Polygon geometry.
    57905804   * The first ring (this.component[0])is the outer bounds of the polygon and
     
    59775991  componentTypes: ["ZOO.Geometry.Polygon"],
    59785992  /**
    5979    * Constructor: OpenLayers.Geometry.MultiPolygon
     5993   * Constructor: ZOO.Geometry.MultiPolygon
    59805994   * Create a new MultiPolygon geometry
    59815995   *
     
    59906004  CLASS_NAME: "ZOO.Geometry.MultiPolygon"
    59916005});
    5992 
     6006/**
     6007 * Class: ZOO.Process
     6008 * Used to query OGC WPS process defined by its URL and its identifier.
     6009 * Usefull for chaining localhost process.
     6010 */
    59936011ZOO.Process = ZOO.Class({
     6012  /**
     6013   * Property: schemaLocation
     6014   * {String} Schema location for a particular minor version.
     6015   */
    59946016  schemaLocation: "http://www.opengis.net/wps/1.0.0/../wpsExecute_request.xsd",
     6017  /**
     6018   * Property: namespaces
     6019   * {Object} Mapping of namespace aliases to namespace URIs.
     6020   */
    59956021  namespaces: {
    59966022    ows: "http://www.opengis.net/ows/1.1",
     
    59996025    xsi: "http://www.w3.org/2001/XMLSchema-instance",
    60006026  },
     6027  /**
     6028   * Property: url
     6029   * {String} The OGC's Web PRocessing Service URL,
     6030   *          default is http://localhost/zoo.
     6031   */
    60016032  url: 'http://localhost/zoo',
     6033  /**
     6034   * Property: identifier
     6035   * {String} Process identifier in the OGC's Web Processing Service.
     6036   */
    60026037  identifier: null,
     6038  /**
     6039   * Constructor: ZOO.Process
     6040   * Create a new Process
     6041   *
     6042   * Parameters:
     6043   * url - {String} The OGC's Web Processing Service URL.
     6044   * identifier - {String} The process identifier in the OGC's Web Processing Service.
     6045   *
     6046   */
    60036047  initialize: function(url,identifier) {
    60046048    this.url = url;
    60056049    this.identifier = identifier;
    60066050  },
     6051  /**
     6052   * Method: Execute
     6053   * Query the OGC's Web PRocessing Servcie to Execute the process.
     6054   *
     6055   * Parameters:
     6056   * inputs - {Object}
     6057   *
     6058   * Returns:
     6059   * {String} The OGC's Web processing Service XML response. The result
     6060   *          needs to be interpreted.
     6061   */
    60076062  Execute: function(inputs) {
    60086063    if (this.identifier == null)
     
    60136068    return response;
    60146069  },
     6070  /**
     6071   * Property: buildInput
     6072   * Object containing methods to build WPS inputs.
     6073   */
    60156074  buildInput: {
     6075    /**
     6076     * Method: buildInput.complex
     6077     * Given an E4XElement representing the WPS complex data input.
     6078     *
     6079     * Parameters:
     6080     * identifier - {String} the input indetifier
     6081     * data - {Object} A WPS complex data input.
     6082     *
     6083     * Returns:
     6084     * {E4XElement} A WPS Input node.
     6085     */
    60166086    'complex': function(identifier,data) {
    60176087      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>');
     
    60246094      return input;
    60256095    },
     6096    /**
     6097     * Method: buildInput.reference
     6098     * Given an E4XElement representing the WPS reference input.
     6099     *
     6100     * Parameters:
     6101     * identifier - {String} the input indetifier
     6102     * data - {Object} A WPS reference input.
     6103     *
     6104     * Returns:
     6105     * {E4XElement} A WPS Input node.
     6106     */
    60266107    'reference': function(identifier,data) {
    60276108      return '<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Reference xmlns:xlink="'+this.namespaces['xlink']+'" xlink:href="'+data.value.replace('&','&amp;','gi')+'"/></wps:Input>';
    60286109    },
     6110    /**
     6111     * Method: buildInput.literal
     6112     * Given an E4XElement representing the WPS literal data input.
     6113     *
     6114     * Parameters:
     6115     * identifier - {String} the input indetifier
     6116     * data - {Object} A WPS literal data input.
     6117     *
     6118     * Returns:
     6119     * {E4XElement} The WPS Input node.
     6120     */
    60296121    'literal': function(identifier,data) {
    60306122      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>');
     
    60376129    }
    60386130  },
     6131  /**
     6132   * Method: buildDataInputsNode
     6133   * Method to build the WPS DataInputs element.
     6134   *
     6135   * Parameters:
     6136   * inputs - {Object}
     6137   *
     6138   * Returns:
     6139   * {E4XElement} The WPS DataInputs node for Execute query.
     6140   */
    60396141  buildDataInputsNode:function(inputs){
    60406142    var data, builder, inputsArray=[];
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