|
Re: Resolving ecore cross references for ecore files created from xcore. [message #1220995 is a reply to message #1220974] |
Mon, 16 December 2013 15:02 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Martin,
Comments below.
On 16/12/2013 1:05 PM, Martin Taal wrote:
> Hi,
> Now I have another question related to xcore. In the Texo code I get
> an epackage from xcore (using an EMF(Xcore)Resource), I then store it
> in an ecore file.
Do you do that for all the Ecore model involved before saving any of them?
> When a xcore model refers to another xcore model, the resulting ecore
> will refer to the other ecore. I noticed that the references in ecore
> use this type of uri:
> org.eclipse.emf.texo.test.model.samples.sport.society#/EPackage/Society
> for example:
> <eClassifiers xsi:type="ecore:EClass" name="Club"
> eSuperTypes="org.eclipse.emf.texo.test.model.samples.sport.society#/EPackage/Society">
>
> when I read the ecore files using a resourceset the resolving of this
> reference fails here:
> position = Integer.parseInt(uriFragmentRootSegment);
> ResourceImpl line 713
> It assumes that the segment fragment is a number, while in my case it
> has the value EPackage.
Yes, it uses a symbolic approach rather than an index, but of course
only an XcoreResourceImpl recognizes that...
>
>
> How can I tell ecore to store the references in a different way using
> a number?
It's determined by the resource implementation in which the referenced
model is located...
> Or the other way around how can I tell EMF to resolve these references
> in a different way?
If you're going to move objects around, you have to be consistent and do
it for all the resources in the resource set, including, and in
particular, the resources being referenced if those references are going
to be moved as well...
>
> gr. Martin
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Resolving ecore cross references for ecore files created from xcore. [message #1221129 is a reply to message #1220995] |
Tue, 17 December 2013 00:20 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Ed,
Thanks, this pointed me in the right direction. I indeed do this for all ecore models. I got it working by moving the
epackage from the xcoreresource (and then not saving the xcoreresource to not let it be changed) to a XMIresource, the
uri's got generated in the standard way then. Maybe there is a nicer solution though...
gr. Martin
On 12/16/2013 04:02 PM, Ed Merks wrote:
> Martin,
>
> Comments below.
>
> On 16/12/2013 1:05 PM, Martin Taal wrote:
>> Hi,
>> Now I have another question related to xcore. In the Texo code I get an epackage from xcore (using an
>> EMF(Xcore)Resource), I then store it in an ecore file.
> Do you do that for all the Ecore model involved before saving any of them?
>> When a xcore model refers to another xcore model, the resulting ecore will refer to the other ecore. I noticed that
>> the references in ecore use this type of uri:
>> org.eclipse.emf.texo.test.model.samples.sport.society#/EPackage/Society
>> for example:
>> <eClassifiers xsi:type="ecore:EClass" name="Club"
>> eSuperTypes="org.eclipse.emf.texo.test.model.samples.sport.society#/EPackage/Society">
>>
>> when I read the ecore files using a resourceset the resolving of this reference fails here:
>> position = Integer.parseInt(uriFragmentRootSegment);
>> ResourceImpl line 713
>> It assumes that the segment fragment is a number, while in my case it has the value EPackage.
> Yes, it uses a symbolic approach rather than an index, but of course only an XcoreResourceImpl recognizes that...
>>
>>
>> How can I tell ecore to store the references in a different way using a number?
> It's determined by the resource implementation in which the referenced model is located...
>> Or the other way around how can I tell EMF to resolve these references in a different way?
> If you're going to move objects around, you have to be consistent and do it for all the resources in the resource set,
> including, and in particular, the resources being referenced if those references are going to be moved as well...
>>
>> gr. Martin
>>
>
--
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
|
|
|
Powered by
FUDForum. Page generated in 0.03510 seconds