This chapter contains a sample how to integrate a configured Geoprocessing tool to your workflow using the WebOffice Script API. The sample data used for this showcase are included in the WebOffice10.9-DVD and may be used as basis for own implementations.
Note: This demo uses techniques that are not part of the WebOffice Script API and are therefore subject to change without notice.
The sample uses a transfer jsp to remodel a Call from WebOffice to a specified call convention of the geoprocessing tool, which is a common workflow. Because the sample uses messages that may be language specific, a language file for the locales de (German) and en (English) is provided. These two files are located in C:\Tomcat\webapps\<WebOffice application>/pub/custom_tools/geoprocessing.
At current state of implementation, WebOffice 10.9 supports geoprocessing with specific limitations. Valid input parameters have to be simple values (string, integer,...). Create a model and share it as a geoprocessing service matching this specification and configure it in WebOffice 10.9.
Note: See the HowTo chapter Prepare a Geoprocessing Service and the chapter Geoprocessing with subsequent topics for details.
Geoprocessing tool in WebOffice author
Now you can use the Geoprocessing tool by opening the tool form and enter all valid parameters. In common workflows this might be inconvenient because you may have to know and type several IDs. Therefore you can use the transfer page to pass field values as parameters of a selection or a search result to be used as input parameters of the geoprocessing tool.
Take the following steps:
- configure a Search Result View including the fields whose values should be passed to the geoprocessing tool
Search result view configuration in WebOffice author including two fields for parameters
- configure an Integration (Call FROM WebOffice). The base URL is consisting of the URL to the transfer page, the tool ID of the GP Task and optionally parameter(s) that are not part of any field values
Integration (Call FROM WebOffice) configuration
- find out the correct geoprocessing tool ID by opening the WebOffice 10.9 project configuration in an UTF-8-able XML editor. Search for TOOL_GEOPROCESSING and copy the id_tool_base. If you have configured more than one geoprocessing tool, be sure to copy the ID of the correct GP tool.
Geoprocessing tool in project configuration (XML editor)
- the optional static parameter has to be named exactly like the referenced input parameter of the geoprocessing task.
- configure 1 to n additional keys to be passed as parameters. The names of the HTTP parameters have to match the referenced input parameters of the geoprocessing task.
As visible in the figure above the configuration of your base URL may look like this:
pub/custom_tools/geoprocessing/gpsample.jsp?toolid=GP_1400&Profile_Type=0
and consists out of the parts described below
Transfer page (?connector) Geoprocessing Task Identifier (&connector) Static Input Parameter
Using the gpsample.jsp the workflow of your GP analysis might look like this:
Make a selection and start the geoprocessing tool using the specified hyperlink icon.
Start GP tool from selection
The GP tool dialog will open, the parameters from the base URL and the specified keys will be used.
GP tool executes and uses the passed parameters
The result is added to the map as a fully integrated layer.
Result of the GP analysis
Comments
0 comments
Please sign in to leave a comment.