[Geoserver-devel] Slight API change required in WFSGetFeatureOutputFormat to handle OGR and XSLT output formats

Hi,
I am looking into a NullPointerException happening when the OGR2OGR output
format does not find OGR on the disk, or is provided an emtpy configuration,
and believe I’ve found an API change that is required to make OGR2OGR
and XSLT output formats play well with WFS 1.0

WFSGetFeatureOutputFormat has a getCapabilitiesElementName which should
return a name for the output format that can be used as an element in the WFS
1.0 capabilities, e.g.:

Now, both OGR and XSLT output formats present a problem: they don’t do
a single format, they are output format generators and each can generate
multiple formats.
Thus, a List getCapabiltiiesElementNames() is required instead.

My plan is to add that method, and have it delegate to getCapabilitiesElementName()
by default, so that most formats do not need to be touched, whilst the output format
generator ones will override it and provide a full list of values.

This will also have the effect of avoiding the NPE in case the list of output formats is
empty.

The change is really a small thing, but wanted to discuss it as I’d need to fix this bug
on the stable series and 2.1.x as well.

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.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


Sounds good to me. +1

···

On Thu, Jan 10, 2013 at 2:30 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Hi,
I am looking into a NullPointerException happening when the OGR2OGR output
format does not find OGR on the disk, or is provided an emtpy configuration,
and believe I’ve found an API change that is required to make OGR2OGR
and XSLT output formats play well with WFS 1.0

WFSGetFeatureOutputFormat has a getCapabilitiesElementName which should
return a name for the output format that can be used as an element in the WFS
1.0 capabilities, e.g.:

Now, both OGR and XSLT output formats present a problem: they don’t do
a single format, they are output format generators and each can generate
multiple formats.
Thus, a List getCapabiltiiesElementNames() is required instead.

My plan is to add that method, and have it delegate to getCapabilitiesElementName()
by default, so that most formats do not need to be touched, whilst the output format
generator ones will override it and provide a full list of values.

This will also have the effect of avoiding the NPE in case the list of output formats is
empty.

The change is really a small thing, but wanted to discuss it as I’d need to fix this bug
on the stable series and 2.1.x as well.

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.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



Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only – learn more at:
http://p.sf.net/sfu/learnmore_122712


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.