Tim,

why don't you consider droping your custom generator in favor of the CastorTransformer 
? Castor is - amongst other 
things - an XML binding framework that allows you un/marshall arbitrary obejct 
hierarchies to/from XML. In other 
words, you'd still use your actions to make the actual EJB call and have the data 
returned to you. 

But rather than stuffing them into a HashMap and have your custom generator produce 
the SAX events off this data, 
I'd bind the object (hierarchy) returned into teh HttpRequest or the HttpSession and 
have the CastorTransformer 
marshall the object(s) to XML. All that is required - that is, if you are not pleased 
by the default marshalling provided 
out of the box - is a binding file that defines simple rules how the XML should look 
like (rather than relying on 
reflection to derive the names of the XML elements/attributes).

Werner

On Wed, 10 Sep 2003 00:29:02 +0200, Christoph Gaffga wrote:
On Tue, 9 Sep 2003 16:21:26 -0400, Tim Olson wrote:

>to get EJBs into cocoon, we have a custom Action / Generator pair.  the
>action can be configured to make any EJB call (uses reflection) and stuff
>the results into a HashMap.  the custom generator then sends that hashmap
>through Castor to generate SAX events.  it's very nice, since we can turn
>any series of ejb calls into XML data with just a few lines of sitemap code.
>note: remote interfaces are tricky to castorize so use the value object (aka
>data transfer object) pattern.
>
>we eschewed flow scripts and wrote our own action engine, but i should post
>separately about that.
>
>
>> -----Original Message-----
>> From: Bastian Breithaupt [mailto:[EMAIL PROTECTED]
>> Sent: Monday, September 08, 2003 5:33 PM
>> To: [EMAIL PROTECTED]
>> Subject: EJB + Cocoon, "Best Practices"
>> 
>> 
>> Hi!
>> 
>> I would like to set up a Model2 application with Cocoon end 
>> EJBs. Cocoon would be the presentation layer (also the 
>> controller layer?) and the business logic would be 
>> represented by the EJBs. (?)
>> 
>> Are there any "Best Practices" for Cocoon working with EJBs? 
>> (suggestions, links, publications, documentation, ...)
>> 
>> I suppose, calling the EJB-API is done by Cocoon-Actions...? 
>> (for example by using business delegation pattern)
>> 
>> When using flow scripts, does it make sense to use actions? 
>> (how mature is flow script?)
>> 
>> Any help, hint, link, ... is appreciated.
>> 
>> Thank you in advance,
>> 
>> Bastian
>> ______________________________________________________________
>> ________________
>> 38xTestsieger - WEB.DE FreeMail - Deutschlands beste E-Mail
>> Jeden Monat mit 10% mehr Leistung! http://f.web.de/?mc=021138
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>





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

Reply via email to