Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem with cross references
Problem with cross references [message #916167] Tue, 18 September 2012 12:37 Go to next message
John M. is currently offline John M.
Messages: 198
Registered: July 2010
Senior Member
Hello,

I have implemented a simple drag and drop from the navigator into my editor.
I want to validate the dropped file before adding, so I used the Diagnostician, but there is always a unresolved proxy.
I know which files missing so I added all to the ResourceSet. Here is my problem I think, because I use the absolute path (projectfolder/folder/file) from the workspace the resolve doesn't work.
I have tried it with EcoreUtil.resolve(object, resourceSet).

In the file the reference is like (folder/file).

Thanks for any advices.
Re: Problem with cross references [message #916204 is a reply to message #916167] Tue, 18 September 2012 14:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25910
Registered: July 2009
Senior Member
John,

Comments below.

On 18/09/2012 6:37 PM, John M. wrote:
> Hello,
>
> I have implemented a simple drag and drop from the navigator into my
> editor.
> I want to validate the dropped file before adding, so I used the
> Diagnostician, but there is always a unresolved proxy.
It's important that when you load a resource into a resource set you do
so with a proper absolute URI so that relative URIs within the
serialization are properly resolved to absolute URIs.
> I know which files missing so I added all to the ResourceSet.
It should be demand loaded.
> Here is my problem I think, because I use the absolute path
> (projectfolder/folder/file) from the workspace the resolve doesn't work.
For accessing workspace resources, you should use a URI as created by
URI.createPlatformResourceURI

* 2.44 How do I map between an EMF Resource and an Eclipse IFile?
<http://wiki.eclipse.org/index.php/EMF-FAQ#How_do_I_map_between_an_EMF_Resource_and_an_Eclipse_IFile.3F>

> I have tried it with EcoreUtil.resolve(object, resourceSet).
>
> In the file the reference is like (folder/file).
>
> Thanks for any advices.
Re: Problem with cross references [message #918709 is a reply to message #916204] Fri, 21 September 2012 05:13 Go to previous message
John M. is currently offline John M.
Messages: 198
Registered: July 2010
Senior Member
Thanks for the advice to use URI.createPlatformResourceURI, that solved the problem.
Previous Topic:Problem with with mutually referencing ELists
Next Topic:[CDO] Error while committing the transaction
Goto Forum:
  


Current Time: Wed Jul 23 05:42:43 EDT 2014

Powered by FUDForum. Page generated in 0.02898 seconds