Re: [OpenMap Users] Serializing OMGraphics

From: Piotr Kamiński <>
Date: Thu, 14 Apr 2005 22:27:24 +0200


I'm glad that you successfully solved your problem. Just recently I
have found some bugs in our XML serialization code. Unfortunately
default Java XML serialization is rather difficult to debug. Also
produced files are not easily parseable by other applications. So I'm
looking for better solution (but still XML based). The examples of
  XStream's usage looks much, much better. I'd like to try this tool.
David, is it possible that you submit your changes in OMGraphics and
XML serialization code to openmap-users list?

Don, if you still think about storing OMGraphics in XML maybe this would
be better solution that mine.

I know there are other tools for JavaBeans to XML mapping/streaming.
David, I wonder why did you choose this one? Is it simpler, faster,
has better documentation, ... ?

For permanent storing of OMGraphics it would be nice to have DTD or
XMLSchema. Some of XML tools could store JavaBeans according to DTD
or XMLSchema specification. Does XStream support this?

Best regards,

David Ward napisał(a):
> Don, Piotr;
> 1. I've been successful in serializing OmGraphics using Java
> serialization to an ObjectStream and also serializing to XML.
> 2. I had to make a modification to OMGraphic so that it would serialize
> the transient "stroke" membe.. Implementing custom serialization of
> "stroke" corrected the "stroke" serialization problem for all OMGraphic
> subclasses.
> 3. OMSpline needed the natCubic and natCubicClosed transients to be
> instantiate upon deserialization.
> 4. OMText needed custom serialization/deserialization of the "font"
> member to preserve the font characteristics.
> 5. After serialization of the OMGraphic (and subclasses) was working
> with Java serialization I used Joe Walnes's XStream
> ( to serialize to/from XML. XStream work
> very well as it requires no additional coding beyond the standard Java
> serialization conventions.
> 6. In our system we store the user's graphics on an http server which
> might be accessed via a restricted bandwidth pipe. So, we compress the
> XML stream with GZIPOutputStream to reduce bandwidth consumption.
> Cheers,
> David
> Cheers,
> David
> -----------------
> David J. Ward
>> From: Piotr Kami�ski <>
>> To: David Ward <>
>> CC:,
>> Subject: Re: [OpenMap Users] Serializing OMGraphics
>> Date: Sun, 10 Apr 2005 11:54:10 +0200
>> Hi David,
>> I had the same problem when I tried to store OMGraphic created in
>> DrawingTool into file on disk. (User wanted to store his drawings and
>> load them later, just like in regular drawing program.) Serialization
>> didn't work for all OMGraphic classes. I modified some of them and it
>> helped a little. I've submitted my changes to openmap-users list
>> (
>> But after any change in OMGraphic classes (new field, method, etc.)
>> my stored files could not be loaded any more - this is due to default
>> serialization feature - serial id.
>> In my opinion OMGraphic *should* serialize properly and problems you
>> wrote about should be fixed. Here Don is a person which decide what to
>> do with this.
>> I don't know what exactly mean 'later' in your case. If it is short
>> time and you are not planning to permanently store created graphics,
>> simple serialization should work for you.
>> If you want to store your graphics for longer time (just as I wanted)
>> I would recommend using Java 1.4 XML storing mechanism. I will send
>> you another letter which contains some code which might help you. This
>> is a library which I used to store OMGraphic now instead of simple
>> serialization.
>> Hope this helps,
>> Piotr Kaminski
>> David Ward napisa�(a):
>>> I'm trying to preserve OMGraphics by serializing them to a stream
>>> which is stored on a server and later retrieved.
>>> It appears that the OMGraphics don't serialize all of their members
>>> necessary to properly reconstitute the graphic. Specifically the
>>> stroke is not serialized with the OMGraphic because stroke is
>>> declared as transient.
>>> Is there a technique to fully serialize the OMGraphics?
>>> Cheers,
>>> David
>>> -----------------
>>> David J. Ward
>>>> From: "Ellwein, Brent A" <>
>>>> To:
>>>> Subject: [OpenMap Users] Minimum zoom
>>>> Date: Wed, 6 Apr 2005 11:18:28 -0600
>>>> All,
>>>> It seems like there is only so far that OpenMap will allow me to zoom
>>>> out. After some cutoff point (which I haven't exactly determined yet)
>>>> why can I not make the map any smaller? Maybe I'm doing something
>>>> wrong.
>>>> Thanks,
>>>> Brent
>>> --
>>> [To unsubscribe to this list send an email to ""
>>> with the following text in the BODY of the message "unsubscribe
>>> openmap-users"]
>> --
>> [To unsubscribe to this list send an email to ""
>> with the following text in the BODY of the message "unsubscribe
>> openmap-users"]

[To unsubscribe to this list send an email to ""
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Apr 14 2005 - 16:29:10 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:06 EDT