Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Persisting loaded resources across two models - pathmap is lost
Persisting loaded resources across two models - pathmap is lost [message #513171] Tue, 09 February 2010 03:48 Go to next message
Johannes is currently offline JohannesFriend
Messages: 25
Registered: July 2009
Junior Member
This is an UML2 problem but it seems to adress the emf-resource plugins.

I have an UML-model and i load other UML-models via a pathmap-reference.
The problem occurs, if i have:


Model A Model B Model C

instance of inherits from
InstanceSpec. A -------- Class B --------------- Class C


if now Model A is persisted, the references in Model B to Model C
change from e.g.:

href=" pathmap://TEST/Case/C/Test100202C.uml#_PQ2FQBAYEd-Bf7DSqLsGu Q"

to

href="../C/Test100202C.uml#_PQ2FQBAYEd-Bf7DSqLsGuQ"


The URI-mappings (pathmap://TEST/Case/C/ = C:\data\home\ws\Test100202C)
are put to

SharedResourceSetUtil.getSharedResourceSet().getURIConverter ().getURIMap()
and
URIConverter.URI_MAP
for test reasons, but it doesnt help. (I m not sure which map is the
right one).

Any pointers on this are appreciated!
Thanks,
Johannes
Re: Persisting loaded resources across two models - pathmap is lost [message #513211 is a reply to message #513171] Tue, 09 February 2010 11:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26215
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050604040205030104010907
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Johannes,

Comments below.

J. Gro
Re: Persisting loaded resources across two models - pathmap is lost [message #513255 is a reply to message #513211] Tue, 09 February 2010 14:33 Go to previous message
Johannes is currently offline JohannesFriend
Messages: 25
Registered: July 2009
Junior Member
Ed, thank you for your quick help.

I have now built my own URIHandler which doesnt deresolve the relative
paths. This seems to work quite well.


Ed Merks schrieb:
> Johannes,
>
> Comments below.
>
> J. GroƟ wrote:
>> This is an UML2 problem but it seems to adress the emf-resource plugins.
>>
>> I have an UML-model and i load other UML-models via a
>> pathmap-reference. The problem occurs, if i have:
>>
>>
>> Model A Model B Model C
>>
>> instance of inherits from
>> InstanceSpec. A -------- Class B --------------- Class C
>>
>>
>> if now Model A is persisted, the references in Model B to Model C
>> change from e.g.:
>>
>> href=" pathmap://TEST/Case/C/Test100202C.uml#_PQ2FQBAYEd-Bf7DSqLsGu Q"
>>
>> to
>>
>> href="../C/Test100202C.uml#_PQ2FQBAYEd-Bf7DSqLsGuQ"
> If a resource X with absolute URI x contains a reference to another
> resource Y with absolute URI y, and it's possible to create a relative
> path between x and y, then a relative path will be serialized.
>>
>>
>> The URI-mappings (pathmap://TEST/Case/C/ = C:\data\home\ws\Test100202C)
>> are put to
>>
>> SharedResourceSetUtil.getSharedResourceSet().getURIConverter ().getURIMap()
>> and
>> URIConverter.URI_MAP
>> for test reasons, but it doesnt help. (I m not sure which map is the
>> right one).
> URI mappings are used only to open a stream for the resource's actual
> URI x. They have no impact on the name used for serialization, which is
> determined purely from the actual URI of the resource.
>
> You could use this XMLResource option to gain more control:
>
> /**
> * A {@link URIHandler} value that will be used to control how
> URIs are {@link URI#resolve(URI) resolved} during load
> * and {@link URI#deresolve(URI) deresolved} during save.
> * @see URI
> * @see URIHandler
> * @see XMLHelper#resolve(URI, URI)
> * @see XMLHelper#deresolve(URI)
> * @see URIHandlerImpl
> */
> String OPTION_URI_HANDLER = "URI_HANDLER";
>
>
>>
>> Any pointers on this are appreciated!
>> Thanks,
>> Johannes
Previous Topic:[EMF CDO] Undo adding first object to a list throws ArrayIndexOutOfBoundsException
Next Topic:Appropriate to use XMI for persistence?
Goto Forum:
  


Current Time: Sat Nov 22 00:17:23 GMT 2014

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

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