Hello everybody,
I want to use a custom input-type in a wps, so that the client can send a
request like this:
...
<wps:Data>
<wps:ComplexData>
<customFormatPPIO>
<feature_id>12345</feature_id>
<feature_name>house</feature_name>
</customFormatPPIO>
</wps:ComplexData>
</wps:Data>
...
I declared in the org.geoserver.wps.ppio package a class customFormatPPIO
with the members feature_id and feature_name.
public class customFormatPPIO extends ComplexPPIO
{
private String id;
private String name;
public customFormatPPIO() {
...
}
public void encode(...){...}
public Object decode(...){...}
Also, I registered the class in the ProcessParameterIO:
defauls.add(new customFormatPPIO(...));
I thought, that a incoming request is routed to the decode-function in the
customFormatPPIO.class, however, there is a exception in
AnnotationDriverProcessFactory.class;
org.geotools.process.ProcessException: Could not convert {id=12345,
name=house} to target type org.geoserver.wps.ppio.customFormatPPIO
at
org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.buildProcessArguments(AnnotationDrivenProcessFactory.java:627)
at
org.geotools.process.factory.AnnotationDrivenProcessFactory$InvokeMethodProcess.execute(AnnotationDrivenProcessFactory.java:501)
Any idea, what to do or how to implement custom input types in a wps?
Thanks
Max Meier
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Custom-Inputtype-for-WPS-tp5050404.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
On Tue, Apr 30, 2013 at 12:36 PM, vermesser123 <maxmeier35@anonymised.com> wrote:
Hello everybody,
I want to use a custom input-type in a wps, so that the client can send a
request like this:
...
<wps:Data>
<wps:ComplexData>
<customFormatPPIO>
<feature_id>12345</feature_id>
<feature_name>house</feature_name>
</customFormatPPIO>
</wps:ComplexData>
</wps:Data>
Uh, to add the XML inline like this one would need a "parser
delegate", since the
XML parsing of the WPS request would also have to parse that customFormatPPIO
element and its children.
PPIO are called only for stuff that the main XML parser cannot
handle... try embedding
the customFormattPPIO part in a CDATA section, so that the main XML parser
ignores it and delivers it as-is to the PPIOs
I have a question for Justin here, that wrote the XML parsers...
wondering, if we don't
have a parser delegate for a certain element, would it make sense to
just take everything
in it and turn it into a DOM, or some other structure that preserves
the XML as is,
so that we can later give it as an input to a PPIO?
Cheers
Andrea
--
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
On Wed, May 1, 2013 at 3:07 AM, Andrea Aime <andrea.aime@anonymised.com>wrote:
On Tue, Apr 30, 2013 at 12:36 PM, vermesser123 <maxmeier35@anonymised.com>
wrote:
> Hello everybody,
>
> I want to use a custom input-type in a wps, so that the client can send a
> request like this:
>
> ...
> <wps:Data>
> <wps:ComplexData>
> <customFormatPPIO>
> <feature_id>12345</feature_id>
> <feature_name>house</feature_name>
> </customFormatPPIO>
> </wps:ComplexData>
> </wps:Data>
Uh, to add the XML inline like this one would need a "parser
delegate", since the
XML parsing of the WPS request would also have to parse that
customFormatPPIO
element and its children.
PPIO are called only for stuff that the main XML parser cannot
handle... try embedding
the customFormattPPIO part in a CDATA section, so that the main XML parser
ignores it and delivers it as-is to the PPIOs
I have a question for Justin here, that wrote the XML parsers...
wondering, if we don't
have a parser delegate for a certain element, would it make sense to
just take everything
in it and turn it into a DOM, or some other structure that preserves
the XML as is,
so that we can later give it as an input to a PPIO?
Yeah, I think it makes sense. As i understand it now what will happen is it
will fall back on default behaviour and return a map of maps representing
the tree. If we want to return the dom a relatively easy way would be a
fallback parser delegate that converts all the sax events to a dom. I
believe there are some utility classes in the jdk that will do this.
Cheers
Andrea
--
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
On Wed, May 1, 2013 at 4:30 PM, Justin Deoliveira <jdeolive@anonymised.com>wrote:
I have a question for Justin here, that wrote the XML parsers...
wondering, if we don't
have a parser delegate for a certain element, would it make sense to
just take everything
in it and turn it into a DOM, or some other structure that preserves
the XML as is,
so that we can later give it as an input to a PPIO?
Yeah, I think it makes sense. As i understand it now what will happen is
it will fall back on default behaviour and return a map of maps
representing the tree. If we want to return the dom a relatively easy way
would be a fallback parser delegate that converts all the sax events to a
dom. I believe there are some utility classes in the jdk that will do this.
As far as I understand ParserDelegate is allowed to check whether it can
handle a certain element, or not, which would allow for a wildcard one.
However, we'd have to make sure it's executed last, otherwise it
might inadvertently catch stuff that other parsers can handle.
So... priority mechanism? Explicit setter for a fallback parser?
Cheers
Andrea
--
GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------