Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF <-> Source XML Synchronization
EMF <-> Source XML Synchronization [message #506210] Wed, 06 January 2010 10:01 Go to next message
Nidhi  is currently offline Nidhi Friend
Messages: 92
Registered: December 2009
Member

Hi,

I have a use case where the tool I am developing has a multi-paged editor
with two tabs : Design and Source.

Design Tab allows modification of my model using UI and Source Tab allows
modification via directly changing the persisted XML.

Is there any way to achieve synchronization between these 2 tabs, such
that if I change the model in the design tab the change reflects in the source
tab and vice versa.

I did find some postings on this, nevertheless, could not get the right way of doing this.
Inface I also tried the EMF2DOMSSEAdapter to achieve this, but would rather not use
internal APIs.

Please do suggest me an elegant way of doing this. Is there any example I can refer
to.

Thanks a lot,
Nidhi
Re: EMF <-> Source XML Synchronization [message #506217 is a reply to message #506210] Wed, 06 January 2010 15:18 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030004000405080003030202
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Nidhi,

The SSE DOM with adapters is the best approach available I think, though
Cameron Bateman's approach looks very promising.

https://www.eclipsecon.org/submissions/2010/view_talk.php?id =1419


Nidhi wrote:
> Hi,
>
> I have a use case where the tool I am developing has a multi-paged editor
> with two tabs : Design and Source.
>
> Design Tab allows modification of my model using UI and Source Tab allows
> modification via directly changing the persisted XML.
>
> Is there any way to achieve synchronization between these 2 tabs, such
> that if I change the model in the design tab the change reflects in
> the source
> tab and vice versa.
>
> I did find some postings on this, nevertheless, could not get the
> right way of doing this.
> Inface I also tried the EMF2DOMSSEAdapter to achieve this, but would
> rather not use
> internal APIs.
>
> Please do suggest me an elegant way of doing this. Is there any
> example I can refer to.
>
> Thanks a lot,
> Nidhi

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

<!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">
Nidhi,<br>
<br>
The SSE DOM with adapters is the best approach available I think,
though Cameron Bateman's approach looks very promising.<br>
<blockquote><a
href=" https://www.eclipsecon.org/submissions/2010/view_talk.php?id =1419"> https://www.eclipsecon.org/submissions/2010/view_talk.php?id =1419</a></blockquote>
<br>
Nidhi wrote:
<blockquote cite="mid:hi28hd$u7o$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
I have a use case where the tool I am developing has a multi-paged
editor
<br>
with two tabs : Design and Source.
<br>
<br>
Design Tab allows modification of my model using UI and Source Tab
allows
<br>
modification via directly changing the persisted XML.
<br>
<br>
Is there any way to achieve synchronization between these 2 tabs, such
that if I change the model in the design tab the change reflects in the
source
<br>
tab and vice versa.
<br>
<br>
I did find some postings on this, nevertheless, could not get the right
way of doing this.
<br>
Inface I also tried the EMF2DOMSSEAdapter to achieve this, but would
rather not use
<br>
internal APIs.
<br>
<br>
Please do suggest me an elegant way of doing this. Is there any example
I can refer to.
<br>
<br>
Thanks a lot,
<br>
Nidhi
<br>
</blockquote>
</body>
</html>

--------------030004000405080003030202--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF <-> Source XML Synchronization [message #506253 is a reply to message #506217] Wed, 06 January 2010 12:14 Go to previous messageGo to next message
Nidhi  is currently offline Nidhi Friend
Messages: 92
Registered: December 2009
Member

Hi Ed,

> The SSE DOM with adapters is the best approach available I think, though

The EMF2DOMAdapter requires a Translator. The problem is that the metamodel (XSD) for the tool is quiet big and that too it is subjective to change without my control over it (comes from an external source).
Creating a translator for each structural feature might not be that scalable.

I tried recursing through the features generically to create translators, but this does not seem to be stable.

Am I doing something wrong here?

>Cameron Bateman's approach looks very promising.
> https://www.eclipsecon.org/submissions/2010/view_talk.php?id =1419

I'd look forward for the session to be uploaded, meanwhile would try to dig in.

Thanks,
Nidhi
Re: EMF <-> Source XML Synchronization [message #506349 is a reply to message #506253] Thu, 07 January 2010 08:54 Go to previous messageGo to next message
Nidhi  is currently offline Nidhi Friend
Messages: 92
Registered: December 2009
Member

Hi Ed,

Also one small thing, is there any example or tutorial existing for the "SSE DOM with adapters".
It would really be very helpful.

Thanks & Regards,
Nidhi
Re: EMF <-> Source XML Synchronization [message #506389 is a reply to message #506349] Thu, 07 January 2010 11:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Nidhi,

I'm pretty sure others have made this work, but no one ever writes
something up on the wiki to document their experiences to help speed up
the next person...


Nidhi wrote:
> Hi Ed,
>
> Also one small thing, is there any example or tutorial existing for
> the "SSE DOM with adapters".
> It would really be very helpful.
>
> Thanks & Regards,
> Nidhi
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF <-> Source XML Synchronization [message #506400 is a reply to message #506389] Thu, 07 January 2010 12:01 Go to previous messageGo to next message
Nidhi  is currently offline Nidhi Friend
Messages: 92
Registered: December 2009
Member

Hi Ed,

:) that's fine, indeed I found out that someone did write a nice blog series on this : Akrogen Blogs written by Angelo.

http://translate.google.co.in/translate?hl=en&sl=fr& u=http://blog.developpez.com/akrogen/%3Fpaged%3D3&ei=pyQ RS7SgOIHq7APN1-TYBQ&sa=X&oi=translate&ct=result& amp;resnum=2&ved=0CBQQ7gEwAQ&prev=/search%3Fq%3Dorg. eclipse.gef.examples.shapes.emfwst_1.0.0.zip%26hl%3Den%26sa% 3DG

The only thing is it in in French, so have to use Google Translator to read through them.

Just one last question, when you mentioned DOM SSE adapters, were you talking about EMF2DOMSSEAdapter and the WTP Translators only or some other adapter frwk.

Thanks,
Nidhi
Re: EMF <-> Source XML Synchronization [message #506451 is a reply to message #506400] Thu, 07 January 2010 14:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Nidhi,

Yes, I meant those.


Nidhi wrote:
> Hi Ed,
>
> :) that's fine, indeed I found out that someone did write a nice blog
> series on this : Akrogen Blogs written by Angelo.
>
> http://translate.google.co.in/translate?hl=en&sl=fr& u=http://blog.developpez.com/akrogen/%3Fpaged%3D3&ei=pyQ RS7SgOIHq7APN1-TYBQ&sa=X&oi=translate&ct=result& amp;resnum=2&ved=0CBQQ7gEwAQ&prev=/search%3Fq%3Dorg. eclipse.gef.examples.shapes.emfwst_1.0.0.zip%26hl%3Den%26sa% 3DG
>
>
> The only thing is it in in French, so have to use Google Translator to
> read through them.
>
> Just one last question, when you mentioned DOM SSE adapters, were you
> talking about EMF2DOMSSEAdapter and the WTP Translators only or some
> other adapter frwk.
>
> Thanks,
> Nidhi


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF <-> Source XML Synchronization [message #507441 is a reply to message #506451] Wed, 13 January 2010 14:16 Go to previous messageGo to next message
Nidhi  is currently offline Nidhi Friend
Messages: 92
Registered: December 2009
Member

Hi Ed,

I am trying to get the desired synchronization using WTP's Translator framework, but in the mean while I would want to rule out first any other possibility using pure EMF for synchronization before finally going with the Translators.

I tried to delve into EStores myself , since the approach suggested @ https://www.eclipsecon.org/submissions/2010/view_talk.php?id =1419 is not yet available in the form of uploaded materials.

Also I found this post @ http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg2 8148.html
The mechanism seems to work but wouldn't an unload and load of a resource each time source XML is edited, be computation lengthy.

Thanks,
Nidhi
Re: EMF <-> Source XML Synchronization [message #507459 is a reply to message #507441] Wed, 13 January 2010 14:57 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Nidhi,

Yes a full unload and reload is expensive and you'd lose all your
model-based view state. The Sample XML Schema Editor takes that brute
force approach.


Nidhi wrote:
> Hi Ed,
>
> I am trying to get the desired synchronization using WTP's Translator
> framework, but in the mean while I would want to rule out first any
> other possibility using pure EMF for synchronization before finally
> going with the Translators.
>
> I tried to delve into EStores myself , since the approach suggested @
> https://www.eclipsecon.org/submissions/2010/view_talk.php?id =1419 is
> not yet available in the form of uploaded materials.
> Also I found this post @
> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg2 8148.html
> The mechanism seems to work but wouldn't an unload and load of a
> resource each time source XML is edited, be computation lengthy.
>
> Thanks,
> Nidhi


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Anybody intersted in an EMF version for CDT DOM AST ?
Next Topic:NullPointerException in EMF code
Goto Forum:
  


Current Time: Thu Apr 18 23:32:06 GMT 2024

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

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

Back to the top