[Geoserver-devel] process name / title clarification

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:Identifiergs:BufferFeatureCollection</ows:Identifier>
ows:TitleBuffers 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:AbstractBuffers 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”>

ows:Identifiergs:BufferFeatureCollection</ows:Identifier>

ows:TitleBuffers 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:AbstractBuffers 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>

ows:Identifierfeature collection</ows:Identifier>

ows:Titlefeature collection</ows:Title>

ows:AbstractFeature collection</ows:Abstract>

text/xml; subtype=wfs-collection/1.0

text/xml; subtype=wfs-collection/1.0

text/xml; subtype=wfs-collection/1.1

application/json

application/wfs-collection-1.0

application/wfs-collection-1.1

application/zip

ows:Identifierwidth of the buffer</ows:Identifier>

ows:Titlewidth of the buffer</ows:Title>

ows:AbstractThe width of the buffer</ows:Abstract>

ows:DataTypexs:double</ows:DataType>

ows:AnyValue/

ows:Identifiername of the layer attribute containing the width of the buffer</ows:Identifier>

ows:Titlename of the layer attribute containing the width of the buffer</ows:Title>

ows:AbstractName of the layer attribute</ows:Abstract>

ows:AnyValue/

ows:Identifierresult</ows:Identifier>

ows:Titleresult</ows:Title>

text/xml; subtype=wfs-collection/1.0

text/xml; subtype=wfs-collection/1.0

text/xml; subtype=wfs-collection/1.1

application/json

application/wfs-collection-1.0

application/wfs-collection-1.1

application/zip

</wps:ProcessDescriptions>

In order to call the above …

wps:DataInputs” +
wps:Input” +
ows:Identifierfeature collection</ows:Identifier>” +
wps:Data” +
wps:ComplexData” +
readFileIntoString(“states-FeatureCollection.xml”) +
“</wps:ComplexData>” +
“</wps:Data>” +
“</wps:Input>” +
wps:Input” +
ows:Identifierwidth of the buffer</ows:Identifier>” +
wps:Data” +
wps:LiteralData10</wps:LiteralData>” +
“</wps:Data>” +
“</wps:Input>” +
wps:Input” +
ows:Identifiername 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

On Fri, Aug 26, 2011 at 7:11 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

Questions:
Q1: If I shorten they "keys" how much client code am I going to break?

What keys?

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?

Nope, it's a bug

- 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)

Can't make any sense of what you wrote here... the parameters name cannot
be used because they don't last at runtime, the class name does.

- the name "name of the layer attribute containing the width of the buffer"
is a very long key

Yeah, these processes are new-is and were not made by me...
Go ahead and shorten the keys, they are indeed too long.
That said, I imagine most people will just call the process using its
java api:

new BufferFeatureCollection().execute(fc, 15, "abc")

Why complicate simple things? :slight_smile:

- 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?

These processes have been contributed by Synergis, not sure
how they used them.
Just quickly looked at them, they seemed to be working, so did the tests
since they were in the build.
I guess you changed something that broke the tests during the move?

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

  • 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)

Can’t make any sense of what you wrote here… the parameters name cannot
be used because they don’t last at runtime, the class name does.

Cool; that explains that then.

  • the name “name of the layer attribute containing the width of the buffer”
    is a very long key

Yeah, these processes are new-is and were not made by me…
Go ahead and shorten the keys, they are indeed too long.
That said, I imagine most people will just call the process using its
java api:

new BufferFeatureCollection().execute(fc, 15, “abc”)

Why complicate simple things? :slight_smile:

Because there is a swing ui to prompt the user for these things; so I expect the maps to run around and actually be used a bit.

  • 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?

These processes have been contributed by Synergis, not sure how they used them.
Just quickly looked at them, they seemed to be working, so did the tests
since they were in the build.

I fixed the tests; and added the min=0 (so that the one value could be null or empty string as per the java code checks.

I guess you changed something that broke the tests during the move?

Not really it was just luck of the draw; I did update all the tests on the geoserver side but got my hudson builds out of order.

Thanks for the feedback;
Jody