Generating XML presentation of my model (similar to XMI) [message #134558] |
Thu, 27 May 2004 04:30  |
Eclipse User |
|
|
|
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 07:46  |
Eclipse User |
|
|
|
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
>>>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03836 seconds