commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Holger Haag" <hols...@herr-der-mails.de>
Subject [betwixt] Summary feature
Date Wed, 14 Jun 2006 08:36:18 GMT
Hi,

I am looking for a betwixt feature I call "summary" having found no better term.

Requirements are as follows:

A air fare list is converted to the following XML:

<fareList> 
  <fare>
    <departure code="SXF"/>
    <destination code="JFK"/>
    <price amount="123.45" currency="EUR"/>
  </fare>
  <fare>
    <departure code="SXF"/>
    <destination code="JFK"/>
    <price amount="200.45" currency="EUR"/>
  </fare>
  <fare>
    <departure code="SXF"/>
    <destination code="JFK"/>
    <price amount="323.45" currency="EUR"/>
  </fare>
</fareList

Now it happens that codes like "JFK" (JFK stands for New York John F. Kennedy aiport) are
not necessarily self-describing, and there is a lot of information related to an airport,
e.g. name, city, country, web site, weather conditions etc.

This information should also be included in the XML document, but in a separate section -
to keep the XML document smaller.

So the XML should really look like:


<fareList> 
  <fare>
    <departure code="SXF"/>
    <destination code="JFK"/>
    <price amount="123.45" currency="EUR"/>
  </fare>
  <fare>
    <departure code="SXF"/>
    <destination code="JFK"/>
    <price amount="200.45" currency="EUR"/>
  </fare>
  <fare>
    <departure code="SXF"/>
    <destination code="JFK"/>
    <price amount="323.45" currency="EUR"/>
  </fare>
  <summary>
    <airports>
      <airport>
        <code>JFK</code>
        <name>John F. Kennedy International</name>
        <city>New York</city>
        <state>New York</state>
        <country isoCode="US">United States of America</country>
      </airport>
    </airports>
  </summary>
</fareList

Such an XML structure can of course already be built via betwixt, but my application has this
kind of requirements in a couple of XML documents and I don't want to browse the object tree
for each and every bean to find out which airports are contained. 

In fact an elegant way would be to have 

(1) a bean collector which is called whenever a bean is converted to XML

(2) a summary builder which uses the collected beans to build a summary

is this (or something similar) already available in betwixt ? If not I'm willing to put some
work into and contribute the appropriate SVN patches.

Rgds
Holger
-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message