I agree Gareth. It isn't as straightforward as i thought. I tried using the getFieldnames() function
but this isn't a member function of the BaseObject. Besides for objects related by foreign keys the
naming isn't easy and there isn't a way to get the members of those objects.
I wonder if Torque should include getFieldNames() and getForeignKeyNames() as member functions
of the BaseObject. The former one needs to be made non-static and th latter one needs to be added.

For now i'm going with the approach of generating my own data-Bean (for now handcoded)
and using PropertyUtils to copy the properties. Then i am using JOX to generat XML.

-vasan

Gareth Boden wrote:

I'd be interested to see this. The reason I got Torque to generate the
'properties of interest' stuff (in the getElementDescriptor() method) is
that I couldn't see a way for an external class to get the mapping
between field name/XML element name and java method name once the Torque
objects were built. I've run up against that problem a few times in
other circumstances too..

G.

----------
From: Rags Srinivasan
Reply To: Turbine Torque Users List
Sent: Tuesday, November 26, 2002 0:35 AM
To: Turbine Torque Users List
Subject: Re: retrieving objects as XML


Gareth
I Looked at your solution. I think IMO it is not necessary to add this

toXML() to classes especially
changing DTD to accomodate this.
It should be possible to achieve exactly the same thing by having another XMLSerializer class do this.
It should be possible to use the solution w/o changing existing implementations.
For instance what if people already have an XML
serializer/deserializer that works on beans and
jsut want to use that with Torque data objects?
For instance, I used JOX (www.wutka.com/jox) which serializes and deserializes beans.
The only problem it is so generic that it takes every "get" method and

generates XML elements.
I am changing JOX to pass in an array of properties of interest .

-vasan
Gareth Boden wrote:


I have now.. but the interface confused me and I managed not to add

the

third attachment and can't see a way to add it now. So it can be

found

in the previously mentioned e-mail, if anyone knows how to add it...

G.




----------
From: Rodney Schneider
Reply To: Turbine Torque Users List
Sent: Tuesday, November 19, 2002 0:33 AM
To: Turbine Torque Users List
Subject: Re: retrieving objects as XML

On Mon, 18 Nov 2002 21:14, you wrote:


I posted some patches on September 19th (subject was "Re: Is torque
dying?") to do this sort of thing using Betwixt.


Hi Gareth,

Have you submitted these patches to Scarab? This way they won't get

forgotten about.

-- Rodney

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>






--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>







Reply via email to