OpenLayers.WPSProcess

Representation of a WPS process.  Usually instances of OpenLayers.WPSProcess are created by calling ‘getProcess’ on an OpenLayers.WPSClient instance.

Currently OpenLayers.WPSProcess supports processes that have geometries or features as output, using WKT or GeoJSON as output format.  It also supports chaining of processes by using the output method to create a handle that is used as process input instead of a static value.

Summary
OpenLayers.WPSProcessRepresentation of a WPS process.
Properties
client{OpenLayers.WPSClient} The client that manages this process.
server{String} Local client identifier for this process’s server.
identifier{String} Process identifier known to the server.
description{Object} DescribeProcess response for this process.
localWPS{String} Service endpoint for locally chained WPS processes.
formats{Object} OpenLayers.Format instances keyed by mimetype.
chained{Integer} Number of chained processes for pending execute requests that don’t have a full configuration yet.
executeCallbacks{Array} Callbacks waiting to be executed until all chained processes are configured;
Constructor
OpenLayers.WPSProcess
Functions
describeMakes the client issue a DescribeProcess request asynchronously.
configureConfigure the process, but do not execute it.
executeConfigures and executes the process
outputChain an output of a configured process (see configure) as input to another process.
parseDescriptionParses the DescribeProcess response
setInputDataSets the data for a single input
setResponseFormSets the responseForm property of the execute payload.
getOutputIndexGets the index of a processOutput by its identifier
chainProcessSets a fully configured chained process as input for this process.
toFeaturesConverts spatial input into features so it can be processed by OpenLayers.Format instances.
findMimeTypeFinds a supported mime type.
OpenLayers.WPSProcess.ChainLinkType for chaining processes.
Properties
process{OpenLayers.WPSProcess} The process to chain
output{String} The output identifier of the output we are going to use as input for another process.
Constructor
OpenLayers.WPSProcess.ChainLink

Properties

client

{OpenLayers.WPSClient} The client that manages this process.

server

{String} Local client identifier for this process’s server.

identifier

{String} Process identifier known to the server.

description

{Object} DescribeProcess response for this process.

localWPS

{String} Service endpoint for locally chained WPS processes.  Default is ‘http://geoserver/wps’.

formats

{Object} OpenLayers.Format instances keyed by mimetype.

chained

{Integer} Number of chained processes for pending execute requests that don’t have a full configuration yet.

executeCallbacks

{Array} Callbacks waiting to be executed until all chained processes are configured;

Constructor

OpenLayers.WPSProcess

Parameters

options{Object} Object whose properties will be set on the instance.

Avaliable options

client{OpenLayers.WPSClient} Mandatory.  Client that manages this process.
server{String} Mandatory.  Local client identifier of this process’s server.
identifier{String} Mandatory.  Process identifier known to the server.

Functions

describe

describe: function(options)

Makes the client issue a DescribeProcess request asynchronously.

Parameters

options{Object} Configuration for the method call

Available options

callback{Function} Callback to execute when the description is available.  Will be called with the parsed description as argument.  Optional.
scope{Object} The scope in which the callback will be executed.  Default is the global object.

configure

configure: function(options)

Configure the process, but do not execute it.  Use this for processes that are chained as input of a different process by means of the output method.

Parameters

options{Object}

Returns

{OpenLayers.WPSProcess} this process.

Available options

inputs{Object} The inputs for the process, keyed by input identifier.  For spatial data inputs, the value of an input is usually an OpenLayers.Geometry, an OpenLayers.Feature.Vector or an array of geometries or features.
callback{Function} Callback to call when the configuration is complete.  Optional.
scope{Object} Optional scope for the callback.

execute

execute: function(options)

Configures and executes the process

Parameters

options{Object}

Available options

inputs{Object} The inputs for the process, keyed by input identifier.  For spatial data inputs, the value of an input is usually an OpenLayers.Geometry, an OpenLayers.Feature.Vector or an array of geometries or features.
output{String} The identifier of the output to request and parse.  Optional.  If not provided, the first output will be requested.
success{Function} Callback to call when the process is complete.  This function is called with an outputs object as argument, which will have a property with the identifier of the requested output (or ‘result’ if output was not configured).  For processes that generate spatial output, the value will be an array of OpenLayers.Feature.Vector instances.
scope{Object} Optional scope for the success callback.

output

output: function(identifier)

Chain an output of a configured process (see configure) as input to another process.

intersect = client.getProcess('opengeo', 'JTS:intersection');
intersect.configure({
    // ...
});
buffer = client.getProcess('opengeo', 'JTS:buffer');
buffer.execute({
    inputs: {
        geom: intersect.output('result'), // <-- here we're chaining
        distance: 1
    },
    // ...
});

Parameters

identifier{String} Identifier of the output that we’re chaining.  If not provided, the first output will be used.

parseDescription

parseDescription: function(description)

Parses the DescribeProcess response

Parameters

description{Object}

setInputData

setInputData: function(input,
data)

Sets the data for a single input

Parameters

input{Object} An entry from the dataInputs array of the process description.
data{Mixed} For spatial data inputs, this is usually an OpenLayers.Geometry, an OpenLayers.Feature.Vector or an array of geometries or features.

setResponseForm

setResponseForm: function(options)

Sets the responseForm property of the execute payload.

Parameters

options{Object} See below.

Available options

outputIndex{Integer} The index of the output to use.  Optional.
supportedFormats{Object} Object with supported mime types as key, and true as value for supported types.  Optional.

getOutputIndex

getOutputIndex: function(outputs,
identifier)

Gets the index of a processOutput by its identifier

Parameters

outputs{Array} The processOutputs array to look at
identifier{String} The identifier of the output

Returns {Integer} The index of the processOutput with the provided identifier in the outputs array.

chainProcess

chainProcess: function(input,
chainLink)

Sets a fully configured chained process as input for this process.

Parameters

input{Object} The dataInput that the chained process provides.
chainLink{OpenLayers.WPSProcess.ChainLink} The process to chain.

toFeatures

toFeatures: function(source)

Converts spatial input into features so it can be processed by OpenLayers.Format instances.

Parameters

source{Mixed} An OpenLayers.Geometry, an OpenLayers.Feature.Vector, or an array of geometries or features

Returns

{Array(OpenLayers.Feature.Vector)}

findMimeType

findMimeType: function(sourceFormats,
targetFormats)

Finds a supported mime type.

Parameters

sourceFormats{Object} An object literal with mime types as key and true as value for supported formats.
targetFormats{Object} Like <sourceFormats>, but optional to check for supported mime types on a different target than this process.  Default is to check against this process’s supported formats.

Returns

{String} A supported mime type.

OpenLayers.WPSProcess.ChainLink

Type for chaining processes.

Summary
Properties
process{OpenLayers.WPSProcess} The process to chain
output{String} The output identifier of the output we are going to use as input for another process.
Constructor
OpenLayers.WPSProcess.ChainLink

Properties

process

{OpenLayers.WPSProcess} The process to chain

output

{String} The output identifier of the output we are going to use as input for another process.

Constructor

OpenLayers.WPSProcess.ChainLink

Parameters

options{Object} Properties to set on the instance.
High level API for interaction with Web Processing Services (WPS).
describe: function(options)
Makes the client issue a DescribeProcess request asynchronously.
configure: function(options)
Configure the process, but do not execute it.
execute: function(options)
Configures and executes the process
output: function(identifier)
Chain an output of a configured process (see configure) as input to another process.
parseDescription: function(description)
Parses the DescribeProcess response
setInputData: function(input,
data)
Sets the data for a single input
setResponseForm: function(options)
Sets the responseForm property of the execute payload.
getOutputIndex: function(outputs,
identifier)
Gets the index of a processOutput by its identifier
chainProcess: function(input,
chainLink)
Sets a fully configured chained process as input for this process.
toFeatures: function(source)
Converts spatial input into features so it can be processed by OpenLayers.Format instances.
Base class for format reading/writing a variety of formats.
findMimeType: function(sourceFormats,
targetFormats)
Finds a supported mime type.
Representation of a WPS process.
A Geometry is a description of a geographic object.
Vector features use the OpenLayers.Geometry classes as geometry description.
Type for chaining processes.
Close