Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [XSD] ecore:implements and Superclass
[XSD] ecore:implements and Superclass [message #653462] Wed, 09 February 2011 20:10 Go to next message
Eclipse UserFriend
Originally posted by: jconlon.apache.org

With Helios SR1, EMF Core runtime of 2.6.1 and XSD 2.6.0 I am creating a
Ecore model of the latest version of the google extension to KML
utilizing the schemas:

1. atom-author-link.xsd which is a subset of http://www.w3.org/2005/Atom
2. http://docs.oasis-open.org/election/external/xAL.xsd
3. http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd
and
4. http://www.google.com/kml/ext/2.2

For readablility I wish to remove the default Type suffix from each of
the generated classes by using ecore:name to change the name of the
generated classes.

Far as I can see ecore:name does the trick and creates the class with
the name I give it. So instead of AbstractTourPrimativeType using
ecore:name="AbstractTourPrimitive" create the name with out the Type suffix.
(Wrote a XSLT stylesheet to do most but not all the replacements in the
xsd before I use it to create a ecore/genmodel)

Problem comes in when creating my final child model which extend base
types from the other models. Because of the renaming of the classes in
the super models I use the ecore:implements to steer the Superclass of
the extending classes to the name of the previously modified classes in
the other models (Ones without the Type suffix)

<element name="AbstractTourPrimitive"
type="gx:AbstractTourPrimitiveType" />

<complexType name="AbstractTourPrimitiveType"
ecore:name="AbstractTourPrimitive"
ecore:implements="kml:AbstractObject">
<complexContent>
<extension base="kml:AbstractObjectType" />
</complexContent>

</complexType>


But this does not seem to work, as I get errors from the genmodel
complaining about unable to resolve proxies.

Here is what I see in the generated ECore:

<eClassifiers xsi:type="ecore:EClass" name="AbstractTourPrimitive"
eSuperTypes=" ../../com.verticon.opengis.kml.core.model/model/kml.ecore#// AbstractObjectType ">
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="AbstractTourPrimitiveType"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
</eClassifiers>

My ecore:implements does not appear to do anything:-( Any ideas?
Perhaps I am missing something with the use of ecore:implements?

thanks for any help,

John
Re: [XSD] ecore:implements and Superclass [message #653474 is a reply to message #653462] Wed, 09 February 2011 21:11 Go to previous message
Eclipse UserFriend
Originally posted by: jconlon.apache.org

Problem was caused by an overlooked reference in the setup of my edited
schema file...

.... the google extensions schema was importing the namespace :

<!-- Import the language we are extending: OGC KML 2.2 -->
<import namespace="http://www.opengis.net/kml/2.2"
schemaLocation="http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd" />

So I changed it to point to the previously marked up local schema file.

<!-- Import the language we are extending: OGC KML 2.2 -->
<import namespace="http://www.opengis.net/kml/2.2"
schemaLocation=" ../com.verticon.opengis.kml.core.schema/ogckml22-trimmed.xsd "

/>

After that everything worked!

John

John E. Conlon wrote:
> With Helios SR1, EMF Core runtime of 2.6.1 and XSD 2.6.0 I am creating a
> Ecore model of the latest version of the google extension to KML
> utilizing the schemas:
>
> 1. atom-author-link.xsd which is a subset of http://www.w3.org/2005/Atom
> 2. http://docs.oasis-open.org/election/external/xAL.xsd
> 3. http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd
> and
> 4. http://www.google.com/kml/ext/2.2
>
> For readablility I wish to remove the default Type suffix from each of
> the generated classes by using ecore:name to change the name of the
> generated classes.
>
> Far as I can see ecore:name does the trick and creates the class with
> the name I give it. So instead of AbstractTourPrimativeType using
> ecore:name="AbstractTourPrimitive" create the name with out the Type
> suffix.
> (Wrote a XSLT stylesheet to do most but not all the replacements in the
> xsd before I use it to create a ecore/genmodel)
>
> Problem comes in when creating my final child model which extend base
> types from the other models. Because of the renaming of the classes in
> the super models I use the ecore:implements to steer the Superclass of
> the extending classes to the name of the previously modified classes in
> the other models (Ones without the Type suffix)
>
> <element name="AbstractTourPrimitive"
> type="gx:AbstractTourPrimitiveType" />
>
> <complexType name="AbstractTourPrimitiveType"
> ecore:name="AbstractTourPrimitive"
> ecore:implements="kml:AbstractObject">
> <complexContent>
> <extension base="kml:AbstractObjectType" />
> </complexContent>
>
> </complexType>
>
>
> But this does not seem to work, as I get errors from the genmodel
> complaining about unable to resolve proxies.
>
> Here is what I see in the generated ECore:
>
> <eClassifiers xsi:type="ecore:EClass" name="AbstractTourPrimitive"
> eSuperTypes=" ../../com.verticon.opengis.kml.core.model/model/kml.ecore#// AbstractObjectType ">
>
> <eAnnotations
> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
> <details key="name" value="AbstractTourPrimitiveType"/>
> <details key="kind" value="elementOnly"/>
> </eAnnotations>
> </eClassifiers>
>
> My ecore:implements does not appear to do anything:-( Any ideas?
> Perhaps I am missing something with the use of ecore:implements?
>
> thanks for any help,
>
> John
>
Previous Topic:How to force re-generation of the java headers?
Next Topic:Serialization of EMF data to Relational DB
Goto Forum:
  


Current Time: Fri Apr 26 16:19:45 GMT 2024

Powered by FUDForum. Page generated in 0.03807 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top