Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

WPS Manager

tdipisa edited this page Apr 5, 2013 · 6 revisions

Needed Files

In order to use the WPS plugin in MapStore you need to be sure that the files below are included in the buildjs.cfg file:

  • openlayers-ext/lib/OpenLayers/Format/WCSGetCoverage.js
  • openlayers-ext/lib/OpenLayers/Format/OGCExceptionReport.js
  • openlayers-ext/lib/OpenLayers/Format/XML/VersionedOGC.js
  • openlayers-ext/lib/OpenLayers/Format/OWSCommon.js
  • openlayers-ext/lib/OpenLayers/Format/OWSCommon/v1_ext.js
  • openlayers-ext/lib/OpenLayers/Format/WFST/v1_1_0_ext.js
  • openlayers-ext/lib/OpenLayers/Format/OWSCommon/v1_1_0_ext.js
  • openlayers-ext/lib/OpenLayers/Format/GeoStore.js
  • openlayers-ext/lib/OpenLayers/RequestExt.js
  • openlayers-ext/lib/OpenLayers/EventsExt.js
  • openlayers-ext/lib/OpenLayers/RequestExt/XMLHttpRequestExt.js
  • openlayers-ext/lib/OpenLayers/GeoStore.js
  • openlayers-ext/lib/OpenLayers/WPSClient.js
  • openlayers-ext/lib/OpenLayers/WPSProcess.js
  • openlayers-ext/lib/OpenLayers/Format/WPSDescribeProcess.js
  • openlayers-ext/lib/OpenLayers/Format/WPSExecute.js
  • openlayers-ext/lib/OpenLayers/Format/WPSExecuteRequest.js
  • gxp/src/script/plugins/wpsmanager/lib/WPSManager.js
  • gxp/src/script/plugins/client/lib/GeoStoreClient.js

NOTE: In the default configuration this is already done.

##Plugin Description

The WPS Manager Plugin provides a high level API for interaction with Web Processing Services (WPS) and manager the Process instances.

An gxp.plugins.WPSManager uses a OpenLayersExt.WPSClient for the WPS intercation and a gxp.plugins.GeoStoreClient to store the Execute instances.

When the WPSManager plugin is instantiated a "Geostore Category" called as plugin id is created. The WPS Manager Plugin supports synchronous and asynchronus Execute requests. For each Execute request a "Geostore Resource" is created.

For the asynchronous request supports the status update, for the synchronous requests supports the "raw" data outputs.

The resource description contains a execute status information and the output type (raw or not raw). The resource store data contains directly the output if the output type is raw or a JSON Object wich contains the Execute response information. For the Execute response parsing is used the OpenLayersExt.Format.WPSExecute object.

##Configuration Exemple

Besides the plugin configuration the following script import must be uncommented from the composer.html file:

<!-- Externatls OpenLayers libraries to manage WPS processes  --> 
<script type="text/javascript" src="script/OpenLayersExt.js"></script>

Then you have to specify the a valid plugin configuration, something like that:

{
   "ptype": "gxp_wpsmanager",
   "id": "wpsSPM",
   "url": "http://localhost:8080/geoserver/wps",
   "geostoreUrl": "http://localhost:8080/geostore/rest",
   "geostoreUser": "admin",
   "geostorePassword": "admin",
   "geostoreProxy": "/http_proxy/proxy?url="
 }
  • ptype: ptype of the plugin
  • id: plugin identifies
  • url: URL of the WPS service
  • geostoreUrl: GeoStore REST base URL
  • geostoreUser: a valid user name to allow Categorty creation
  • geostorePassword: the corresponding user password
  • geostoreProxy: The proxy to use for Ajax cross domain requests.

##Send WPS Execute request In order to send a Execute Request with WPSManager plugin you have to use the execute method:

wpsManager.execute(processName,executeRequest,callback);

The processName is the WPS Process name.

The executeRequest can be an Object which contains the request properties or a String which contains directly the WPS Execute request. For the WPS Execute request parsing is used the OpenlayersExt.Format.WPSExecuteRequest which define a object with the request properties.This object properties are:

  • storeExecuteResponse: Boolean Optional. Indicates if the execute response document shall be stored (if true Asynchronous instance).
  • lineage: Boolean Optional. Indicates if the Execute operation response shall include the DataInputs and OutputDefinitions elements.
  • status: Boolean Optional. Indicates if the stored execute response document shall be updated to provide ongoing reports on the status of execution.
  • type: String Optional. Type of output ("data" or "raw")
  • inputs: Object Mandatory. The inputs for the process, keyed by input identifier.The data input types currently supported are: OpenLayers.WPSProcess.LiteralData, OpenLayers.WPSProcess.ComplexData, OpenLayers.WPSProcess.BoundingBoxData, OpenLayers.WPSProcess.ReferenceData.
  • outputs: Array Mandatory. Array of OpenLayers.WPSProcess.Output Object

The optional callback is a function to call when the execute response is retrieved.

##WPS Execute Synchronous request An example of sending WPS Execute synchronous request is the following:

wpsManager.execute('JTS:isValid',{
   "inputs": {
            geom: new OpenLayers.WPSProcess.ComplexData({
                  value: "POINT(6 40)",
                  mimeType: "application/wkt"
             })
   },
   "outputs": [{
        "identifier": "result",
        "mimeType" : "text/xml"
   }]
 });

The sequence of interactions is described on the following figure:

WPSManager -  Execute synchronous request - sequence of intercations

##WPS Execute Asynchronous request An example of sending WPS Execute asynchronous request is the following:

wpsManager.execute('JTS:isValid',{
   "storeExecuteResponse": true,
   "lineage": true,
   "status": true,
   "inputs": {
            geom: new OpenLayers.WPSProcess.ComplexData({
                  value: "POINT(6 40)",
                  mimeType: "application/wkt"
             })
   },
   "outputs": [{
        "identifier": "result",
        "mimeType" : "text/xml"
   }]
 });

The sequence of interactions is described on the following figure:

WPSManager - Execute asynchronous request - sequence of intercations

Clone this wiki locally