On Tue, Jul 5, 2011 at 9:40 AM, Javier Maestu <[email protected]>wrote:

> Hi all,
>
>
>
> I was reading the GeoServer documentation, beacause I’m interested in
> create a specific JSON/XML output format for WFS services.
>
> GeoServer has their own outputformats but it seems that is possible to
> create your own templates.
>
>
>
> In this section, it describes the mechanism an how to create a template:
>
> http://docs.geoserver.org/stable/en/user/tutorials/freemarker.html
>
>
>
> Before to start to follow this way, I appreciate if somebody share their
> experience using this extension.
>
>
>
> So, my question is using freemarker, you can create your own outputformat
> for a GetFeature request (WFS)?
>
> If not, you know another solution?
>

Hi Javier,
adding a output format is possible, the code is pluggable, but none of the
WFS output formats use
the freemarker templates, they are mostly used to drive details in some of
the WMS responses instead.

What you could do is to write a new subclass of WFSGetFeatureOutputFormat
(the CSVOutputFormat is
simple enough to use as an example) and register it in the Spring context,
pack the result up in a
jar and drop it in GeoServer WEB-INF/lib.
See the following:
http://svn.codehaus.org/geoserver/trunk/src/wfs/src/main/java/org/geoserver/wfs/response/CSVOutputFormat.java
http://svn.codehaus.org/geoserver/trunk/src/wfs/src/main/java/applicationContext.xml

It would also be possible to make a freemaker based output format that
allows the administrator to configure the mime type
and the template to be used. To do that you might be interested in this
class too:
http://svn.codehaus.org/geoserver/trunk/src/wms/src/main/java/org/geoserver/wms/featureinfo/FeatureTemplate.java

In acse the above sounds too hard you also have the option to have someone
develop it for you:
http://geoserver.org/display/GEOS/Commercial+Support

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

-------------------------------------------------------
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to