Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Generate Custom XML from Graphical Diagram
Generate Custom XML from Graphical Diagram [message #693104] Tue, 05 July 2011 19:39 Go to next message
Daniel Ferreira Jorge is currently offline Daniel Ferreira JorgeFriend
Messages: 9
Registered: July 2011
Junior Member
Hi,

I'm developing a custom graphical editor using EMF, GEF, GMF. This editor is supposed to be similar to a BPMN designer, but for a proprietary BPM system, that does not follow or support any international standards like XPDL, BPEL, etc. Basically what I need to do is a diagram editor that is saved in a custom XML format that is supposed to be imported in that proprietary BPM application. This custom XML format is also proprietary and does not follow any standards.

To to simplify things, I need to create a Custom Graphical XML Editor like that:

1. I have a pallete with a square, a circle and a link.
2. I drag a square, a circle and create a link from the square to the circle.
3. I need to save the "model" in XML like that:

<shapes>
<squareShape id="square01" name="Square 01">
</squareShape>
<circleShape id="circle01" name="Circle 01">
</circleShape>
</shapes>
<links>
<connectionLink id="connection01" name="Connection 01">
<linkFrom>square01</linkFrom>
<linkTo>circle01</linkTo>
</connectionLink>
</links>

I tried to find documentation everywhere regarding this, including the eclipse books about modeling projects, EMF etc and I simply cannot find anything. Maybe someone can enlight me with some tips?

THANK YOU VERY MUCH IN ADVANCE!!

Daniel Ferreira Jorge
Re: Generate Custom XML from Graphical Diagram [message #693260 is a reply to message #693104] Wed, 06 July 2011 06:36 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

this sounds more like an EMF problem. The underlying model is saved in XMI which is in fact a XML dialect. Does this help you or do you need to follow a specific XML Stylesheet? The guys in the EMF Forum might help you better with this task.

Ralph
Re: Generate Custom XML from Graphical Diagram [message #693395 is a reply to message #693260] Wed, 06 July 2011 11:38 Go to previous messageGo to next message
Daniel Ferreira Jorge is currently offline Daniel Ferreira JorgeFriend
Messages: 9
Registered: July 2011
Junior Member
Hi Ralph, thank you for your answer.

Actually, I need to save the model in a very specific format, totally different from the format of the generated XMI. I also have to be able to open a XML in this specific format and show it as a graphical diagram.

Do you have any idea how I can do that? I also posted this question to the EMF forums and they said that I could have a better answer here!!

Thank you very much!
Re: Generate Custom XML from Graphical Diagram [message #693774 is a reply to message #693395] Thu, 07 July 2011 07:47 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

take a look at the screencast here. Is that what you want?

http://koehnlein.blogspot.com/2009/06/synchronized-editors-with-tmfxtext-and.html

Ralph
Re: Generate Custom XML from Graphical Diagram [message #693885 is a reply to message #693774] Thu, 07 July 2011 12:45 Go to previous messageGo to next message
Daniel Ferreira Jorge is currently offline Daniel Ferreira JorgeFriend
Messages: 9
Registered: July 2011
Junior Member
Hi Ralph, thank you again for your answer.

Actually, this is not what I need, but this is useful for another thing. Maybe I did not express myself in a clear manner. I do not want to save the MODEL itself in a custom XML format. I need to save a MODEL INSTANCE in a custom XML format.

When I finish my graphical editor and my users are using it, I need my users to be able to save their created diagram in a custom XML format. Like an export function.

Something like that: Imagine that I'm developing a BPMN designer. I need my users to have a function to "Export/Save to XPDL", or "Export/Save as BPEL". But instead of XPDL and BPEL, I need "Export/Save to Custom XML"

Can you understand?

Thank you very much my friend!
Re: Generate Custom XML from Graphical Diagram [message #693886 is a reply to message #693885] Thu, 07 July 2011 12:49 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

so a model to text transformation should do your job. Take a look at http://wiki.eclipse.org/Xpand . All you need is to define a transformation which produces text out of the model that is modeled when invoking an action in the eclipse workbench. Hope that helps you.

Ralph
Re: Generate Custom XML from Graphical Diagram [message #693935 is a reply to message #693886] Thu, 07 July 2011 14:04 Go to previous messageGo to next message
Daniel Ferreira Jorge is currently offline Daniel Ferreira JorgeFriend
Messages: 9
Registered: July 2011
Junior Member
Hey Ralph! Thank you!

I think that may be it. Just a question: is it possible to do the reverse with Xpand? Meaning: I can generate a text code from a model instance, but can I generate a model instance from a generated code?

I other words: I can export my model, but can I import?

Thank you again!!
Re: Generate Custom XML from Graphical Diagram [message #694435 is a reply to message #693935] Fri, 08 July 2011 15:19 Go to previous message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Le 07/07/2011 16:04, Daniel Ferreira Jorge a écrit :
> Hey Ralph! Thank you!
>
> I think that may be it. Just a question: is it possible to do the
> reverse with Xpand? Meaning: I can generate a text code from a model
> instance, but can I generate a model instance from a generated code?
>
> I other words: I can export my model, but can I import?
>
> Thank you again!!

For an eclipse project have a look to modisco :
http://www.eclipse.org/MoDisco/

By the way for Mode to text generation you should have a look to Acceleo
: http://www.eclipse.org/acceleo

Mariot
--
Mariot Chauvin @ Obeo

Blog : http://mariot-thoughts.blogspot.com
Twitter :http://twitter.com/mchv
Professional support : http://obeo.fr/pages/maintenance-and-support/
Previous Topic:Using XYLayout
Next Topic:Create Element and Link
Goto Forum:
  


Current Time: Tue Mar 02 06:13:47 GMT 2021

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

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

Back to the top