On 01/06/10 10:40, Jody Garnett wrote:
> I thought I would take a look at app schema resolver to see how it is used; 
> thus far looking at test cases I cannot see how to bundle my own schema up in 
> jar form.

Please see the GS user manual:
http://docs.geoserver.org/trunk/en/user/data/app-schema/app-schema-resolution.html#classpath

Examples of how to make schema jars using maven are in 
modules/unsupported/app-schema/app-schema-packages subdirectories.

The full documentation of the path convention is in the javadoc for 
AppSchemaResolver.getSimpleHttpresourcePath(URI).

> I also cannot find any docs on the geotools site. I am fine if you want to 
> have the build of your configuration instructions on the geoserver site; the 
> requirement for a page showing a code example is still in place. And is a 
> good opportunity to link to where ever you are storing documentation.

Can we use the new doc framework? It will be much easier to manage code 
examples written in sphinx.

The best classpath example is AppSchemaConfigurationTest.classpath . 
Creating a Configuration is the central step. Note that real use must 
add a GML 3.1 GMLConfiguration as a dependency in the constructor. Yes, 
this should go in the library user manual (which I think is your meaning 
in asking this question).

     /**
      * Test we can {...@link Schemas#findSchemas(Configuration)} with 
classpath only.
      */
     @Test
     public void classpath() {
         Configuration configuration = new 
AppSchemaConfiguration("urn:cgi:xmlns:CGI:GeoSciML:2.0",
 
"http://www.geosciml.org/geosciml/2.0/xsd/geosciml.xsd";, new 
AppSchemaResolver());
         SchemaIndex schemaIndex = Schemas.findSchemas(configuration);
         Assert.assertEquals(3, schemaIndex.getSchemas().length);
         String schemaLocation = 
schemaIndex.getSchemas()[0].getSchemaLocation();
         Assert.assertTrue(schemaLocation.startsWith("jar:file:"));
         Assert.assertTrue(schemaLocation.endsWith("geosciml.xsd"));
    }

Kind regards,

-- 
Ben Caradoc-Davies <ben.caradoc-dav...@csiro.au>
Software Engineering Team Leader
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

------------------------------------------------------------------------------

_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to