Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Saving model in xml
Saving model in xml [message #672312] Fri, 20 May 2011 16:22 Go to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
Hello,

I generated editor based on my model in GMF. The model is being saved as XMI, how can I change it to save in XML?

thanks!
Re: Saving model in xml [message #672412 is a reply to message #672312] Fri, 20 May 2011 23:35 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Is your model being saved in a resource separate from the diagram resource?


forums-noreply@eclipse.org wrote:
> Hello,
>
> I generated editor based on my model in GMF. The model is being saved
> as XMI, how can I change it to save in XML?
>
> thanks!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Saving model in xml [message #672444 is a reply to message #672412] Sat, 21 May 2011 03:25 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
No, in gmfgen I set to use one file for diagram and model.
Re: Saving model in xml [message #672536 is a reply to message #672444] Sat, 21 May 2011 15:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
I think the diagram model requires UUIDs as supported by XMIResourceImpl
so likely your goal is in conflict with what's going to work. Why do
you even want this?
Have you read about serializing your model is a file separate from the
diagram. Then you can use any resource implementation for the model.
I'm not sure the details, but it's been asked many times so I'm sure a
little searching will turn up the answer for you.


forums-noreply@eclipse.org wrote:
> No, in gmfgen I set to use one file for diagram and model.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Saving model in xml [message #672597 is a reply to message #672312] Sun, 22 May 2011 01:35 Go to previous messageGo to next message
pavithra Missing name is currently offline pavithra Missing nameFriend
Messages: 12
Registered: May 2011
Junior Member
Hi,
You asked about how to save the model in XML.

I'm also developing an editor using GMF and I have the same requirement.I have developed my domain model using XML schema and I found following way.

When you run the GMF project, a new instance of Eclipse appears and you have to create a new project using the diagram you developed. When you open that project you can see two files. In my case, they are default.ixml and default.ixml_diagram. Then right click on default.ixml--> open with--> text editor. When it opens I can see my model in XML format.

Hope this helps.

Have a nice day!!!
Re: Saving model in xml [message #673149 is a reply to message #672536] Sun, 22 May 2011 14:38 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
I understand about the two files for model and diagram, but I wanted to have one file for model and diagram. I was thinking that once I changed type of editor (model and diagram in one file) then all ui specific details are defined in the code (figures, edit parts, etc) rather than in the XMI file. Unless I don't understand completely how this works - I am basing my presumptions on emf/gef duo.

Ed Merks wrote on Sat, 21 May 2011 11:54
I think the diagram model requires UUIDs as supported by XMIResourceImpl
so likely your goal is in conflict with what's going to work. Why do
you even want this?
Have you read about serializing your model is a file separate from the
diagram. Then you can use any resource implementation for the model.
I'm not sure the details, but it's been asked many times so I'm sure a
little searching will turn up the answer for you.


forums-noreply@eclipse.org wrote:
> No, in gmfgen I set to use one file for diagram and model.

Re: Saving model in xml [message #673150 is a reply to message #672597] Sun, 22 May 2011 14:43 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
Yes, that's what I have now, but was looking (if possible) to have one model file and code reflecting gmftools, gmfgraph setup. Kind of how emf/gef works. With default gmf implementation you always need two files to make editor work.

pavithra wrote on Sat, 21 May 2011 21:35
Hi,
You asked about how to save the model in XML.

I'm also developing an editor using GMF and I have the same requirement.I have developed my domain model using XML schema and I found following way.

When you run the GMF project, a new instance of Eclipse appears and you have to create a new project using the diagram you developed. When you open that project you can see two files. In my case, they are default.ixml and default.ixml_diagram. Then right click on default.ixml--> open with--> text editor. When it opens I can see my model in XML format.

Hope this helps.

Have a nice day!!!

Re: Saving model in xml [message #673171 is a reply to message #673149] Sun, 22 May 2011 16:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Comments below.

forums-noreply@eclipse.org wrote:
> I understand about the two files for model and diagram, but I wanted
> to have one file for model and diagram. I was thinking that once I
> changed type of editor (model and diagram in one file) then all ui
> specific details are defined in the code (figures, edit parts, etc)
> rather than in the XMI file.
What do you mean in the code? Clearly the information needs to be
stored in the XML in some form to be recovered when you open the
resource....
> Unless I don't understand completely how this works
I'm not sure I understand what you're expecting. For a diagram to be
computed from scratch each time you open just the model file? You'd
have no control over layout or any other aspect this way...
> - I am basing my presumptions on emf/gef duo.
>
> Ed Merks wrote on Sat, 21 May 2011 11:54
>> I think the diagram model requires UUIDs as supported by
>> XMIResourceImpl so likely your goal is in conflict with what's going
>> to work. Why do you even want this?
>> Have you read about serializing your model is a file separate from
>> the diagram. Then you can use any resource implementation for the
>> model. I'm not sure the details, but it's been asked many times so
>> I'm sure a little searching will turn up the answer for you.
>>
>>
>> forums-noreply@eclipse.org wrote:
>> > No, in gmfgen I set to use one file for diagram and model.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Saving model in xml [message #673186 is a reply to message #673171] Sun, 22 May 2011 18:48 Go to previous message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
Ok, I think I understand. GMF generates diagram and model (or just model with diagram in XMI) to create editor. My expectations were when I chose to use one file in gmfgen ("Same file For Diagram And Model") is to have one file defined by "Diagram File Extension", much like what happens in EMF/GEF, where file is the model with EMF parts and GEF counterparts in the code.
Previous Topic:Create Connection Buttons next to shape are not working
Next Topic:how to put an SVG image in background?
Goto Forum:
  


Current Time: Thu Apr 18 06:09:12 GMT 2024

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

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

Back to the top