|
|
Re: Persisting loaded resources across two models - pathmap is lost [message #513255 is a reply to message #513211] |
Tue, 09 February 2010 14:33 |
Johannes Gross Messages: 28 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
|
|
|
Powered by
FUDForum. Page generated in 0.05331 seconds