From: Jody G. <jod...@gm...> - 2009-04-01 01:09:10
|
Hi Jon: You have fallen off the user list (I can answer email off the user list - but that involves a support contract). In this case I am actually not the best person to answer your question; and by asking your questions on the user list you can get answers from several developers. It is all good. In this case the tutorial may be a bit out of date; or you may wish to try another technology to produce your java beans. For examples of handling multiple ogc schemas have a look at some of the live implementations in the geotools code base that use this technology; you will find that wfs 1.1 support involves the wfs schema, gml schema and filter schema. My understanding is that you should deal with each schema at a time (producing a model that builds on the earlier models). GeoTools provides a model for a lot of the useful ogc schemas (filter, geomtry etc...). When it comes time to parse you will want to set up a configuration that is based on what you need to get done (I am not sure what schemas go into WCS?). In many cases we find that the OGC schemas have problems; in which case we report them; and modify the schema used to generate the model and/or bindings. Cheers, Jody On Tue, Mar 31, 2009 at 10:33 PM, Britton J (AT) <jbr...@gl...> wrote: > Hi, > > Thanks, I'm just trying it out now but I have a problem (as usual!). I'm > following the tutorial here -> > http://docs.codehaus.org/display/GEOTDOC/0+Purchase+Order+Parsing+Tutorial > > I'm trying to use JAXB to generate the model, but it doesn't tell me how to > direct it to the wcsCapabilities document, which is hidden away in > \src\main\xsd\wcs\1.0.0\. The tutorial is only dealing with one .xsd file, > while I've got a number of dependencies so I've copied all of the OGC schema > documents instead. How should I handle this? > > Thanks, > > Jon > > > -----Original Message----- > From: Jody Garnett [mailto:jod...@gm...] > Sent: Tue 31/03/2009 00:19 > To: Britton J (AT); geotools users > Subject: Re: [Geotools-gt2-users] Tips for implementing a WCS client > > Yes; you can generate both the java beans and bindings from the xml > schema; the tutorial covers how. > > Jody > > On Tue, Mar 31, 2009 at 12:35 AM, Britton J (AT) <jbr...@gl...> > wrote: >> Hi, >> >> Those tutorials looks pretty straightforward, although I haven't had a >> chance to really check them out yet. Is it possible to generate empty >> bindings automatically from the XML and then just fill them in as needed? >> >> Thanks, >> >> Jon >> >> >> -----Original Message----- >> From: Jody Garnett [mailto:jod...@gm...] >> Sent: Thu 26/03/2009 11:34 >> To: Britton J (AT) >> Subject: Re: [Geotools-gt2-users] Tips for implementing a WCS client >> >> Hrm; you do need to parse your capabilities response some how; .. and >> the wms code is not the best example here I am afraid (it uses an >> earlier version of the GTXML parser you can see documented in the user >> guide). >> >> The way the story goes is something like this: >> - make java beans to represent everything in your WCS Capabilities >> document >> (you can make up new stuff; reusing from geotools and geoapi in order >> to save time) >> - write "bindings" to teach the parser how to turn the XML into those java >> beans >> - package up all your bindings into a configuration >> - and then configure a parser with a configuration and use it to parse >> the capabilities document >> >> Links: >> - http://docs.codehaus.org/display/GEOTDOC/05+GTXML+Parsing+and+Encoding >> - http://docs.codehaus.org/display/GEOTDOC/XML+Developers+Guide >> >> I have been tempted to use JDOM or a few other technologies on >> occasion; for things like a capabilities document you can sometimes >> get away with it (because they are often small); however WMS >> capabilities documents have been known to get large so your milage may >> very. I stopped using JDOM when it did not update to Java 5; a few >> unofficial ports have tried; but I have not checked if the project is >> alive still. >> >> So have a look at the links above; and let me know what you think. >> >> Jody >> >> >> On Thu, Mar 26, 2009 at 10:11 PM, Britton J (AT) <jbr...@gl...> >> wrote: >>> Hi, >>> >>> I'm just trying to implement a WCS service using classes similar to those >>> used with WMS in GeoTools. I've come across a problem, my implementation >>> of >>> WCSGetCapabilitiesResponse (equivalent to WMSGetCapabilitiesResponse, >>> obviously) doesn't work because I don't have a WCSScheme object (do I >>> need >>> one?). >>> >>> The WMSGetCapabilitiesResponse constructor does the following: >>> >>> public WCSGetCapabilitiesResponse(String contentType, >>> InputStream inputStream) throws ServiceException, >>> IOException { >>> super(contentType, inputStream); >>> >>> try { >>> Map hints = new HashMap(); >>> hints.put(DocumentHandler.DEFAULT_NAMESPACE_HINT_KEY, >>> WMSSchema.getInstance()); >>> hints.put(DocumentFactory.VALIDATION_HINT, Boolean.FALSE); >>> >>> Object object; >>> try { >>> object = DocumentFactory.getInstance(inputStream, >>> hints, Level.WARNING); >>> } catch (SAXException e) { >>> throw (ServiceException) new >>> ServiceException("Error >>> while parsing XML.").initCause(e); >>> } >>> >>> if (object instanceof ServiceException) { >>> throw (ServiceException) object; >>> } >>> >>> this.capabilities = (Capabilities)object; >>> } finally { >>> inputStream.close(); >>> } >>> } >>> >>> >>> How could I carry out the equivalent for WCS? >>> >>> Thanks! >>> >>> Jon >> >> > > |