|
|
|
|
Re: provide a model with a plugin [message #419299 is a reply to message #419295] |
Sat, 17 May 2008 14:32 |
Ed Merks Messages: 33163 Registered: July 2009 |
Senior Member |
|
|
Felix,
In EcoreResourceFactoryImpl.createResource we use
result.getDefaultSaveOptions().put(XMLResource.OPTION_URI_HA NDLER,
new URIHandlerImpl.PlatformSchemeAware());
to avoid having a relative path from workspace resources to plugin
resources.
If you opened your model and saved it to a different resource rather
than just moving the file, you wouldn't have a problem...
Felix Dorner wrote:
> Hey,
>
> I created a plugin that holds an uml model library. When I now do:
> Load Resource... and enter "platform:/plugin/abcplugin/mymodel.uml it
> gets loaded.
> When I reference elements from "mymodel" in a user model, all the
> paths to the mymodel elements are made _relative_ (,e.g.
> ../../../../../plugin/mymodel.uml) This means, that as soon as I move
> the user model into a different folder, it gets invalid is that right?
> Is that something that needs to be handled with "pathmaps"? How?
>
> Thanks,
> Felix
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
|
Re: provide a model with a plugin [message #419305 is a reply to message #419303] |
Sat, 17 May 2008 16:47 |
Ed Merks Messages: 33163 Registered: July 2009 |
Senior Member |
|
|
Felix,
Comments below.
Felix Dorner wrote:
> Ed Merks wrote:
>
>> platform:/plugin/<plugin-id>/mymodel.uml is kind of already a nice
>> symbolic URI.
> Definitely, I'd prefer that one too.
>
> When developing standalone, you'd need to set up the URI
>> mappings from platform:/plugin/<plugin-id>/ -> jar:file:/c:/my.jar!/
>> because obviously when running standalone you have to do
>> programmatically all the things extension points normally do for you...
>
> Hm, I am not sure if I really understand how it works:
You asked about standalone execution. The above would remap any URI
prefixed by the first URI to be prefixed by the second URI instead, and
the second URI allows you to access contents within a zip/jar file. So
in this way, you could ensure that your symbolic "plugin" URIs are
accessible in their jars.
>
> I create and deploy a plugin that holds just a model. Inside this
> plugin's manifest I define an extension for the emf uri-map extension
> point.
> I checked what happens at startup: the EMF plugin checks for such
> extensions and stores the mappings in an internal map.
It stores them in URIConverter.URI_MAP.
>
> At this point I thought I can refer to my model model using the
> pathmap uri, no matter if I do this from inside another plugin or from
> a project in my workspace.
Yes. The same applies for platform:/plugin though and that works
without any additional registration.
>
> Thanks Ed,
> Felix
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03856 seconds