Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [XCORE] Ecore.ecore inside the workspace with a relative path
[XCORE] Ecore.ecore inside the workspace with a relative path [message #1274379] Fri, 21 March 2014 11:44 Go to next message
Simone Di Cola is currently offline Simone Di ColaFriend
Messages: 60
Registered: February 2014
Member
Hi all,
everytime I relaod the genmodel file, it generates the ecore out of the xcore file in this way:

<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>

In practice, It tries to resolve Ecore.ecore inside the workspace with a relative path instead of doing this with the Package URI like this:

<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>

Is there any way to fix this behavior?

Thanks
Simone
Re: [XCORE] Ecore.ecore inside the workspace with a relative path [message #1274499 is a reply to message #1274379] Fri, 21 March 2014 15:06 Go to previous messageGo to next message
Simone Di Cola is currently offline Simone Di ColaFriend
Messages: 60
Registered: February 2014
Member
An ant script did the trick:

<!-- see http://5ise.quanxinquanyi.de/2013/01/11/avoiding-manual-merge-when-generating-plugin-xml-with-xtextxtend/ -->
<project default="updateEcore">

<target name="updateEcore">
<replaceregexp
file="model/xcore.ecore"
match="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#"
replace="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#"
flags="gis"
byline="false"
/>
<echo message="updated ecore" />
</target>

</project>
Re: [XCORE] Ecore.ecore inside the workspace with a relative path [message #1276250 is a reply to message #1274379] Mon, 24 March 2014 09:47 Go to previous messageGo to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 140
Registered: July 2009
Senior Member
Hi Simone,
some time ago I recognized the same problem concerning the IncQuery
project which uses Xcore, too:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401552

Maybe you can create another bug report since it's a general problem
from Xtext/Xcore (I don't know exactly)?

cheers,
Jan

Simone Di Cola wrote:
> Hi all,
> everytime I relaod the genmodel file, it generates the ecore out of the
> xcore file in this way:
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
> unique="false" eType="ecore:EDataType
> ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
>
> In practice, It tries to resolve Ecore.ecore inside the workspace with a
> relative path instead of doing this with the Package URI like this:
>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>
> Is there any way to fix this behavior?
>
> Thanks
> Simone
Re: [XCORE] Ecore.ecore inside the workspace with a relative path [message #1276424 is a reply to message #1276250] Mon, 24 March 2014 14:46 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
It's not a bug. As long as the tool processing the model invokes

resourceSet.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap(true));

it will properly find Ecore.ecore...

On 24/03/2014 2:47 AM, Jan Reimann wrote:
> Hi Simone,
> some time ago I recognized the same problem concerning the IncQuery
> project which uses Xcore, too:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=401552
>
> Maybe you can create another bug report since it's a general problem
> from Xtext/Xcore (I don't know exactly)?
>
> cheers,
> Jan
>
> Simone Di Cola wrote:
>> Hi all,
>> everytime I relaod the genmodel file, it generates the ecore out of the
>> xcore file in this way:
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
>> unique="false" eType="ecore:EDataType
>> ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
>>
>> In practice, It tries to resolve Ecore.ecore inside the workspace with a
>> relative path instead of doing this with the Package URI like this:
>>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2002/Ecore#//EString"/>
>>
>> Is there any way to fix this behavior?
>>
>> Thanks
>> Simone


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EObject for XML fragments
Next Topic:EMF external reference issue
Goto Forum:
  


Current Time: Fri Apr 19 06:08:16 GMT 2024

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

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

Back to the top