Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to get the platform uri from a pathmap?
How to get the platform uri from a pathmap? [message #523000] Wed, 24 March 2010 17:23 Go to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

In another conversation I got the CrossReferencer recommended. So I get
all external references of an EObject with

EcoreUtil.ExternalCrossReferencer.find(referee);

The keys of the returned map represent the EObjects of the referencing
model in the other resource. I want to collect all resources which
reference the EObject 'referee' and are placed in the platform:

Map<EObject, Collection<Setting>> references =
EcoreUtil.ExternalCrossReferencer.find(referee);
for (EObject referer : references.keySet()) {
Resource resource = referer.eResource();
URI uri = resource.getURI();
String platformString = uri.toPlatformString(true);
if(platformString != null){
referers.add(platformString);
}
}

But I never get a platformString because the uri always is a pathmap.
How can I now translate the pathmap to a platform string? And where can
I read more about pathmaps?

best regards,
Gilbert
Re: How to get the platform uri from a pathmap? [message #523013 is a reply to message #523000] Wed, 24 March 2010 18:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Gilbert,

Comments below.

Gilbert Mirenque wrote:
> In another conversation I got the CrossReferencer recommended. So I get
> all external references of an EObject with
>
> EcoreUtil.ExternalCrossReferencer.find(referee);
>
> The keys of the returned map represent the EObjects of the referencing
> model in the other resource. I want to collect all resources which
> reference the EObject 'referee' and are placed in the platform:
>
> Map<EObject, Collection<Setting>> references =
> EcoreUtil.ExternalCrossReferencer.find(referee);
> for (EObject referer : references.keySet()) {
> Resource resource = referer.eResource();
> URI uri = resource.getURI();
> String platformString = uri.toPlatformString(true);
>
There's URI.isPlatformResource.
> if(platformString != null){
> referers.add(platformString);
> }
> }
>
> But I never get a platformString because the uri always is a pathmap.
> How can I now translate the pathmap to a platform string? And where can
> I read more about pathmaps?
>
Sounds like a UML2 thing... You can use
resourceSet.getURIConverter().normalize(uri) to follow redirections to
their ultimate resolution...
> best regards,
> Gilbert
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to get the platform uri from a pathmap? [message #523148 is a reply to message #523013] Thu, 25 March 2010 05:44 Go to previous message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

> resourceSet.getURIConverter().normalize(uri) to follow redirections to
> their ultimate resolution...
Thanks Ed - that was the crucial hint.
Previous Topic:[CDO] on Google App Engine
Next Topic:Unexpected interaction between UML Association#ownedEnds and DeleteCommand - AssocTest.java (1/1)
Goto Forum:
  


Current Time: Thu Apr 25 07:07:02 GMT 2024

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

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

Back to the top