Justin, you are a champ! It looks like your xmlcodegen changes and 
instructions are just what we needed.

Generated GMLSchema members are now non-static, which is an API change. 
More notes below.

We still have to look at some details (ClientProperty/attribute 
handling, fixing app-schema breakages [static code]). I will do this 
next week.

Thanks at lot, this change is a big help for encoding complex types.

Kind regards,
Ben.


-------- Original Message --------
Subject: GML bindings: working MeasureTypeBindingTest
Date: Fri, 27 Nov 2009 15:35:47 +0800
From: Ben Caradoc-Davies
To: Rob Atkinson
CC: Rini Angreani

Rob A,

good news: Justin's changes did the trick. I just got your
MeasureTypeBindingTest to run. I also added a CodeTypeBindingTest. Don't
get too excited, as the new non-static members break several app-schema
tests (at compile time).

All gt-xsd-gml3 unit tests pass.

We are away on Monday on a field trip, so I thought I'd attach the patch
- it includes Justin's changes, the generated GMLSchema, your patches,
and my changes on top of them all - for your perusal. I'll be looking
further at GEOT-2505 next week.

Notes:

- I followed Justin's instructions to generate xsd-gml3 GMLSchema (email
now on GEOT-2505). I used "mvn -o xmlcodegen:generateSchemas" and had to
manually add package and copyright.

- I had to split the constructor in two to avoid the 64k method limit. I
also added a SuppressWarnings("unchecked") and reformatted.

- uom and codeSpace are in the null namespace, not gml

- I added support for XML attributes in GeoAPI attributes for
simple-content complex types, because this is what you created in your
test harness.

With these changes I could get MeasureTypeBindingTest and
CodeTypeBindingTest to pass.

We will talk next week.

Kind regards,

-- 
Ben Caradoc-Davies
Software Engineer, CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia



On 19/11/09 02:52, Justin Deoliveira wrote:
> 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,
>>>
>>
>


-- 
Ben Caradoc-Davies <ben.caradoc-dav...@csiro.au>
Software Engineer, CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia

------------------------------------------------------------------------------
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