db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Hodgkinson <a...@softxs.ch>
Subject Emitting XML from Torque OM classes
Date Tue, 07 Jan 2003 18:24:41 GMT

Dear All,

I have a requirement to be able to emit XML output from 
my Torque objects. I'd like this to be a normal part of
all my Torque based objects.

Ideally, what I would like is to be able to get XML strings 
from Torque objects. E.g. have methods in the generated 
classes like:

  public class BaseMytable {
    public String toXML() {...}

The XML it returns would look (something) like

  <Mytable>
    <field1>value1</field1>
    <field2>value2</field2>
    ...
  </Mytable>

0. Is this being implemented or is it already implemented?

1. The toXML methods should be generated. Where in the Torque
   classes would be the best place to add it? (I'm assuming
   that that would become a new torque 'feature') 

2. Is BaseMytable the best place for the generator to place 
   the toXML method (as opposed to the other generated classes)?

3. I'd also like to extend this to be able to include (recursively)
   the XML of tables (torque objects) referenced by foreign keys.
   This might be via a separate method toExtendedXML (perhaps
   with a more suitable method name).

4. It would be nice to have the Peer classes also be able to
   turn a Result set for their table to XML, but I don't know
   enough of the semantics of the Base classes to know if this 
   is the right approach. Any suggestions?

I'd be interested in your thoughts, encouagement and particaularly 
hints (or even a road map of) about the Torque classes I should 
use/study/extend in order to implement this.

Many thanks in advance:

Alan.

P.S. The long term goal is to use it in conjunction with Cocoon.

Mime
View raw message