52n WPS OpenLayers Client TutorialRequirements:   • Java SDK   • Apache Tomcat (5.5.28 tested)   • Apache Maven          o...
2. Deploy the Proxy HostAdd the "wps_proxy.war" to your [TOMACAT_HOME]/webapps folder. This is the location where theWpsCl...
4. Test the clientStart your tomcat. Open your browser and call the client. If the tomcat runs under "localhost:8080" andy...
Known Issues:   •   Access to restricted URI denied code: 1012            o Most likely the proxy settings are incorrect. ...
Upcoming SlideShare
Loading in...5
×

Wps ol client_tutorial-1

730

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
730
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Wps ol client_tutorial-1

  1. 1. 52n WPS OpenLayers Client TutorialRequirements: • Java SDK • Apache Tomcat (5.5.28 tested) • Apache Maven o Important: The current maven version 2.2.1 will not work with the POM.xml. Instead you have to use the maven 2.0.11 version. • Firebug Plugin for Firefox (optional but recommended)1. Checkout the SVN client and proxy repositorySVN Client Repository location:https://svn.52north.org/svn/projects/geoprocessing/WPS OpenLayers/trunk/WPS OpenLayersSVN Proxy Repository location:https://svn.52north.org/svn/projects/geoprocessing/WPS OpenLayers proxy/trunk/WPS OpenLayersproxy
  2. 2. 2. Deploy the Proxy HostAdd the "wps_proxy.war" to your [TOMACAT_HOME]/webapps folder. This is the location where theWpsClient.html expects the proxy host to be, when the application starts. The proxy is needed,when a remote server, like a Web Feature Service, is requested.Edit the proxy properties (if required)If nessesary, change the list of allowed host addresses and ports. This can be done by editing theproxy.properties, which is part of the wps_proxy.war. The path is wps_proxy.war/WEB-INF/classes/fi/fgi/wps/proxy.The default ports include 80,8080 and 9090, as well as "localhost" and some more. In case you changedsomewhat, you must restart your tomcat.3. Deploy the wps OL clientExecute the „mvn compile“ command in the root of the client repository. Als result you got a newfolder named „OL“ in this directory. If you work with eclipse you have to refresh the project to see thechange.Now copy the OL folder from the client repository into the [TOMCAT_HOME]/webapps folder.Check/Set the initial Web Processing ServicesThe initial service list can be found in the wps-ol-client.js located in the OL/lib folder. As you can seein the picture below, the standard "http:localhost:8080/wps/WebProcessingService" adress is alreadyregistered. The other services are disabled but remain in the list, just to make clear that its an array.Edit the proxy host (if required)As already mentioned, the proxy host is declared in the Javascript code of the WpsClient.html.For changing the default settings, open the WpsClient.html in the OL folder and search theProxyHost variable inside the init() method.Edit the WFS used in the client (if required)By default, the client should request the giv-wps geoserver WFS. Edit the WpsClient.html to adressother services and layers. Visit geoserver.org to lern how to set up your own local WFS. Read the„Namespace issue“ at the end of this tutorial if you encounter process failures.
  3. 3. 4. Test the clientStart your tomcat. Open your browser and call the client. If the tomcat runs under "localhost:8080" andyou followed the instructions carefully, the client location is "localhost:8080/OL/WpsClient.html".Open the WPS controls with the "WPS" button on the left side. Now select a process in the "Processes"select box, set the input parameters in the generated HTML input elements and press the "Execute"button below.As known from OpenLayers, the layer switcher is on the right side. It will include the process outputlayers which have ComplexData as result.A literal data result will be displayed in a centered message box.5. Client developmentThe wps-ol-client.js file contains the WPS client. This file is merged out of the class structure byexecuting the "mvn compile" command in the WPS client root, which contains the POM.xml. You canwork with the merged file, or perhaps for a better understanding, keep on developing the client in"class-structure".Go to the repository root and change directory to "src/main/javascript" to find the class-structure ofthe client (single Javascript files representing each «class»).After finishing your work, open the command line and run the "mvn compile" as mentioned before.This will update the OL folder, so youll find your client changes merged into the wps-ol-client.js.Overwride the copy in the tomcat and youre done.By activating the compressor in the POM.xml, you can speed up your client a little bit. The compressedversion is free of comments and spaces.
  4. 4. Known Issues: • Access to restricted URI denied code: 1012 o Most likely the proxy settings are incorrect. Check if the adressed server are listed in the proxy.properties file, inside the wps_proxy.war. • The namespace issue: The WPS cannot handle different process inputs with the same namespace. Using the Geoserver WFS can lead to this problem, because the stores contain more than one layer and each store can only be accociated with one workspace. For example topp:tasmania_roads and topp:tasmania_state_boundaries layer can cause exceptions, when they are used one after the other. The solution is to seperate this layers in single stores an give them individual workspaces in the geoserver.

×