Home » Modeling » GMF (Graphical Modeling Framework) » GMF Resource vs Pathmaps
| | | | | |
Re: GMF Resource vs Pathmaps [message #663005 is a reply to message #662962] |
Fri, 01 April 2011 19:08   |
Eclipse User |
|
|
|
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 19:09] by Moderator
|
|
|
Re: GMF Resource vs Pathmaps [message #663014 is a reply to message #663005] |
Fri, 01 April 2011 21:04   |
Eclipse User |
|
|
|
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.
|
|
|
Re: GMF Resource vs Pathmaps [message #663086 is a reply to message #663014] |
Sun, 03 April 2011 08:34   |
Eclipse User |
|
|
|
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 08:38] by Moderator
|
|
|
Re: GMF Resource vs Pathmaps [message #663108 is a reply to message #663086] |
Sun, 03 April 2011 12:50  |
Eclipse User |
|
|
|
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?
|
|
|
Goto Forum:
Current Time: Wed Jul 23 07:49:13 EDT 2025
Powered by FUDForum. Page generated in 0.28621 seconds
|