Thanks Justin. Its very helpful. I will let you know how I get on. A
quick question and probably a stupid one..but where do I place the
schema (.xsd) file for CSML in the project path? Can geoserver handle
imported schemas within the main schema file?
Cheers
Arif
-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: 11 January 2008 18:49
To: Shaon, ABS (Arif)
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Outdated instructions for creating
customised output format
Hi Arif,
Probably not for a few weeks. But we would be happy to help you directly
in the interim. So this is a WFS output format for GetFeature I assume?
I am not familiar with the CSML output format but something like the
following should do:
class CSMLOutputFormat extends WFSGetFeatureOutputFormat {
CSMLOutputFormat() {
super( "CSML" );
}
String getMimeType(Object value, Operation operation) {
return "..."; //whatever the mime type is
}
protected void write(FeatureCollectionType results, OutputStream
output, Operation getFeature)
throws ServiceException, IOException {
//do the output
}
}
That is the first step. The second step is creating an
applicationContext.xml file which registers the output format. Something
like this:
<beans>
<bean id="csmlOutputFormat" class="org.xyz.CSMLOutputFormat"/>
</beans>
I recommend structuring your project something like this:
csml/
pom.xml
src/main/java/
org/xyx/CSMLOutputFormat.java
applicationContext.xml
After that you can just create a jar for your project and drop it into
the WEB-INF/lib directory of your geoserver installation. Then if you
make a getfeature request with "OUTPUTFORMAT=CSML" it should engage.
Hope that helps. Please if anything trips you up or you have any more
questions just ask. Also please feel free to hope on the geoserver irc
channel (freenode#geoserver) and ping one of us. We would be happy to
help you "hands-on" there.
-Justin
Shaon, ABS (Arif) wrote:
Thanks Justin. Any idea when this documentation task will be
completed?
I need some assistance in this regard fairly soon. At minimum, if
someone could point me to the classes that need to be modified or
extended that would be greatly helpful.
Cheers
Arif
-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: 11 January 2008 18:17
To: Shaon, ABS (Arif)
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Outdated instructions for creating
customised output format
Hi Arif,
You are correct indeed. And there is a documentation task for the
1.6.0 release to document this properly. It is here:
http://jira.codehaus.org/browse/GEOS-1608
Although somewhat misleading as it specifies refactoring... but htis
includes documentation.
-Justin
Arif Shaon wrote:
I have noticed that the instructions for creating one's own output
format as provided at
http://docs.codehaus.org/display/GEOSDOC/Create+your+own+Output+Forma
t
are quite outdated, as they are for Geoserver v1.5. I also
understand
that in the new release of Geoserver, i.e. 1.6, its the
WFSGetFeatureOutputFormat class that needs to be extended in order to
add a new output format. I need to this to add CSML as one of the
output formats of Geoserver. So, I would greatly appreciate if
someone
could provide some updated instructions for this please?
Regards
Arif
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org
!DSPAM:4007,4787b375301641015089218!
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org