Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Extracting Data from GMF Model
Extracting Data from GMF Model [message #518905] Fri, 05 March 2010 12:10 Go to next message
Senaka  is currently offline Senaka Friend
Messages: 3
Registered: March 2010
Junior Member
Hi,

I'm new to GMF based editor development and seeks help from GMF user community on finalising the design for following requirement.

Requirement:
1. Developed GMF based editor.
2. Extracting data (attribute name, value, relationship etc) from the model designed using above editor and transform the data into XML document.

I'm clear about the first requirement, however having doubts on extracting the data. Could someone please suggest the best way on achieving the second requirement. Any documentation\tutorial would be really helpful.

Thanks & Regards,
Senaka
Re: Extracting Data from GMF Model [message #518949 is a reply to message #518905] Fri, 05 March 2010 09:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Senaka,

Your models will automatically be serialized to and from XML.


Senaka wrote:
> Hi,
>
> I'm new to GMF based editor development and seeks help from GMF user
> community on finalising the design for following requirement.
>
> Requirement:
> 1. Developed GMF based editor.
> 2. Extracting data (attribute name, value, relationship etc) from the
> model designed using above editor and transform the data into XML
> document.
>
> I'm clear about the first requirement, however having doubts on
> extracting the data. Could someone please suggest the best way on
> achieving the second requirement. Any documentation\tutorial would be
> really helpful.
>
> Thanks & Regards,
> Senaka
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Extracting Data from GMF Model [message #518963 is a reply to message #518949] Fri, 05 March 2010 15:13 Go to previous messageGo to next message
Senaka  is currently offline Senaka Friend
Messages: 3
Registered: March 2010
Junior Member

Hi Merks,

I assume 'Your models will automatically be serialized to XML' means, the model definition file created under Eclipse project when save the model project. I agree that this file is in xml format.

e.g:-

<mindmap:map xmlns:mindmap="http://www.example.org/mindmap">
<rootTopics name="Topic_One">
<attributes name="att1"/>
</rootTopics>
<rootTopics name="Topic_Two"/>
</mindmap:map>

However my requirment is extracting the data (say "att1") from the model definition. I can use xmlbean, xslt etc to extract the data from the above xml file. Is that the best solution? Is there any runtime java objects created when drow the diagram?

Regards,
Senaka
Re: Extracting Data from GMF Model [message #518969 is a reply to message #518963] Fri, 05 March 2010 15:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070505020708040806090400
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Senaka,

Comments below.

Senaka wrote:
>
> Hi Merks,
>
> I assume 'Your models will automatically be serialized to XML'
> means, the model definition file created under Eclipse project when
> save the model project. I agree that this file is in xml format.
>
> e.g:-
>
> <mindmap:map xmlns:mindmap="http://www.example.org/mindmap">
> <rootTopics name="Topic_One">
> <attributes name="att1"/>
> </rootTopics>
> <rootTopics name="Topic_Two"/>
> </mindmap:map>
>
> However my requirment is extracting the data (say "att1") from the
> model definition.
There will be a bunch of Topic instances that have a getName method as
well as a getAttributes method with Attribute instances that also have
getName methods.
> I can use xmlbean, xslt etc to extract the data from the above xml
> file. Is that the best solution? Is there any runtime java objects
> created when drow the diagram?
No, you'll be using EMF:
< http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava>

http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava

>
> Regards,
> Senaka

--------------070505020708040806090400
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">
Senaka,<br>
<br>
Comments below.<br>
<br>
Senaka wrote:
<blockquote cite="mid:hmr730$8d6$1@build.eclipse.org" type="cite"><br>
Hi Merks,
<br>
<br>
I assume 'Your models will automatically be serialized to  XML'  means,
the model definition file created under Eclipse project when save the
model project. I agree that this file is in xml format.
<br>
<br>
e.g:-
<br>
<br>
&lt;mindmap:map xmlns:mindmap=<a class="moz-txt-link-rfc2396E" href="http://www.example.org/mindmap">"http://www.example.org/mindmap"</a>&gt;
<br>
 &lt;rootTopics name="Topic_One"&gt;
<br>
     &lt;attributes name="att1"/&gt;
<br>
 &lt;/rootTopics&gt;
<br>
 &lt;rootTopics name="Topic_Two"/&gt;
<br>
&lt;/mindmap:map&gt;
<br>
<br>
However my requirment is extracting the data (say "att1") from the
model definition.</blockquote>
There will be a bunch of Topic instances that have a getName method as
well as a getAttributes method with Attribute instances that also have
getName methods.<br>
<blockquote cite="mid:hmr730$8d6$1@build.eclipse.org" type="cite"> I
can use xmlbean, xslt etc to extract the data from the above xml file.
Is that the best solution? Is there any runtime java objects created
when drow the diagram?
<br>
</blockquote>
No, you'll be using EMF:<a
href=" http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava"><br>
</a>
<blockquote><a
href=" http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava"> http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava</a><br>
</blockquote>
<blockquote cite="mid:hmr730$8d6$1@build.eclipse.org" type="cite"><br>
Regards,
<br>
Senaka
<br>
</blockquote>
</body>
</html>

--------------070505020708040806090400--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Extracting Data from GMF Model [message #518980 is a reply to message #518969] Fri, 05 March 2010 15:48 Go to previous messageGo to next message
Senaka  is currently offline Senaka Friend
Messages: 3
Registered: March 2010
Junior Member
Hi Merks,

Thanks. I'm trying to figure out how I can use EMF at runtime to extract data from the GMF model. My senario;

1. Drow the model using GMF based editor.
2. When click on 'Save' trigger EMF to extract data from the model.

Any ideas?

Regards,
Senaka
Re: Extracting Data from GMF Model [message #518995 is a reply to message #518980] Fri, 05 March 2010 16:09 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Senaka,

I'd suggest reading some basic information that's freely available on
the web. I already pointed you at some but my impression is you've not
read it. What you describe simply already works and all the source is
right there to look at how it works, so I'm not sure what your questions
are driving at. Just generate an editor and start to understand how it
all works, then ask more meaningful questions.

Senaka wrote:
> Hi Merks,
>
> Thanks. I'm trying to figure out how I can use EMF at runtime to
> extract data from the GMF model. My senario;
>
> 1. Drow the model using GMF based editor.
> 2. When click on 'Save' trigger EMF to extract data from the model.
>
> Any ideas?
>
> Regards,
> Senaka


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Copy paste working with GMF 2.2.0 not working with GMF2.2.2
Next Topic:[Validation]How to validate my diagrams without opening the diagram editor
Goto Forum:
  


Current Time: Fri Apr 26 16:39:15 GMT 2024

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

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

Back to the top