This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from nuest/dev
Dev update for release
- Loading branch information
Showing
13 changed files
with
477 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,49 @@ | ||
# wps-js | ||
|
||
Standalone JavaScript WPS client. | ||
Standalone Javascript OGC Web Processing Service (WPS) client with the following functions: | ||
|
||
* Generation of an HTML form based on WPS process descriptions | ||
* Encoding and parsing of WPS requests (GetCapabilities, DescribeProcess, Execute) | ||
|
||
## Installation | ||
|
||
wps-js is a plain Javascipt client and all required libraries are shipped with the code. To try out examples follow these steps: | ||
|
||
* Start a proxy server so that it serves requests preprended with ``/wps_proxy/wps_proxy?url=`` | ||
* Check out the code: ``git clone https://github.com/52North/wps-js.git`` | ||
* Change to the directory and build the application with Maven: ``cd wps-js``, then ``mvn clean install`` | ||
* Open the file ``../target/wps-js-<version>/index.html`` in a browser to try out the client | ||
* Use the file ``../target/wps-js-<versionjs/wps-js/wps-js.<version>(.min).js`` in your own application. | ||
|
||
## Configuration | ||
|
||
Configuration of the proxy URL: | ||
|
||
``` | ||
$(document).ready(function() { | ||
$.wpsSetup({ | ||
proxy : { | ||
url : "/wps_proxy/wps_proxy?url=", | ||
type : "parameter" | ||
} | ||
}); | ||
}); | ||
``` | ||
|
||
You can also use a template file to pre-configure the contents of the form that is generated - see example ``src/main/webapp/demo/geca-intercomparison/client.html``. | ||
|
||
## Documentation | ||
|
||
Project and user documentation can be found in the 52°North wiki: https://wiki.52north.org/bin/view/Geoprocessing/Wps-js | ||
|
||
## Development | ||
|
||
wps-js uses Maven for the build process, which means that the source code is split up across many files in the folder ``src/main/webapp/js/wps-js``. Within this directory, a **Javscript class hierarchy** for reqeusts and responses is implemented in the directories ``request`` and ``response`` respectively. | ||
|
||
### Tomcat configuration | ||
|
||
A simple configuration of a Tomcat servlet container to develop wps-js is to point the context of the webapp to the Maven target directory. | ||
#### Catalina context | ||
A simple configuration of a Tomcat servlet container to develop wps-js is to point the context of the webapp to the Maven target directory. Put the following lines into a file ``<Tomcat dir>\conf\Catalina\localhost\wps-js.xml`` and restart the servlet container: | ||
|
||
``` | ||
<Context | ||
|
@@ -20,9 +53,13 @@ A simple configuration of a Tomcat servlet container to develop wps-js is to poi | |
|
||
You can then update the deployed copy by running ``mvn package -DskiptTests=true``. | ||
|
||
#### Eclipse WTP | ||
|
||
Alternatively configuration with the web tools plug-in in Eclipse: Open your server configuration, then the tab "Modules" and add the path ``<your path>/wps-js/target/wps-js-1.0.0-SNAPSHOT`` as the document base and any path, for example ``/wps-js``. | ||
|
||
### Proxy | ||
|
||
wps-js needs a proxy server to connect to WPS server instances. A simple one is jproxy, see https://github.com/matthesrieke/jprox. wps-js will by default look for a proxy at ``/wps_proxy/wps_proxy?``. | ||
wps-js needs a proxy server to connect to WPS server instances. A simple one is jproxy, see https://github.com/matthesrieke/jprox. wps-js will by default look for a proxy at ``/wps_proxy/wps_proxy?url=``. | ||
|
||
#### jprox configuration | ||
|
||
|
@@ -39,6 +76,8 @@ Make sure you use the following parameters in jprox's ``web.xml`` and deploy it | |
[...] | ||
``` | ||
|
||
Alternatively, you can also import jproxy as a project in Eclipse and configure it as a web module for your testing server in the WTP plug-in using the path ``/wps_proxy``. | ||
|
||
## License | ||
|
||
wps-js is published under Apache Software License, Version 2.0 | ||
|
@@ -48,3 +87,10 @@ The used libraries are: | |
* jQuery - MIT License (https://jquery.org/license/) | ||
* OpenLayers - 2-clause BSD License (http://openlayers.org/) | ||
* js-test-driver - Apache License 2.0 (http://code.google.com/p/js-test-driver/) | ||
|
||
## Contact / Support | ||
To get help in running wps-js, please use the Geoprocessing community mailing list and forum: http://geoprocessing.forum.52north.org/ | ||
|
||
Please leave an issue on GitHub if you have any bug reports or feature requests: https://github.com/52North/sos-js/issues | ||
|
||
Contact: Matthes Rieke ([email protected]), Daniel Nüst ([email protected]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<script src="js/jquery/jquery.1.8.3.min.js"></script> | ||
<script src="js/jquery/jquery-ui.1.8.3.min.js"></script> | ||
<script src="js/openlayers/OpenLayers-closure.js"></script> | ||
<script src="js/wps-js/wps-js.${project.version}.js"></script> | ||
<link type="text/css" rel="stylesheet" href="css/wps-js.css"> | ||
<title>wps-js example</title> | ||
<link rel="shortcut icon" href="favicon.ico" /> | ||
</head> | ||
<body> | ||
<div id="wrapper"> | ||
<div> | ||
<h1>wps-js example</h1> | ||
<p>wps-js is an <a href="https://github.com/52North/wps-js/" title="wps-js on GitHub">open source client library</a> for connecting Javascript client to <a href="http://www.opengeospatial.org/standards/wps" title="WPS @ Open Geospatial Consortium">OGC Web Processing</a> services. This page demonstrates how you can use it. More documentation is available in the <a href="https://wiki.52north.org/bin/view/Geoprocessing/Wps-js" title="wps-js wiki page">52°North Wiki</a> and on <a href="https://github.com/52North/wps-js/blob/master/README.md" title="wps-js readme">GitHub</a>.</p> | ||
</div> | ||
<hl> | ||
<div> | ||
<select id="wps"> | ||
<option>Select a WPS</option> | ||
<option>http://geoviqua.stcorp.nl/wps</option> | ||
<option>http://geoprocessing.demo.52north.org:8080/wps/WebProcessingService</option> | ||
<option>http://localhost:8080/wps/WebProcessingService</option> | ||
<!-- pyWPS: --> | ||
<option>http://openwps.statkart.no/skwms1/wps.elevation</option> | ||
</select> | ||
</div> | ||
<div> | ||
<h3> | ||
Capabilities <a href="#" id="wpscaller">Show Capabilities</a> | ||
</h3> | ||
<div class="wps-container"> | ||
<div id="capabilitiesByClick"></div> | ||
</div> | ||
</div> | ||
<div> | ||
<h3>Execute Process</h3> | ||
<div class="wps-container"> | ||
<select id="processes"><option>Select a process</option></select> | ||
<span id="processDescriptionLink"></span> | ||
<div class="wps-execute-container" id="wps-execute-container"></div> | ||
</div> | ||
<p></p> | ||
<div class="wps-container"> | ||
<div id="executeProcess"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<script type="text/javascript"> | ||
var capabilities, // the capabilities, read by Format.WPSCapabilities::read | ||
process; // the process description from Format.WPSDescribeProcess::read | ||
|
||
$('#wpscaller').click(function() { | ||
var sel = document.getElementById("wps"); | ||
|
||
$('#capabilitiesByClick').wpsCall({ | ||
url : sel.options[sel.selectedIndex].text, | ||
requestType : GET_CAPABILITIES_TYPE | ||
}); | ||
}); | ||
$(document).ready(function() { | ||
$.wpsSetup({ | ||
proxy : { | ||
url : "/wps_proxy/wps_proxy?url=", | ||
type : "parameter" | ||
} | ||
}); | ||
}); | ||
|
||
// add behavior to html elements | ||
document.getElementById("processes").onchange = function() { | ||
var sel = document.getElementById("processes"); | ||
|
||
describeProcess(sel.options[sel.selectedIndex].text); | ||
}; | ||
document.getElementById("wps").onchange = function() { | ||
var sel = document.getElementById("wps"); | ||
|
||
getCapabilities(sel.options[sel.selectedIndex].text); | ||
}; | ||
|
||
</script> | ||
|
||
<div> | ||
<p class="infotext">${project.build.finalName} #${build-commit-abbrev} as of ${build-tstamp}, build at ${buildTimestamp}</p> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.