Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Resolving proxy URIs with a customized URI schema(EMF, Proxy, URIHandler)
Resolving proxy URIs with a customized URI schema [message #1052657] Tue, 30 April 2013 11:11 Go to next message
Magnus Stuhr is currently offline Magnus StuhrFriend
Messages: 3
Registered: April 2013
Junior Member
Hi everyone,

Sorry if a similar question has been asked elsewhere. We tried to look around in the news group for a proper solution to our problem, but did not find anything.

We have an EMF application based on interlinked XMI resources. These XMI resources are referenced to each other by proxy URIs with a customized URI schema provided by an external XMI repository. The protocol of this schema is "localref://". We have all the XMI resources stored locally in a file repository (not in the Eclipse project).

What we are trying to do is the load the correct referenced files specified by the proxy URI. We tried doing this by implementing our own URIHandler and connecting it to our ResourceSet like this:

editingDomain.getResourceSet().getURIConverter().getURIHandlers().add(0,new OurURIHandler(editingDomain.getResourceSet()));

When we click on a proxy URI in the editor, the proxy URI is being sent to the "createInputStream" method in the "OurURIHandler" class. We have no clue where to go from here, and we would highly appreciate any pointers or advices on how to proceed!

Thanks in advance!

Best regards,
Magnus Stuhr
Re: Resolving proxy URIs with a customized URI schema [message #1052821 is a reply to message #1052657] Tue, 30 April 2013 15:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Magnus,

Comments below.

On 30/04/2013 2:47 PM, Magnus Stuhr wrote:
> Hi everyone,
>
> Sorry if a similar question has been asked elsewhere. We tried to look
> around in the news group for a proper solution to our problem, but did
> not find anything.
>
> We have an EMF application based on interlinked XMI resources. These
> XMI resources are referenced to each other by proxy URIs with a
> customized URI schema provided by an external XMI repository. The
> protocol of this schema is "localref://". We have all the XMI
> resources stored locally in a file repository (not in the Eclipse
> project).
What do you mean by a file repository. Are they just files in the file
system?
>
> What we are trying to do is the load the correct referenced files
> specified by the proxy URI. We tried doing this by implementing our
> own URIHandler and connecting it to our ResourceSet like this:
>
> editingDomain.getResourceSet().getURIConverter().getURIHandlers().add(0,new
> OurURIHandler(editingDomain.getResourceSet()));
>
> When we click on a proxy URI in the editor, the proxy URI is being
> sent to the "createInputStream" method in the "OurURIHandler" class.
> We have no clue where to go from here, and we would highly appreciate
> any pointers or advices on how to proceed!
Look at some of the other handlers like FileURIHandler and the base
class URIHandlerImpl. Before I try to give a detailed answer that
might not be relevant, I need to understand what you mean by a "file
repository".
> Thanks in advance!
>
> Best regards,
> Magnus Stuhr


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Resolving proxy URIs with a customized URI schema [message #1053046 is a reply to message #1052821] Thu, 02 May 2013 08:04 Go to previous messageGo to next message
Magnus Stuhr is currently offline Magnus StuhrFriend
Messages: 3
Registered: April 2013
Junior Member
Hi again,

Sorry if I was a bit unclear. By "file repository" I mean we have all the relevant files stored locally on our file system. In other words, we have all the models stored locally as XMI.
Re: Resolving proxy URIs with a customized URI schema [message #1053087 is a reply to message #1053046] Thu, 02 May 2013 11:21 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Magnus,

In that case it should suffice to use URI mappings in the URI
converter. Properly you can use a folder mapping for this type of
thing, i.e., foo:/bar/ -> file:/d:/folder/ would map all URIs starting
with the given prefix to the given location in the file system.


On 02/05/2013 10:04 AM, Magnus Stuhr wrote:
> Hi again,
>
> Sorry if I was a bit unclear. By "file repository" I mean we have all
> the relevant files stored locally on our file system. In other words,
> we have all the models stored locally as XMI.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Customizing Outline View
Next Topic:Map keys shall be only attributes of an EClass
Goto Forum:
  


Current Time: Thu Apr 25 11:08:56 GMT 2024

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

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

Back to the top