Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Proxy(EMF Proxy)
EMF Proxy [message #941013] Fri, 12 October 2012 02:25 Go to next message
Abhijeet Shankargouda is currently offline Abhijeet Shankargouda
Messages: 40
Registered: January 2012
Member
Hello All,
There are two resource A and B created from same metamodel. There are few resources from A which refer to resource from B as string.How can I resolve this?. I think it can be handled through EMF proxy. If my understanding is right then can anyone please help me in solving this.
Re: EMF Proxy [message #941066 is a reply to message #941013] Fri, 12 October 2012 03:30 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 24530
Registered: July 2009
Senior Member
Abhijeet,

Comments below.

On 12/10/2012 8:25 AM, Abhijeet Shankargouda wrote:
> Hello All,
> There are two resource A and B created from same metamodel. There
> are few resources from A which refer to resource from B as string.
Can you give an example?
> How can I resolve this?. I think it can be handled through EMF proxy.
> If my understanding is right then can anyone please help me in solving
> this.
Re: EMF Proxy [message #941149 is a reply to message #941066] Fri, 12 October 2012 04:48 Go to previous messageGo to next message
Abhijeet Shankargouda is currently offline Abhijeet Shankargouda
Messages: 40
Registered: January 2012
Member
File 1 :
<library id ="a">
<book name="sample">
<author-ref ="bob" docref="b">
</book>
</library>

File 2 :
<library id ="b">
<author name="bob" age="21" language="english">
</author>
</library>

View : should be something like this
<library id="a">
<book name="sample">
<author name="bob" age="21" language="english">
</book>
<library>

Any changes made in view should reflect back the changes into respective files.

Re: EMF Proxy [message #941170 is a reply to message #941149] Fri, 12 October 2012 05:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 24530
Registered: July 2009
Senior Member
Do these references have to look like this?

On 12/10/2012 10:48 AM, Abhijeet Shankargouda wrote:
> File 1 :
> <library id ="a">
> <book name="sample">
> <author-ref ="bob" docref="b">
This isn't well formed XML
> </book>
> </library>
>
> File 2 :
> <library id ="b">
> <author name="bob" age="21" language="english">
> </author>
> </library>
>
> View : should be something like this
View?
> <library id="a">
> <book name="sample">
> <author name="bob" age="21" language="english">
> </book>
> <library>
>
> Any changes made in view should reflect back the changes into
> respective files.
>
>
Re: EMF Proxy [message #941172 is a reply to message #941170] Fri, 12 October 2012 05:14 Go to previous messageGo to next message
Abhijeet Shankargouda is currently offline Abhijeet Shankargouda
Messages: 40
Registered: January 2012
Member
yes, Is it possible?
Re: EMF Proxy [message #941194 is a reply to message #941172] Fri, 12 October 2012 05:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 24530
Registered: July 2009
Senior Member
So in the model you might define a transient volatile reference and
write logic to compute the referenced object from the attributes that
are present.

Do you have a model already?

On 12/10/2012 11:14 AM, Abhijeet Shankargouda wrote:
> yes, Is it possible?
Re: EMF Proxy [message #941195 is a reply to message #941172] Fri, 12 October 2012 05:36 Go to previous messageGo to next message
Abhijeet Shankargouda is currently offline Abhijeet Shankargouda
Messages: 40
Registered: January 2012
Member
Sorry Ed .. such view is not required . Actually I'm using metamodel for GEF. So for cross referencing of resource between documents is getting very difficult, if cross document referencing is resolved then it will be very helpful to me.
Re: EMF Proxy [message #941197 is a reply to message #941195] Fri, 12 October 2012 05:37 Go to previous messageGo to next message
Abhijeet Shankargouda is currently offline Abhijeet Shankargouda
Messages: 40
Registered: January 2012
Member
No Message Body
Re: EMF Proxy [message #941198 is a reply to message #941197] Fri, 12 October 2012 05:38 Go to previous messageGo to next message
Abhijeet Shankargouda is currently offline Abhijeet Shankargouda
Messages: 40
Registered: January 2012
Member
Yes I have the model.
Re: EMF Proxy [message #941202 is a reply to message #941198] Fri, 12 October 2012 05:40 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 24530
Registered: July 2009
Senior Member
And that model looks like?

On 12/10/2012 11:38 AM, Abhijeet Shankargouda wrote:
> Yes I have the model.
Re: EMF Proxy [message #941233 is a reply to message #941202] Fri, 12 October 2012 06:18 Go to previous messageGo to next message
Abhijeet Shankargouda is currently offline Abhijeet Shankargouda
Messages: 40
Registered: January 2012
Member
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="library"
nsPrefix="library">
<eClassifiers xsi:type="ecore:EClass" name="library">
<eStructuralFeatures xsi:type="ecore:EReference" name="Book"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="author" eType="#//author"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Book">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="author-ref" eType="#//link"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="link">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="docref" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="author">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="age" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="language" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>
Re: EMF Proxy [message #941238 is a reply to message #941233] Fri, 12 October 2012 06:21 Go to previous messageGo to next message
Abhijeet Shankargouda is currently offline Abhijeet Shankargouda
Messages: 40
Registered: January 2012
Member
it is dirty model which i have uploaded .. Do you need more clarification on model?
Re: EMF Proxy [message #941558 is a reply to message #941238] Fri, 12 October 2012 12:37 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 24530
Registered: July 2009
Senior Member
Abhijeet,

You could try defining a transient volatile derived reference on link
that uses the information in the attributes to locate an author.
There's no general support for finding a resource just from an ID.
You'll have to implement something by hand for such mapping.

On 12/10/2012 12:21 PM, Abhijeet Shankargouda wrote:
> it is dirty model which i have uploaded .. Do you need more
> clarification on model?
Re: EMF Proxy [message #944713 is a reply to message #941558] Mon, 15 October 2012 00:34 Go to previous message
Abhijeet Shankargouda is currently offline Abhijeet Shankargouda
Messages: 40
Registered: January 2012
Member
Thank you Ed, I will try with transient volatile derived reference, and get back to you for any queries. Thanks a lot.
Previous Topic:[Teneo] OneToOne turns into ManyToOne
Next Topic:Retrieving E_ID from EObject
Goto Forum:
  


Current Time: Sun May 19 11:48:12 EDT 2013

Powered by FUDForum. Page generated in 0.01963 seconds