Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [xtext] "EPackage is used twice" or How to import several packages of the same ecore model
[xtext] "EPackage is used twice" or How to import several packages of the same ecore model [message #536933] Mon, 31 May 2010 14:32 Go to next message
Eclipse UserFriend
Originally posted by: kuehnlenz.informatik.hu-berlin.de

Hi,

My existing ecore model has several packages:
- root_package
-- package_A
-- package_B
-- package_C

and within package A classes from package B and C are referenced.

Now I used the project creation wizard "Xtext Project From Existing
Ecore Models" with the root_package as default package.

The generated xtext file contains now three imports:

import "platform:/resource/testProject/test.ecore" as package_A
import "platform:/resource/testProject/test.ecore" as package_B
import "platform:/resource/testProject/test.ecore" as package_C

But there are error messages on that import statements:
"EPackage [...] is used twice."

What I have to do in order to import/use several packages of the same
ecore model?

Thanks in advance,
Frank
Re: [xtext] "EPackage is used twice" or How to import several packages of the same ecore m [message #537035 is a reply to message #536933] Tue, 01 June 2010 06:24 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1771
Registered: July 2009
Senior Member
(replying to eclipse.modeling.tmf, which is where Xtext is discussed)

Frank Kuehnlenz schrieb:
> Hi,
>
> My existing ecore model has several packages:
> - root_package
> -- package_A
> -- package_B
> -- package_C
>
> and within package A classes from package B and C are referenced.
>
> Now I used the project creation wizard "Xtext Project From Existing
> Ecore Models" with the root_package as default package.

If you can split them up, i.e. one file per EPackage, I strongly suggest
to do so. Nested packages tend to complicate things.

>
> The generated xtext file contains now three imports:
>
> import "platform:/resource/testProject/test.ecore" as package_A
> import "platform:/resource/testProject/test.ecore" as package_B
> import "platform:/resource/testProject/test.ecore" as package_C

That's a bug in the wizard (please file a bug report).
You need to add the fragment part to the URIs. They should looke like
this:

platform:/resource/testProject/test.ecore#//package_A

Sven

--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: [xtext] "EPackage is used twice" or How to import several packages of the same ecore m [message #622960 is a reply to message #536933] Tue, 01 June 2010 06:24 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1771
Registered: July 2009
Senior Member
(replying to eclipse.modeling.tmf, which is where Xtext is discussed)

Frank Kuehnlenz schrieb:
> Hi,
>
> My existing ecore model has several packages:
> - root_package
> -- package_A
> -- package_B
> -- package_C
>
> and within package A classes from package B and C are referenced.
>
> Now I used the project creation wizard "Xtext Project From Existing
> Ecore Models" with the root_package as default package.

If you can split them up, i.e. one file per EPackage, I strongly suggest
to do so. Nested packages tend to complicate things.

>
> The generated xtext file contains now three imports:
>
> import "platform:/resource/testProject/test.ecore" as package_A
> import "platform:/resource/testProject/test.ecore" as package_B
> import "platform:/resource/testProject/test.ecore" as package_C

That's a bug in the wizard (please file a bug report).
You need to add the fragment part to the URIs. They should looke like
this:

platform:/resource/testProject/test.ecore#//package_A

Sven

--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Previous Topic:[xtext] "EPackage is used twice" or How to import several packages of the same ecore model
Next Topic:Light weight modelling framework
Goto Forum:
  


Current Time: Sun Nov 23 17:37:22 GMT 2014

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

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