diff --git a/deegree-services/deegree-webservices-handbook/src/main/asciidoc/processproviders.adoc b/deegree-services/deegree-webservices-handbook/src/main/asciidoc/processproviders.adoc index 96a8cb6d57..36218a78c4 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/asciidoc/processproviders.adoc +++ b/deegree-services/deegree-webservices-handbook/src/main/asciidoc/processproviders.adoc @@ -55,7 +55,35 @@ required: *Java process provider: Minimal example (Java code)* -java/java_processprovider_minimal.java +[source,java] +---- +import org.deegree.services.wps.Processlet; +import org.deegree.services.wps.ProcessletException; +import org.deegree.services.wps.ProcessletExecutionInfo; +import org.deegree.services.wps.ProcessletInputs; +import org.deegree.services.wps.ProcessletOutputs; +import org.deegree.services.wps.output.LiteralOutput; + +public class Processlet42 implements Processlet { + + @Override + public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) + throws ProcessletException { + LiteralOutput output = (LiteralOutput) out.getParameter( "Answer" ); + output.setValue( "42" ); + } + + @Override + public void init() { + // nothing to initialize + } + + @Override + public void destroy() { + // nothing to destroy + } +} +---- ==== More complex configuration example @@ -82,7 +110,33 @@ required: *Java process provider: Minimal example (Java code)* -java/java_processprovider_complex.java +[source,java] +---- +import org.deegree.services.wps.Processlet; +import org.deegree.services.wps.ProcessletException; +import org.deegree.services.wps.ProcessletExecutionInfo; +import org.deegree.services.wps.ProcessletInputs; +import org.deegree.services.wps.ProcessletOutputs; +import org.deegree.services.wps.input.LiteralInput; +import org.deegree.services.wps.output.LiteralOutput; + +public class AdditionProcesslet implements Processlet { + + public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) + throws ProcessletException { + int summandA = Integer.parseInt( ( (LiteralInput) in.getParameter( "SummandA" ) ).getValue() ); + int summandB = Integer.parseInt( ( (LiteralInput) in.getParameter( "SummandB" ) ).getValue() ); + int sum = summandA + summandB; + + LiteralOutput output = (LiteralOutput) out.getParameter( "Sum" ); + output.setValue( "" + sum ); + } + + public void destroy() {} + + public void init() {} +} +---- ==== Configuration options @@ -170,7 +224,53 @@ The interface looks like this: *Java process provider: Processlet interface* -java/Processlet.java +[source,java] +---- +package org.deegree.services.wps; + +public interface Processlet { + + /** + * Called by the {@link ProcessManager} to perform an execution of this {@link Processlet}. + *
+ * The typical workflow is: + *
in
parameterout
parameternull
+ * @param out
+ * used to store the process outputs, never null
+ * @param info
+ * can be used to provide execution information, i.e. percentage completed and start/success messages
+ * that it wants to make known to clients, never null
+ * @throws ProcessletException
+ * may be thrown by the processlet to indicate a processing exception
+ */
+ public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info )
+ throws ProcessletException;
+
+ /**
+ * Called by the {@link ProcessManager} to indicate to a {@link Processlet} that it is being placed into service.
+ */
+ public void init();
+
+ /**
+ * Called by the {@link ProcessManager} to indicate to a {@link Processlet} that it is being taken out of service.
+ * + * This method gives the {@link Processlet} an opportunity to clean up any resources that are being held (for + * example, memory, file handles, threads) and make sure that any persistent state is synchronized with the + * {@link Processlet}'s current state in memory. + *
+ */ + public void destroy(); +} +---- As you can see, the interface defines three methods: diff --git a/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc b/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc index bf7d8fa3b1..457e85055c 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc +++ b/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc @@ -1342,7 +1342,48 @@ xml/wms_getmap_xml_request_body.xml The GetFeatureInfo XML request body has to be compliant to following schema: -xsd/GFI.xsd +[source,xml] +---- + +- * The typical workflow is: - *
in
parameterout
parameternull
- * @param out
- * used to store the process outputs, never null
- * @param info
- * can be used to provide execution information, i.e. percentage completed and start/success messages
- * that it wants to make known to clients, never null
- * @throws ProcessletException
- * may be thrown by the processlet to indicate a processing exception
- */
- public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info )
- throws ProcessletException;
-
- /**
- * Called by the {@link ProcessManager} to indicate to a {@link Processlet} that it is being placed into service.
- */
- public void init();
-
- /**
- * Called by the {@link ProcessManager} to indicate to a {@link Processlet} that it is being taken out of service.
- * - * This method gives the {@link Processlet} an opportunity to clean up any resources that are being held (for - * example, memory, file handles, threads) and make sure that any persistent state is synchronized with the - * {@link Processlet}'s current state in memory. - *
- */ - public void destroy(); -} - diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_complex.java b/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_complex.java deleted file mode 100644 index c1df00fc01..0000000000 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_complex.java +++ /dev/null @@ -1,25 +0,0 @@ -import org.deegree.services.wps.Processlet; -import org.deegree.services.wps.ProcessletException; -import org.deegree.services.wps.ProcessletExecutionInfo; -import org.deegree.services.wps.ProcessletInputs; -import org.deegree.services.wps.ProcessletOutputs; -import org.deegree.services.wps.input.LiteralInput; -import org.deegree.services.wps.output.LiteralOutput; - -public class AdditionProcesslet implements Processlet { - - public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) - throws ProcessletException { - int summandA = Integer.parseInt( ( (LiteralInput) in.getParameter( "SummandA" ) ).getValue() ); - int summandB = Integer.parseInt( ( (LiteralInput) in.getParameter( "SummandB" ) ).getValue() ); - int sum = summandA + summandB; - - LiteralOutput output = (LiteralOutput) out.getParameter( "Sum" ); - output.setValue( "" + sum ); - } - - public void destroy() {} - - public void init() {} -} - diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_minimal.java b/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_minimal.java deleted file mode 100644 index 1ec82b0817..0000000000 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/java/java_processprovider_minimal.java +++ /dev/null @@ -1,27 +0,0 @@ -import org.deegree.services.wps.Processlet; -import org.deegree.services.wps.ProcessletException; -import org.deegree.services.wps.ProcessletExecutionInfo; -import org.deegree.services.wps.ProcessletInputs; -import org.deegree.services.wps.ProcessletOutputs; -import org.deegree.services.wps.output.LiteralOutput; - -public class Processlet42 implements Processlet { - - @Override - public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) - throws ProcessletException { - LiteralOutput output = (LiteralOutput) out.getParameter( "Answer" ); - output.setValue( "42" ); - } - - @Override - public void init() { - // nothing to initialize - } - - @Override - public void destroy() { - // nothing to destroy - } -} - diff --git a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xsd/GFI.xsd b/deegree-services/deegree-webservices-handbook/src/main/sphinx/xsd/GFI.xsd deleted file mode 100644 index 0e4ad0b099..0000000000 --- a/deegree-services/deegree-webservices-handbook/src/main/sphinx/xsd/GFI.xsd +++ /dev/null @@ -1,39 +0,0 @@ - -