Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem serializing a model that references Ecore.ecore
Problem serializing a model that references Ecore.ecore [message #430439] Wed, 20 May 2009 19:45 Go to next message
Bryan Hunt is currently offline Bryan HuntFriend
Messages: 366
Registered: July 2009
Senior Member
My EMF workflow model has a non-containment reference to EClassifier.
I customized the generated editor to automatically load Ecore.ecore so
that I could set the reference value. Here's how I'm loading the
Ecore.ecore:

URI ecoreURI =
URI.createPlatformPluginURI("/org.eclipse.emf.ecore/model/Ecore.ecore ",
false);
editingDomain.getResourceSet().getResource(ecoreURI, true);

The references are being serialized as:

<type xsi:type="ecore:EDataType"
href=" ../../plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EStri ng "/>

The problem is the ../.. What I really wanted was platform:/plugin/
Any idea on what I'm doing wrong?

Bryan
Re: Problem serializing a model that references Ecore.ecore [message #430440 is a reply to message #430439] Wed, 20 May 2009 20:18 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Bryan,

EcoreResourceFactoryImpl uses this option to avoid that:

result.getDefaultSaveOptions().put(XMLResource.OPTION_URI_HA NDLER,
new URIHandlerImpl.PlatformSchemeAware());


Bryan Hunt wrote:
> My EMF workflow model has a non-containment reference to EClassifier.
> I customized the generated editor to automatically load Ecore.ecore so
> that I could set the reference value. Here's how I'm loading the
> Ecore.ecore:
>
> URI ecoreURI =
> URI.createPlatformPluginURI("/org.eclipse.emf.ecore/model/Ecore.ecore ",
> false);
> editingDomain.getResourceSet().getResource(ecoreURI, true);
>
> The references are being serialized as:
>
> <type xsi:type="ecore:EDataType"
> href=" ../../plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EStri ng "/>
>
> The problem is the ../.. What I really wanted was platform:/plugin/
> Any idea on what I'm doing wrong?
>
> Bryan
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Unable to serialize model to XML with special chars in string attributes
Next Topic:Jar InputStream to create an Ecore Resource
Goto Forum:
  


Current Time: Tue Apr 23 13:43:55 GMT 2024

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

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

Back to the top