Home » Modeling » GMF (Graphical Modeling Framework) » GMF Resource vs Pathmaps
GMF Resource vs Pathmaps [message #662629] |
Thu, 31 March 2011 10:58 |
|
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 #662831 is a reply to message #662730] |
Fri, 01 April 2011 07:11 |
|
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
|
|
| | | |
Re: GMF Resource vs Pathmaps [message #663005 is a reply to message #662962] |
Fri, 01 April 2011 23:08 |
|
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 |
Ed Merks Messages: 33254 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 |
|
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 |
Ed Merks Messages: 33254 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/
|
|
|
Goto Forum:
Current Time: Tue Nov 12 23:49:03 GMT 2024
Powered by FUDForum. Page generated in 0.04120 seconds
|