Skip to main content



      Home
Home » Modeling » EMF » Generating custom made href values when saving a model(generating customized href value, href, proxy, saving model)
Generating custom made href values when saving a model [message #1062360] Fri, 07 June 2013 08:01 Go to next message
Eclipse UserFriend
Hi,

I have a question about how I can refer to my own cutom made proxy href pointers instead of the pre-generated hrefs by EMF. Hopefully I manage to explain the case below.

I have two models loaded into my own ResourceImpl class in my application. The two models are loaded locally from two different XML files locally on my computer.

Model1 has the name: Structure.xml
Model2 has the name: Semantic.xml

I try to edit model1 and refer to an element in model2. I save the model to a new file, and when I have a look at the href pointer in the new element I created it says: href="Semantic.xml#a13". This is fine, but I want to make my own custom made href value, meaning that I want to replace the href value with my own customized value.

My question is therefore: how can I generate my own customized href value and add it to the href attribute of a newly added or changed element? If someone could point me to the class/method where the href value is being generated when I save a model, that would help me alot!

Thanks in advance!

Regards,
Magnus
Re: Generating custom made href values when saving a model [message #1062377 is a reply to message #1062360] Fri, 07 June 2013 08:49 Go to previous message
Eclipse UserFriend
Magnus,

Comments below.

On 07/06/2013 2:01 PM, Magnus Stuhr wrote:
> Hi,
>
> I have a question about how I can refer to my own cutom made proxy
> href pointers instead of the pre-generated hrefs by EMF. Hopefully I
> manage to explain the case below.
>
> I have two models loaded into my own ResourceImpl class in my
> application. The two models are loaded locally from two different XML
> files locally on my computer.
>
> Model1 has the name: Structure.xml
> Model2 has the name: Semantic.xml
>
> I try to edit model1 and refer to an element in model2. I save the
> model to a new file, and when I have a look at the href pointer in the
> new element I created it says: href="Semantic.xml#a13". This is fine,
> but I want to make my own custom made href value, meaning that I want
> to replace the href value with my own customized value.
It generates needs to be of the form <Resource-URI>#<Fragment-in-Resource>
>
> My question is therefore: how can I generate my own customized href
> value and add it to the href attribute of a newly added or changed
> element? If someone could point me to the class/method where the href
> value is being generated when I save a model, that would help me alot!
XMLHelperImpl computes it but there are limitations on what you can
change it too, i.e., it must contain a # to be considered a cross
document reference.

What are you trying to accomplish exactly and why?
>
> Thanks in advance!
>
> Regards,
> Magnus
Previous Topic:Xcore and Generics
Next Topic:How to programmatically generate java code from .genmodel?
Goto Forum:
  


Current Time: Thu Jul 10 18:58:14 EDT 2025

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

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

Back to the top