OK, i have committed the modifiactions i made to the xmlcodegen plugin 
to allow it to generate the schema for gml. But there is a disclaimer, i 
had to hack the gml schema files to do it.

I have attached some relevant files here:

http://jira.codehaus.org/browse/GEOT-2505

Including:

1) the generated GMLSchema (which does not compile)
2) the patches to the gml xsd
3) the xsd-gml3 pom.xml plugin configuration

I have also updated some of the docs here:

http://docs.codehaus.org/display/GEOTDOC/1+Configuration+Parameter+Reference

So to reproduce what i have done you should:

1) build the xmlcodegen plugin locally
2) apply the patches to the gml schema
3) set up teh plugin configuration

And then from the xsd-gml3 module:

mvn org.geotools.maven:xmlcodegen:generateSchema

The generated schema will end up in src/main/java

-Justin

Justin Deoliveira wrote:
> Hi Ben,
> 
> I will throw this on my todo list for tomorrow. I have the generated 
> schema and the configuration i need to generate it (including the hacks 
> need to process the gml schema) on a hard drive backed up at the office. 
> I will resurrect it tomorrow.
> 
> -Justin
> 
> Ben Caradoc-Davies wrote:
>> Justin,
>>
>> I am exploring Rob Atkinson's proposed solution for GEOT-2505 (the GML 
>> property encoding problem):
>> http://jira.codehaus.org/browse/GEOT-2505
>>
>> Before attempting the proposed fix, I would like to confirm that I can 
>> recreate gt-xsd-gml3 GMLSchema as it is. This does not appear to be 
>> straightforward.
>>
>> - Is there any documentation of how to run xmlcodegen for GML3? I have 
>> been using a combination of word-of-mouth and trial-and-error, with 
>> limited success.
>>
>> I have these, but I recall you indicating that the process is quite 
>> tedious and requires manual intervention:
>> http://docs.codehaus.org/display/GEOTDOC/0+Plugin+Configuration
>> http://docs.codehaus.org/display/GEOTDOC/1+Configuration+Parameter+Reference 
>>
>> Any more?
>>
>> It would be very useful to have a step-by-step procedure of how to 
>> generate GMLSchema for GML 3.1.
>>
>> - You mentioned at the FOSS4G code sprint that you had some fixes that 
>> would improve xmlcodegen. Have you committed these?
>>
>> This is what I have done so far:
>>
>> (1) I had to hack the pom, because the current gt-xsd-gml3 pom is 
>> configured to make GML 3.2 GMLSchema (only). I based my work on r32010. 
>> Here is my plugin configuration:
>>
>> <plugin>
>> <groupId>org.geotools.maven</groupId>
>> <artifactId>xmlcodegen</artifactId>
>> <configuration>
>> <schemaLocation>gml.xsd</schemaLocation>
>> <schemaSourceDirectory>${basedir}/src/main/resources/org/geotools/gml3</schemaSourceDirectory>
>>  
>>
>> <schemaLookupDirectories>
>> <schemaLookupDirectory>${basedir}/../xsd-core/src/main/resources/org/geotools/xlink</schemaLookupDirectory>
>>  
>>
>> <schemaLookupDirectory>${basedir}/src/main/resources/org/geotools/gml3/bindings/smil</schemaLookupDirectory>
>>  
>>
>> </schemaLookupDirectories>
>> <generateConfiguration>false</generateConfiguration>
>> <generateBindingConfiguration>false</generateBindingConfiguration>
>> <generateBindingInterface>false</generateBindingInterface>
>> <generateSchemaLocationResolver>false</generateSchemaLocationResolver>
>> <imports>
>> <import>org.geotools.xs.XSSchema</import>
>> <import>org.geotools.gml3.smil.SMIL20Schema</import>
>> <import>org.geotools.gml3.smil.SMIL20LANGSchema</import>
>> </imports>
>> <followComplexTypes>true</followComplexTypes>
>> <includes>
>> <include>AbstractFeatureType</include>
>> <include>AbstractFeatureCollectionType</include>
>> </includes>
>> </configuration>
>> </plugin>
>>
>> [As an aside, GML 3.2 is misnamed {should have been called GML 4}; we 
>> should have a separate module, as it can coexist with GML 3.1.1.]
>>
>> I get some warnings when I run "mvn xmlcodegen:generateSchema".
>>
>> [INFO] Building GML3 XML Support
>> [INFO]    task-segment: [xmlcodegen:generateSchema]
>> [INFO] 
>> ------------------------------------------------------------------------
>> [INFO] [xmlcodegen:generateSchema]
>> [INFO] org.apache.maven.artifact.factory.defaultartifactfact...@1275d39
>> [WARNING] Unable to load org.geotools.gml3.GML
>> [WARNING] Unable to load org.geotools.filter.v1_0.OGC
>> [WARNING] Unable to load org.geotools.filter.v1_1.OGC
>> [INFO] Parsing schema: /home/car605/geoserver/src with 
>> spaces/geotools-trunk/modules/extension/xsd/xsd-gml3/src/main/resources/org/geotools/gml3/gml.xsd
>>  
>>
>> [INFO] Loading import schema: org.geotools.xs.XSSchema
>> [INFO] Loading import schema: org.geotools.gml3.smil.SMIL20Schema
>> [INFO] Loading import schema: org.geotools.gml3.smil.SMIL20LANGSchema
>> 17-Nov-2009 10:27:36 org.geotools.maven.xmlcodegen.SchemaGenerator generate
>> INFO: Generting simple types
>> 17-Nov-2009 10:27:36 org.geotools.maven.xmlcodegen.SchemaGenerator generate
>> INFO: Generting complex types
>> 17-Nov-2009 10:27:36 org.geotools.maven.xmlcodegen.SchemaGenerator generate
>> INFO: AbstractFeatureCollectionType
>> 17-Nov-2009 10:27:36 org.geotools.maven.xmlcodegen.SchemaGenerator generate
>> INFO: AbstractFeatureType
>> [INFO] 
>> ------------------------------------------------------------------------
>> [INFO] BUILD SUCCESSFUL
>> [INFO] 
>> ------------------------------------------------------------------------
>>
>> (2) The generated code tries to instantiate Name (should be NameImpl). 
>> Is this a GeoTools 2.4 -> GeoAPI migration issue?
>>
>> (3) Type restrictions are generated as Sets, not Lists, so do not compile.
>>
>> (4) Supertypes are wrong, e.g. XSAnyType not the correct GML types 
>> (probably because of the missing imports).
>>
>> (5) Schemas are different (again, probably because of the missing imports).
>>
>> Your ideas and advice are most welcome.
>>
>> Kind regards,
>>
> 

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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to