Skip to main content


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 16:37 Go to next message
John M. is currently offline John M.Friend
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 18:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
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.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problem with cross references [message #918709 is a reply to message #916204] Fri, 21 September 2012 09:13 Go to previous message
John M. is currently offline John M.Friend
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: Thu Mar 28 12:11:13 GMT 2024

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

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

Back to the top