Questions:
Q1: If I shorten they "keys" how much client code am I going to break?
Q2: Can I make the annotations consistent for @DescribeProcess @DescribeParam
@DescribeResult ?
I would like to go for:
- name (optional) name for the provided input, result or process if provided.
If not provided the name is taken from the java definition
- title - the display name or title used (optional) defaults to the "name"
- description - description used in the capabilities or describe process
Issues:
- @DescribeProcess title is not used; is this on purpose?
- The @DescribeProcess and @DescribeParameter are inconsistent in hiding java
details or advertising them (where the java class name was used; in this case
the attribute name is not used)
- the name "name of the layer attribute containing the width of the buffer" is
a very long key
- the "name of the layer attribute containing the width of the buffer" cannot
actually be used; it always fails with the indication that it *must* have a
value as minOccurs != 0; setting it to an empty string does not work
In short I am not finding "gs:BufferFeatureCollection" to be a good replacement
for the "gt:BufferedFeatureCollection" I just deleted. I have been trying to
update the geoserver tests one at a time; and given the issue with "name of the
layer attribute containing the width of the buffer" I am not super confident
that those code here has been used in the wild?
Update: changing the multiplicity of "name of the layer attribute containing
the width of the buffer" in min = 0 allows tests to pass in GeoServer:
@DescribeParameter(name = "name of the layer attribute containing the width of
the buffer", description = "Name of the layer attribute",min=0) String
attribute) {
Background Examples For Discussion
--------------------------------------------------------
@DescribeProcess(title = "buffer", description = "Buffers each feature in a
collection by a fixed amount or by a value coming from a feature attribute.
Works in pure cartesian mode.")
public class BufferFeatureCollection implements GSProcess {
public SimpleFeatureCollection execute(
@DescribeParameter(name = "feature collection", description = "Feature
collection") SimpleFeatureCollection features,
@DescribeParameter(name = "width of the buffer", description = "The width of
the buffer") Double distance,
@DescribeParameter(name = "name of the layer attribute containing the width of
the buffer", description = "Name of the layer attribute") String attribute) {
Resulting in:
<wps:Process wps:processVersion="1.0.0">
<ows:Identifier>gs:BufferFeatureCollection</ows:Identifier>
<ows:Title>Buffers each feature in a collection by a fixed amount or by a value
coming from a feature attribute. Works in pure cartesian mode.</ows:Title>
<ows:Abstract>Buffers each feature in a collection by a fixed amount or by a
value coming from a feature attribute. Works in pure cartesian
mode.</ows:Abstract>
</wps:Process>
And:
<?xml version="1.0" encoding="UTF-8"?>
<wps:ProcessDescriptions xmlns:wps="http://www.opengis.net/wps/1.0.0"
xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="WPS"
version="1.0.0" xml:lang="en"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
<ProcessDescription statusSupported="false" storeSupported="false"
wps:processVersion="1.0.0">
<ows:Identifier>gs:BufferFeatureCollection</ows:Identifier>
<ows:Title>Buffers each feature in a collection by a fixed amount or by a value
coming from a feature attribute. Works in pure cartesian mode.</ows:Title>
<ows:Abstract>Buffers each feature in a collection by a fixed amount or by a
value coming from a feature attribute. Works in pure cartesian
mode.</ows:Abstract>
<DataInputs>
<Input maxOccurs="1" minOccurs="1">
<ows:Identifier>feature collection</ows:Identifier>
<ows:Title>feature collection</ows:Title>
<ows:Abstract>Feature collection</ows:Abstract>
<ComplexData>
<Default>
<Format>
<MimeType>text/xml; subtype=wfs-collection/1.0</MimeType>
</Format>
</Default>
<Supported>
<Format>
<MimeType>text/xml; subtype=wfs-collection/1.0</MimeType>
</Format>
<Format>
<MimeType>text/xml; subtype=wfs-collection/1.1</MimeType>
</Format>
<Format>
<MimeType>application/json</MimeType>
</Format>
<Format>
<MimeType>application/wfs-collection-1.0</MimeType>
</Format>
<Format>
<MimeType>application/wfs-collection-1.1</MimeType>
</Format>
<Format>
<MimeType>application/zip</MimeType>
</Format>
</Supported>
</ComplexData>
</Input>
<Input maxOccurs="1" minOccurs="1">
<ows:Identifier>width of the buffer</ows:Identifier>
<ows:Title>width of the buffer</ows:Title>
<ows:Abstract>The width of the buffer</ows:Abstract>
<LiteralData>
<ows:DataType>xs:double</ows:DataType>
<ows:AnyValue/>
</LiteralData>
</Input>
<Input maxOccurs="1" minOccurs="0">
<ows:Identifier>name of the layer attribute containing the width of the
buffer</ows:Identifier>
<ows:Title>name of the layer attribute containing the width of the
buffer</ows:Title>
<ows:Abstract>Name of the layer attribute</ows:Abstract>
<LiteralData>
<ows:AnyValue/>
</LiteralData>
</Input>
</DataInputs>
<ProcessOutputs>
<Output>
<ows:Identifier>result</ows:Identifier>
<ows:Title>result</ows:Title>
<ComplexOutput>
<Default>
<Format>
<MimeType>text/xml; subtype=wfs-collection/1.0</MimeType>
</Format>
</Default>
<Supported>
<Format>
<MimeType>text/xml; subtype=wfs-collection/1.0</MimeType>
</Format>
<Format>
<MimeType>text/xml; subtype=wfs-collection/1.1</MimeType>
</Format>
<Format>
<MimeType>application/json</MimeType>
</Format>
<Format>
<MimeType>application/wfs-collection-1.0</MimeType>
</Format>
<Format>
<MimeType>application/wfs-collection-1.1</MimeType>
</Format>
<Format>
<MimeType>application/zip</MimeType>
</Format>
</Supported>
</ComplexOutput>
</Output>
</ProcessOutputs>
</ProcessDescription>
</wps:ProcessDescriptions>
In order to call the above ....
"<wps:DataInputs>" +
"<wps:Input>" +
"<ows:Identifier>feature collection</ows:Identifier>" +
"<wps:Data>" +
"<wps:ComplexData>" +
readFileIntoString("states-FeatureCollection.xml") +
"</wps:ComplexData>" +
"</wps:Data>" +
"</wps:Input>" +
"<wps:Input>" +
"<ows:Identifier>width of the buffer</ows:Identifier>" +
"<wps:Data>" +
"<wps:LiteralData>10</wps:LiteralData>" +
"</wps:Data>" +
"</wps:Input>" +
"<wps:Input>" +
"<ows:Identifier>name of the layer attribute containing the width of the
buffer</ows:Identifier>" +
"<wps:Data>" +
"<wps:LiteralData></wps:LiteralData>" +
"</wps:Data>" +
"</wps:Input>" +
"</wps:DataInputs>"
--
Jody Garnett
On Saturday, 27 August 2011 at 1:40 AM, Jody Garnett wrote:
> Process clarification question
>
> For the following with have a java bean defined; with an annotation to fill
> in the missing information:
>
> DescribeProcess(title = "rectangularClip", description = "Clips the features
> to the specified geometry")
> public class ClipProcess implements GSProcess {
> ....
> }
>
> I ran into a bad assumption when writing a test case ...
>
> To find the above process:
>
> - new NameImpl("gs","ClipProcess") works
> - new NameImpl("gs","rectangularClip") does not work
>
> Does the WPS spec have the concept of a display name? I would of expected
> that "rectangularClip" is used rather than the java bean name; if only so we
> can follow normal java naming conventions for our java beans without watching
> things get out of hand.
>
> --
> Jody Garnett
>
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel