Skip to main content



      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 15:45 Go to next message
Eclipse UserFriend
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 16:18 Go to previous message
Eclipse UserFriend
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
>
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 Jul 01 00:59:40 EDT 2025

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

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

Back to the top