Skip to content

BBOXQueryForm Plugin

amarong edited this page May 27, 2013 · 10 revisions

Needed Files

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

  • openlayers-ext/lib/OpenLayers/Control/SetBox.js
  • gxp/src/script/widgets/form/BBOXFieldset.js
  • gxp/src/script/widgets/FilterBuilder.js
  • gxp/src/script/plugins/QueryForm.js

NOTE: In the default configuration this is already done.

##Plugin Description

The BBOX Query Form plugins for performing queries on feature layers. Using this plugin you can create alphanumeric queries on attributes of the "features" and / or spatial query on a specific area of ​​interest.

##Configuration Example

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

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

Then you have to specify a valid plugin configuration, such as:

{
		"ptype": "gxp_bboxqueryform",
		"featureManager": "featuremanager",
		"outputTarget": "east",
		"actions": null,
                    "id": "bboxquery",
                    "outputConfig":{
		 "outputSRS": "EPSG:900913",
                     "selectStyle":{
                        "strokeColor": "#FF0000",
                        "handlerFillColor": "#FFFFFF",
                        "fillColor": "#FFFFFF",
                        "fillOpacity":0,
                        "strokeWidth":2
                    },
                    "spatialFilterOptions": {
                        "lonMax": null,   
                        "lonMin": null,
                        "latMax": null,   
                        "latMin": null  
		}
                    }
	}
  • ptype: ptype of the plugin
  • id: plugin identifier
  • 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 an Execute Request with the 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. To parse the WPS Execute request, the OpenlayersExt.Format.WPSExecuteRequest object is used; this defines an 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 a 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 a 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