[CDO] Saving resources in transaction [message #1060834] |
Tue, 28 May 2013 10:54  |
Eclipse User |
|
|
|
Hello,
I have this issue: I want to upload my existing file-based resources to CDO server. These resources are contained in ResourceSet and have cross-document references. The URIs in the ResourceSet are file-based since the ResourceSet is loaded from my local hard drive. However, on the CDO server I need to have those URIs little bit differently structured. For exmaple instead of having
/project/content.xmi
I would like to have something like
/allprojects/project/content
Is there any simple way to achieve this?
Regards
Martin
|
|
|
|
|
|
|
Re: [CDO] Saving resources in transaction [message #1061249 is a reply to message #1061014] |
Thu, 30 May 2013 14:41   |
Eclipse User |
|
|
|
Am 29.05.2013 16:02, schrieb Martin odloucký:
> Hi Eike,
> thank you very much for the link. I donwloaded the plugin from Git and studied the code. I have also looked at some
> documentation I have found. Unfortunately, I could not grasp the basic idea. I learned that you somehow create a
> source and target systems (such as FileSystemTransferSystem or RespositoryTransferSystem) and then create a
> CDOTransform object to perform the task.
So you could grasp the basic idea :P
> I have succesfully defined a source element of a file on my disk but I have no idea how to map it to another file or
> to a repository location.
Try these methods:
org.eclipse.emf.cdo.transfer.CDOTransfer.map(IPath, IProgressMonitor)
org.eclipse.emf.cdo.transfer.CDOTransfer.map(String, IProgressMonitor)
org.eclipse.emf.cdo.transfer.CDOTransfer.map(CDOTransferElement, IProgressMonitor)
> Sadly the FileSystemUIProvider class in the transfer plugins says TODO in convertTransferTarget method in which I
> hoped I would have found a hint.
Yeah, due to time constraints some methods are not implemented, yet. They're not needed for basic functionality.
>
> If you could provide just a few lines of simple code of how to do a very basic mapping you would make me happy for an
> entire week.
You're almost there. Try the methods above, call CDOTransfer.perform() and you're done.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08752 seconds