|
|
|
Re: [CDO] Object references [message #649722 is a reply to message #649708] |
Thu, 20 January 2011 12:35 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
Erdal,
when you export a resource from CDO to XMI, you are basically copying
all the EObject into a XMIResource (using
org.eclipse.emf.ecore.util.EcoreUtil.copyAll(Collection<? extends T>)).
This process implies copying the contents of one Resource, but does not
trascend beyond the Resource scope. So, if there are inter-resource
references, the copy will mantain that reference as a proxy to an
EObject in another resource.
So no, the export is not expected to copy contents beyond Resource
scope. I recall there is an old enhacement request for that, but can't
find it on bugzilla.
I'm not sure how to solve that. I guess you'll have to identify all
external references and export those resources too. Once you have the
smallest subset of interdependant resources, you have to update those
copied EObjects that used to have external refernces.
Erdal Karaca escribió:
> I see.
> The resource (itemtree) is located at the root of the repository.
> So, I would expect the href containing something similar to
> "/itemtree#L83". As that would be sufficient, wouldn't it?
|
|
|
Re: [CDO] Object references [message #649978 is a reply to message #649722] |
Fri, 21 January 2011 09:33 |
|
Hi Erdal,
I used the ECoreUtil's Copier to upload XMI files on a CDORepository, maybe it can help you :
// Step 1 : get all the CDOObjects you want to download
// Match each CDO root with a local resource in which you want to copy it
// Step 2 : copy all the roots
EcoreUtil.Copier copier = new Copier(true, false);
copier.copyAll(allRootsToCopy);
copier.copyReferences();
// Step 3 :
for (Resource localResource : createdLocalResources) {
for (CDOObject remoteRoot : localResourceToRemoteRootToCopy.get(remoteRoot )) {
EObject localCopy = copier.get(remoteRoot);
cdoResource.getContents().add(localCopy);
}
}
Let me know if it helps you,
Alex
|
|
|
Powered by
FUDForum. Page generated in 0.03694 seconds