Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Same document reference question
Same document reference question [message #524161] Wed, 31 March 2010 01:19 Go to next message
Neil Wang is currently offline Neil WangFriend
Messages: 105
Registered: July 2009
Senior Member
Hi,

I have a question about references in the same documents.

For example,

This reference is a self-reference and this is the correct format.
<referenceByKey href=" META-INF/backends/DB2UDBNT_V8_1/DD002HP0_HYPO_PRODUKT.tblxmi #FK_CROSS_SELLING_1 "/>

On serialization, it looks like the href path gets stripped off.
<referenceByKey href="#FK_CROSS_SELLING_1"/>

Therefore, it is not working properly in our product. Is there anyway we can force the full href to be retained after serialization?

Please advise.

regards,

Neil
Re: Same document reference question [message #524342 is a reply to message #524161] Wed, 31 March 2010 14:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090402090508070101050002
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Neil,

You can control the behavior or how URIs are resolve and deresolved using

/**
* 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";



Neil Wang wrote:
> Hi,
>
> I have a question about references in the same documents.
>
> For example,
>
> This reference is a self-reference and this is the correct format.
> <referenceByKey href="
> META-INF/backends/DB2UDBNT_V8_1/DD002HP0_HYPO_PRODUKT.tblxmi
> #FK_CROSS_SELLING_1 "/>
>
> On serialization, it looks like the href path gets stripped off.
> <referenceByKey href="#FK_CROSS_SELLING_1"/>
>
> Therefore, it is not working properly in our product. Is there anyway
> we can force the full href to be retained after serialization?
> Please advise.
>
> regards,
>
> Neil

--------------090402090508070101050002
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Neil,<br>
<br>
You can control the behavior or how URIs are resolve and deresolved
using<br>
<blockquote><small>  /**</small><br>
<small>   * A {@link URIHandler} value that will be used to control
how URIs are {@link URI#resolve(URI) resolved} during load </small><br>
<small>   * and {@link URI#deresolve(URI) deresolved} during save.</small><br>
<small>   * @see URI</small><br>
<small>   * @see URIHandler</small><br>
<small>   * @see XMLHelper#resolve(URI, URI)</small><br>
<small>   * @see XMLHelper#deresolve(URI)</small><br>
<small>   * @see URIHandlerImpl</small><br>
<small>   */</small><br>
<small>  String OPTION_URI_HANDLER = "URI_HANDLER";</small><br>
</blockquote>
<br>
<br>
Neil Wang wrote:
<blockquote cite="mid:hou7uv$dde$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
I have a question about references in the same documents.
<br>
<br>
For example,
<br>
<br>
This reference is a self-reference and this is the correct format.
<br>
&lt;referenceByKey href="
META-INF/backends/DB2UDBNT_V8_1/DD002HP0_HYPO_PRODUKT.tblxmi
#FK_CROSS_SELLING_1 "/&gt;
<br>
<br>
On serialization, it looks like the href path gets stripped off.
<br>
&lt;referenceByKey href="#FK_CROSS_SELLING_1"/&gt;
<br>
<br>
Therefore, it is not working properly in our product. Is there anyway
we can force the full href to be retained after serialization? <br>
Please advise.
<br>
<br>
regards,
<br>
<br>
Neil
<br>
</blockquote>
</body>
</html>

--------------090402090508070101050002--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Same document reference question [message #524388 is a reply to message #524342] Wed, 31 March 2010 18:34 Go to previous messageGo to next message
Neil Wang is currently offline Neil WangFriend
Messages: 105
Registered: July 2009
Senior Member
Hi,

Thank you for your comment.

I tried to find how to use OPTION_URI_HANDLER and this is what I found.

xmioptions.put(XMIResource.OPTION_URI_HANDLER,
new URIHandlerImpl.PlatformSchemeAware());

Therefore, I included this line in my code but it did not change anything. Am I on the right track? or I should use something else? please advise.

Neil
Re: Same document reference question [message #524442 is a reply to message #524388] Wed, 31 March 2010 23:43 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Neil,

No, you'll need to write your own handler implementation that does
specifically what you want. I should point out though that wasn't being
produced is correct and expected, so whatever is broken as a result
should be fixed rather than you trying to change what's produced. I'd
never expect a document to refer to itself by name!


Neil Wang wrote:
> Hi,
>
> Thank you for your comment.
>
> I tried to find how to use OPTION_URI_HANDLER and this is what I found.
> xmioptions.put(XMIResource.OPTION_URI_HANDLER,
> new URIHandlerImpl.PlatformSchemeAware());
>
> Therefore, I included this line in my code but it did not change
> anything. Am I on the right track? or I should use something else?
> please advise.
>
> Neil


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to skip html tags within a file loaded by EMF
Next Topic:Getting an EObject equivalent of a java object
Goto Forum:
  


Current Time: Thu Apr 25 22:50:25 GMT 2024

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

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

Back to the top