Announcement Announcement Module
Collapse
No announcement yet.
converting actionscript object to XML Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • converting actionscript object to XML

    Hi,

    I am very new to this spring actionscript project.
    I am able to convert the object configured using application context xml into an actionscript object but how do I convert it back into the same xml that I got it from initially.
    Any help is appreciated.
    Thanks.

  • #2
    how exactly?

    hi,

    can you explain your use-case a little bit more in-depth? The XML, namely, is parsed only once at initialization and used to create ObjectDefinition instances, these are the objects that describe how the container will have to create and configure the instances that it manages.
    There is no real method for converting an instance *back* to the XML representation of its corresponding ObjectDefinition, you'd have to write that yourself.
    Can you explain in what kind of situation you need this functionality?

    cheers,

    Roland
    Last edited by 666shooter; Jul 14th, 2009, 09:49 AM.

    Comment


    • #3
      back to Configuration XML

      My Scenario is that I have some application preferences in global prefs xmls and User preferences in user prefs xmls.
      These xmls are are right now read only when using spring action script...meaning I can get the global and user prefs objects. When the user or application prefs are changed in the UI, I want a parser to write the object modifications back into the xmls.

      So I was wondering if spring actionscript already has some features in place for doing this. Apparently its not and I am writing my own parser for my application now.
      I have come upto a stage where my parser can write primitive types and I am working towards nested types and more complex type objects now.
      If you know of any such app already in existence that can rewrite those prana xmls, let me know.It would be great help.

      Thanks,

      Comment


      • #4
        alright

        Hi there,

        I understand your situation a little better now indeed, and no, I'm afraid Spring Actionscript doesn't have any generic methods for XML serialization.
        For SpringAS its a one-way thing, object definitions are de-serialized and instantiated, that's it, there's no way back to XML.

        Writing your own implementation for this shouldn't be too hard though, especially if you use the as3common-reflect library I'm sure it wouldn't be too hard to build a generic solution.

        You can check out the reflect lib here: as3-commons-reflect

        Good luck, and if you have any more questions, good ahead and ask

        cheers,

        Roland

        Comment


        • #5
          value of read only argument in a constructor

          I am so far able to write the primitive type property and nested classes and constructor-args. However if I am initialising a property that is read only through a constructor argument when creating the object, I am not able to get that value back to the prana xml.
          Do any of you know how to get the value of the constructor arg in general if not for a read only property ?

          Thank you.

          Comment


          • #6
            ehmm

            If the property is read-only than I'm not sure what the problem is, just retrieve the value directly from the property and use that for constructor argument serialization, its hard to make that generic though...
            I can only imagine that you run into real trouble with write-only properties.

            Or do I misunderstand?

            Comment

            Working...
            X