Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF Resource vs Pathmaps
icon9.gif  GMF Resource vs Pathmaps [message #662629] Thu, 31 March 2011 10:58 Go to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
My question is simple: Does a GMF Resource knows how to deal with Pathmaps?

I'm having a graphical editor based only in one file: both model and diagrams are in the same file. And I have references to another models registred via Pathmaps. But when I save the resource, these pathmaps have been changed to "platform:/plugin/...".

There's any way to persist the pathmaps in the model?

PD: I ask the same question in the EMF project, but I think it come under GMF project...

Thanks!
Marc
Re: GMF Resource vs Pathmaps [message #662730 is a reply to message #662629] Thu, 31 March 2011 16:14 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Marc,

In the end, GMF relies on EMF's serialization and that generally will
serialize using exactly the URI that's on the actual resource. So the
question really comes down the following: What are all the URIs of the
resources in the resource set?


Marc wrote:
> My question is simple: Does a GMF Resource knows how to deal with
> Pathmaps?
>
> I'm having a graphical editor based only in one file: both model and
> diagrams are in the same file. And I have references to another models
> registred via Pathmaps. But when I save the resource, these pathmaps
> have been changed to "platform:/plugin/...".
>
> There's any way to persist the pathmaps in the model?
>
> PD: I ask the same question in the
> http://www.eclipse.org/forums/index.php?t=msg&th=206967& amp;start=0&S=107e367cbc8041b7f26a0abb9b14152c,
> but I think it come under GMF project...
>
> Thanks!
> Marc


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF Resource vs Pathmaps [message #662831 is a reply to message #662730] Fri, 01 April 2011 07:11 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Thanks Ed Merks, but why I have a model where the uri's are stored like pathmaps, and other one with "platform:/plugin"?

Here I attach a sample:
<interactionUnits xsi:type="es.cv.gvcase.mdt.uim:PatternIU" xmi:id="_wk7ZY2P8Ed-qqIpuoCcFRQ" name="Menu">
  <patternDefinition href="pathmap://CIT_PATTERNS/model.uim#_b9YusGMtEd-qV9khV90TCQ"/>
</interactionUnits>

<widgets xmi:type="es.cv.gvcase.mdt.sketcher:Image" xmi:id="_bK2YMltnEeCgcofZYrtByg" id="Image1">
  <image xmi:type="es.cv.gvcase.mdt.sketcher:ImageDescriptor" href="platform:/plugin/es.cv.gvcase.ui.templates/models/model.sketcher_diagram#_cyhWCJP4Ed-DdagVoNb5aQ"/>
</widgets>


* The pathmap CIT_PATTERNS point to "platform:/plugin/es.cv.gvcase.ui.templates/models/", and EMF doesn't change it automatically... This is the model that has 2 separated files: model and diagram.
* model.sketcher_diagram is the model that has only one file for model and diagram.

Thanks Smile
Re: GMF Resource vs Pathmaps [message #662872 is a reply to message #662831] Fri, 01 April 2011 10:20 Go to previous messageGo to next message
LD  is currently offline LD Friend
Messages: 28
Registered: March 2011
Junior Member
Hi, these links may help.




Cheers.
Re: GMF Resource vs Pathmaps [message #662901 is a reply to message #662872] Fri, 01 April 2011 12:35 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
I can't see how these links can help in this problem LD... They doesn't explain nothing about it...

LD wrote on Fri, 01 April 2011 12:20
Hi, these links may help.




Cheers.

Re: GMF Resource vs Pathmaps [message #662962 is a reply to message #662831] Fri, 01 April 2011 15:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Marc,

All I can do is ask, what are the URIs of the resources in resource set
and why are they like that? If you created all the resources initially,
then you would appear to be responsible for their URIs.


Marc wrote:
> Thanks Ed Merks, but why I have a model where the uri's are stored
> like pathmaps, and other one with "platform:/plugin"?
>
> Here I attach a sample:
>
> <interactionUnits xsi:type="es.cv.gvcase.mdt.uim:PatternIU"
> xmi:id="_wk7ZY2P8Ed-qqIpuoCcFRQ" name="Menu">
> <patternDefinition
> href="pathmap://CIT_PATTERNS/model.uim#_b9YusGMtEd-qV9khV90TCQ"/>
> </interactionUnits>
>
>
> <widgets xmi:type="es.cv.gvcase.mdt.sketcher:Image"
> xmi:id="_bK2YMltnEeCgcofZYrtByg" id="Image1">
> <image xmi:type="es.cv.gvcase.mdt.sketcher:ImageDescriptor"
> href=" platform:/plugin/es.cv.gvcase.ui.templates/models/model.sket cher_diagram#_cyhWCJP4Ed-DdagVoNb5aQ "/>
>
> </widgets>
>
>
> * The pathmap CIT_PATTERNS point to
> "platform:/plugin/es.cv.gvcase.ui.templates/models/", and EMF doesn't
> change it automatically... This is the model that has 2 separated
> files: model and diagram.
> * model.sketcher_diagram is the model that has only one file for model
> and diagram.
>
> Thanks :)


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF Resource vs Pathmaps [message #663005 is a reply to message #662962] Fri, 01 April 2011 23:08 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Ed,

One advantage of using pathmaps, is that I can modify their value and, for instance, change the models from one plugin to other. It's just what has been happend to me: I have a pathmap defined into a plugin A that points to "platform:/plugin/A_id/model", where I have some models. Now, I have restructured some plugins, and I had to move this models to another plugin. So the new pathmap (with the same ID) now has the value that points to "platform:/plugin/B_id/model".

My problem, is that in some models, the references are stored like pathmap (in this models, there's no problem), but in other ones, the references are stored like platform:/plugin. But I work with the same way with all the models/resources. In fact, all the models are loaded into the same editing domain, so uses the same resource set.

Maybe I'm not explaining well, or maybe I don't understand your question Ed... Could you make the question in other way please?

Thanks for your response Ed. It's important to me.

[Updated on: Fri, 01 April 2011 23:09]

Report message to a moderator

Re: GMF Resource vs Pathmaps [message #663014 is a reply to message #663005] Sat, 02 April 2011 01:04 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Marc,

Comments below.

Marc wrote:
> Ed,
>
> One advantage of using pathmaps, is that I can modify their value and,
> for instance, change the models from one plugin to other.
Yep.
> It's just what has been happend to me: I have a pathmap defined into a
> plugin A that points to "platform:/plugin/A_id/model", where I have
> some models. Now, I have restructured some plugins, and I had to move
> this models to another plugin. So the new pathmap (with the same ID)
> now has the value that points to "platform:/plugin/B_id/model".
A logical URI that never changes has advantages over a physical URI that
changes when you move it.
>
> My problem, is that in some models, the references are stored like
> pathmap (in this models, there's no problem), but in other ones, the
> references are stored like platform:/plugin.
I wonder what the difference is in the two cases?
> But I work with the same way with all the models. In fact, all the
> models are into the same editing domain, so uses the same resource set.
That's normally how it works, yes.
>
> Maybe I'm not explaining well, or maybe I don't understand your
> question Ed... Could you make the question in other way please?
Look in the resource set at the point in time when you first create your
model instance(s), i.e., when you first create a new one and save it.
Of course you'll need to use the debugger to answer this question. Tell
me the URI of each and every resource in the resource set. These are
the URIs that will be used to serialized cross document references. Are
any of them of the form platform:/plugin. There in would lie the
problem. They need to be of the form pathmap:... if you want a
reference to it serialized using that URI.
>
> Thanks for your response Ed. It's important to me.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF Resource vs Pathmaps [message #663086 is a reply to message #663014] Sun, 03 April 2011 12:34 Go to previous messageGo to next message
Marc Mising name is currently offline Marc Mising nameFriend
Messages: 193
Registered: July 2009
Location: Valencia, Spain
Senior Member
Well, I did a test, and I reach a conclusion:
- If I load a resource (with the contextual menu action), its uri is "pathmap://PATTERNS/model.sketcher_diagram", and this resource is a GMFResource type, due to it contains booth the model and the diagrams, the resource is always loaded as " platform:/plugin/org.eclipse.sample.sketcher/models/model.sk etcher_diagram "
- If I load a resource, its uri is "pathmap://PATTERNS/model.uim", and this resource is a simple XMIResource that only contains the model, the resource is always loaded as "pathmap://PATTERNS/model.uim".

So, in the second configuration, the references that I made to this model, are always stored as "pathmap://..."

Is this test helpful?

I wonder why using GMFResources, the models are not loaded as pathmaps... it's a bug?

[Updated on: Sun, 03 April 2011 12:38]

Report message to a moderator

Re: GMF Resource vs Pathmaps [message #663108 is a reply to message #663086] Sun, 03 April 2011 16:50 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Marc,

Comments below.

Marc wrote:
> Well, I did a test, and I reach a conclusion:
> - If I load a resource (with the contextual menu action), its uri is
> "pathmap://PATTERNS/model.sketcher_diagram", and this resource is a
> GMFResource type, due to it contains booth the model and the diagrams,
> the resource is always loaded as "
> platform:/plugin/org.eclipse.sample.sketcher/models/model.sk
> etcher_diagram "
I'm not sure which contextual menu action you mean. EMF's basic Load
Resource... dialog lets you specify a URI and that's exactly the URI it
will use to load that resource. GMF might well have actions that
behave differently. You have a debugger so you could investigate what
it's doing...
> - If I load a resource, its uri is "pathmap://PATTERNS/model.uim", and
> this resource is a simple XMIResource that only contains the model,
> the resource is always loaded as "pathmap://PATTERNS/model.uim".
>
> So, in the second configuration, the references that I made to this
> model, are always stored as "pathmap://.."
So does that solve your problem?
>
> Is this test helpful?
I think it tells you that if you specify the URIs you want, it works the
way you want. Did you determine these things using the debugger?


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Dynamically extending a model using an xsd scheme
Next Topic:TopNode that is also a ChildNode
Goto Forum:
  


Current Time: Fri Mar 29 06:30:22 GMT 2024

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

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

Back to the top