Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Generating XML presentation of my model (similar to XMI)
Generating XML presentation of my model (similar to XMI) [message #134558] Thu, 27 May 2004 08:30 Go to next message
Pekka Laukkanen is currently offline Pekka LaukkanenFriend
Messages: 6
Registered: July 2009
Junior Member
Hi,

I am thinking that how to save(export) my model in an XML format. I'm a
bit lost, though. When my GEF editor file is saved it seems to be a
serialized object graph. I was wondering how could I get hooked into
that serializing process. Basically I just want to walk through my
editParts starting from the most bottom one and create an XML dump
presenting my GEF model. What I am ultimately trying to do is to have
XMI presentation of the model.

If someone did understand what I mean and is kind enough to answer (or
give some pointer where to look for a solution) I would be highly pleased.

Cheers, Pekka
Re: Generating XML presentation of my model (similar to XMI) [message #134596 is a reply to message #134558] Thu, 27 May 2004 12:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: phil.williams.toadmail.com

Check out doSave() on the editor. That is where the serialization
happens.

You just have to replace that code with an XML writer. I have a writer
that simply walks through my model elements and converts them into their
XML representation. I then have a reader that parses the XML and builds
up a model when a file is opened.

Phil


Pekka Laukkanen wrote:

> Hi,
>
> I am thinking that how to save(export) my model in an XML format. I'm
> a bit lost, though. When my GEF editor file is saved it seems to be a
> serialized object graph. I was wondering how could I get hooked into
> that serializing process. Basically I just want to walk through my
> editParts starting from the most bottom one and create an XML dump
> presenting my GEF model. What I am ultimately trying to do is to have
> XMI presentation of the model.
>
> If someone did understand what I mean and is kind enough to answer (or
> give some pointer where to look for a solution) I would be highly
> pleased.
>
> Cheers, Pekka
>
Re: Generating XML presentation of my model (similar to XMI) [message #134661 is a reply to message #134596] Thu, 27 May 2004 19:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anonymous.zzz.net

castor.org is good XML encoder/decoder. there are other XML tools that will
fit bill.
Also, you don't want to serialize editparts, only your models.


"Phil Williams" <phil.williams@toadmail.com> wrote in message
news:c94l7o$baq$1@eclipse.org...
> Check out doSave() on the editor. That is where the serialization
> happens.
>
> You just have to replace that code with an XML writer. I have a writer
> that simply walks through my model elements and converts them into their
> XML representation. I then have a reader that parses the XML and builds
> up a model when a file is opened.
>
> Phil
>
>
> Pekka Laukkanen wrote:
>
> > Hi,
> >
> > I am thinking that how to save(export) my model in an XML format. I'm
> > a bit lost, though. When my GEF editor file is saved it seems to be a
> > serialized object graph. I was wondering how could I get hooked into
> > that serializing process. Basically I just want to walk through my
> > editParts starting from the most bottom one and create an XML dump
> > presenting my GEF model. What I am ultimately trying to do is to have
> > XMI presentation of the model.
> >
> > If someone did understand what I mean and is kind enough to answer (or
> > give some pointer where to look for a solution) I would be highly
> > pleased.
> >
> > Cheers, Pekka
> >
Re: Generating XML presentation of my model (similar to XMI) [message #134726 is a reply to message #134661] Fri, 28 May 2004 11:46 Go to previous message
Pekka Laukkanen is currently offline Pekka LaukkanenFriend
Messages: 6
Registered: July 2009
Junior Member
Thanks guys, actually it seems to be pretty easy to serialize the model
in an XML format. I went through the logic example but the input reading
point does not seem to be as obvious as the output writing (in
doSave-method) point.

My guess is that in my editor class (extended from
GraphicalEditorWithPalette) I am supposed to hook into init methods.
Well, I've got to dig more to find out the truth ;)

Cheers, Pekka


Sehyo Chang wrote:

> castor.org is good XML encoder/decoder. there are other XML tools that will
> fit bill.
> Also, you don't want to serialize editparts, only your models.
>
>
> "Phil Williams" <phil.williams@toadmail.com> wrote in message
> news:c94l7o$baq$1@eclipse.org...
>
>>Check out doSave() on the editor. That is where the serialization
>>happens.
>>
>>You just have to replace that code with an XML writer. I have a writer
>>that simply walks through my model elements and converts them into their
>>XML representation. I then have a reader that parses the XML and builds
>>up a model when a file is opened.
>>
>>Phil
>>
>>
>>Pekka Laukkanen wrote:
>>
>>
>>>Hi,
>>>
>>>I am thinking that how to save(export) my model in an XML format. I'm
>>>a bit lost, though. When my GEF editor file is saved it seems to be a
>>>serialized object graph. I was wondering how could I get hooked into
>>>that serializing process. Basically I just want to walk through my
>>>editParts starting from the most bottom one and create an XML dump
>>>presenting my GEF model. What I am ultimately trying to do is to have
>>>XMI presentation of the model.
>>>
>>>If someone did understand what I mean and is kind enough to answer (or
>>>give some pointer where to look for a solution) I would be highly
>>>pleased.
>>>
>>>Cheers, Pekka
>>>
>
>
>
Previous Topic:SelectionActions and MultiPageEditorPart
Next Topic:Proplems with MultiPageEditorPart and the PropertySheet
Goto Forum:
  


Current Time: Thu Apr 25 09:01:57 GMT 2024

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

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

Back to the top