Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] How to create ecore file with sub-packages?
[Texo] How to create ecore file with sub-packages? [message #874687] Mon, 21 May 2012 07:16 Go to next message
Olaf Burdziakowski is currently offline Olaf Burdziakowski
Messages: 46
Registered: April 2012
Member
I have several separate files with xsd models for them. I wanted to create master package that use types from those seperate xsdmodel. Unfortunately Texo ignore schemaLocation tag.
Example: <xs:include schemaLocation="batch_config.xsd"/>

Then I found greatexample in Git:
http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/src/org/eclipse/emf/texo/modelgenerator/test/models/samples/kdm.ecore

There is a package that has sub-packages. How to create such ecore model?
I have several ecore models generated from my xsd files but copying them do not work in editor. Do I have to copy them manually in text file? Is there a special way to create?
Can it be generated from xsd file?
Re: [Texo] How to create ecore file with sub-packages? [message #874717 is a reply to message #874687] Mon, 21 May 2012 08:17 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5329
Registered: July 2009
Senior Member
Hi Ed,
Not sure but is it possible to somehow generate an ecore with subpackages from a xsd?

@Olaf and what happens if you use an xs:import? So that your master xsd has a separate namespace?

gr. Martin

On 05/21/2012 01:16 PM, Olaf Burdziakowski wrote:
> I have several separate files with xsd models for them. I wanted to create master package that use types from those
> seperate xsdmodel. Unfortunately Texo ignore schemaLocation tag.
> Example: <xs:include schemaLocation="batch_config.xsd"/>
>
> Then I found greatexample in Git:
> http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/src/org/eclipse/emf/texo/modelgenerator/test/models/samples/kdm.ecore
>
>
> There is a package that has sub-packages. How to create such ecore model?
> I have several ecore models generated from my xsd files but copying them do not work in editor. Do I have to copy them
> manually in text file? Is there a special way to create?
> Can it be generated from xsd file?


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] How to create ecore file with sub-packages? [message #874732 is a reply to message #874717] Mon, 21 May 2012 09:00 Go to previous messageGo to next message
Olaf Burdziakowski is currently offline Olaf Burdziakowski
Messages: 46
Registered: April 2012
Member
xs:import create two differentecore files. With same conntent as it where generate seperately but different names (URI in name). The tag that reffer to another xsd file is not created. No common ecore package event if same base name.
Re: [Texo] How to create ecore file with sub-packages? [message #875086 is a reply to message #874732] Tue, 22 May 2012 01:56 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5329
Registered: July 2009
Senior Member
Hi Olaf,
I checked with Ed and EMF can't create subpackages from a xsd, subpackages are not really recommended it seems.

I tested xs:include and with me it works fine. I had 2 xsd's, one includes the other and then I only generated code for
the including one and code was generated for all of the types in boths xsd's. So afaics Texo does not ignore the
included one.

gr. Martin

On 05/21/2012 03:00 PM, Olaf Burdziakowski wrote:
> xs:import create two differentecore files. With same conntent as it where generate seperately but different names (URI
> in name). The tag that reffer to another xsd file is not created. No common ecore package event if same base name.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] How to create ecore file with sub-packages? [message #875119 is a reply to message #875086] Tue, 22 May 2012 03:19 Go to previous messageGo to next message
Olaf Burdziakowski is currently offline Olaf Burdziakowski
Messages: 46
Registered: April 2012
Member
@Martin,
could you please attach/send the example you have? I would like to analyse how it is defined.
I spend yesterday whole day on combinig/guessing how to connect my ecore files into single one.
Finally I managed it works. I copied manually ecore files into single file. I had to define manually sub-packages and update references.
I think Texo should be able to do that too. For me it does not matter if it would be from xsd files or from ecore files but it would be very helpful feature.
Now I have single ecore file with 7 sub packages and generate correct code from the file. The file can be opened in editor even after code generation (all necessary classes are in single location, not in separate package folders). Now I can create master class that would be annotated, easy to manage group of xml files with save to database. This is what I needed.
Can you please think how to automate combining several schemas (xsd or ecore) into single ecore file?

[Updated on: Tue, 22 May 2012 03:21]

Report message to a moderator

Re: [Texo] How to create ecore file with sub-packages? [message #875223 is a reply to message #875119] Tue, 22 May 2012 06:45 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5329
Registered: July 2009
Senior Member
Hi Olaf,
But this sounds like a lot of work for you, each time you now change the xsd you have to manually update this
master/combined ecore file. The problem is that when changing an xsd I would need to know in which ecore file the model
is stored. Currently this is done by name, so a abc.xsd will update the abc.ecore and use a abc.annotationsmodel file.
But with multiple xsd files to one ecore file that's not really possible. At least not without having some xsd-ecore
linking information somewhere.

To be honest without a clear solution direction this feature does not have my highest priority.

gr. Martin

On 05/22/2012 09:19 AM, Olaf Burdziakowski wrote:
> @Martin,
> could you please attach/send the example you have? I would like to analyse how it is defined.
> I spend yesterday whole day on combinig/guessing how to connect my ecore files into single one.
> Finally I managed it works. I copied manually ecore files into single file. I had to define manually sub-packages and
> update references.
> I think Texo should be able to do that too. For me it does not matter if it would be from xsd files or from ecore files
> but it would be very helpful feature.
> Now I have single ecore file with 7 sub packages. Generate correct code from the file. The file can be opened in editor
> even after code generation (all necessary classes are in single location, not in separate package folders). Now I can
> create master class that would be annotated, easy to manage group of xml files with save to database. This is what I
> needed.
> Can you please think how to automate combining several schemas (sxd or ecore) into single ecore file?


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] How to create ecore file with sub-packages? [message #875239 is a reply to message #875223] Tue, 22 May 2012 07:43 Go to previous messageGo to next message
Olaf Burdziakowski is currently offline Olaf Burdziakowski
Messages: 46
Registered: April 2012
Member
@Martin,
for me the easiest would be creating multi-package ecore file when more than single xsd/ecore file was selected, or even separate menu option when needed.
Re: [Texo] How to create ecore file with sub-packages? [message #875248 is a reply to message #875239] Tue, 22 May 2012 08:02 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5329
Registered: July 2009
Senior Member
Hi Olaf,
Okay that sounds doable and not too difficult, when selecting multiple xsd's then a separate menu option can be there to
generate a single integrated ecore file. Can you enter a bugzilla for this?

gr. Martin

On 05/22/2012 01:43 PM, Olaf Burdziakowski wrote:
> @Martin,
> for me the easiest would be creating multi-package ecore file when more than single xsd/ecore file was selected, or even
> separate menu option when needed.
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:[ECP / general modeling] How to model a bi-directional "related to" reference in EMF and E
Next Topic:[EEF] component binding and eOperations
Goto Forum:
  


Current Time: Thu Aug 28 19:22:21 EDT 2014

Powered by FUDForum. Page generated in 0.07324 seconds