Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [emf-dev] Creating one EMF file of multiple resources

Eike,

Please use the EMF newsgroup, not the mailing list to ask user questions.

More comments below.


Eike Thaden wrote:
Hello,

I have a small problem with writing EMF models to files. The setup is as follows: I have one top level EObject which refers to some subobjects. The toplevel object and all subobjects are located in seperate Resources in the same ResourceSet. The references between these objects are transparently resolved by a model repository for my first program (which acts as a client for this repository).

However I have a second program which knows about EMF but cannot be connected to the repository. Therefore resolving references does not work.
What is the URI of each resource? How does this "transparent resolving" work?
I want to use the client to write one file (or maybe a set of files?) for use with this second program. The references have to be updated to point to the correct (local) subobject.

I already tried to use the EcoreUtil.copier class to make a copy of the top level object, update its references and save the copy to one file. But then the references are still pointing to (for my second program) unavailable EMF resources.
Unresolved proxies I suppose. You can use EcoreUtil.UnresolvedProxyCrossReferencer. EObject.eIsProxy will be true for unresolved proxies and you can cast to InternalEObject to access eProxyURI.
I could imagine that writing one file per resource and using a URIConverter to fix the references would do the trick. But I'm quite new to this stuff and have no idea how to implement this.
Please post follow up questions on the newsgroup instead of the mailing list.
Thank you in advance for your help.

Best regards,
 Eike Thaden
_______________________________________________
emf-dev mailing list
emf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/emf-dev


Back to the top