I know you've asked this for some time, but I found your post just 
recently.

Well, I am using JBoss/tomcat (catalina)/cocoon2 also, and I've used a 
very simple scheme so far, but it works great, and could be generalized 
very easily.

Regarding J2EE, I'm akin to using the fa�ade pattern when it comes to 
querying the data, and CMP Beans only when I really need to. That's 
because, as you know, CMP Beans use RMI to set/get their values and 
that's of course very, very, very, slow. The fa�ade pattern is a session 
bean that provides value objects to get access the J2EE-managed data; 
there I'm using plain SQL to get things even faster. A fa�ade can also 
have some data storing methods, but that's not their main purpose.

Now, the EJB->XML conversion takes place in a logic sheet where I'm 
using the standard xsp mechanisms to create the XML, eg:

Data [] myData = facade.getData ( request.getParameter ( "foo" ) );

<data>
<xsp:logic>
   for ( int i=0; i &lt; myData.length; i++ ) {
     <entry>
       <xsp:attribute name="att1"><xsp:expr>myData[i].getAtt1 
()</xsp:expr></xsp:attribute>
       <xsp:attribute name="att2"><xsp:expr>myData[i].getAtt2 
()</xsp:expr></xsp:attribute>
     </entry>
   }
</xsp:logic>
</data>

In fact, the <xsp:logic> part could be automatized with introspection, 
and embedded in the logicsheet with a custom tag (though I've not done 
that, I'm pretty sure it's feasible).

The xsp-generated code is very efficient, and this solution has the 
advantage of being simple, cocoon-only and rather flexible.

Well anyway, I think this comes all a little too late, doesn't it ?

Candide

Le mardi 20 novembre 2001, � 07:52 PM, Jozsa Kristof a �crit :

> Sorry for being slightly offtopic. I'm developing a J2EE application (my
> diplom work, not a commercial project), and I'm using Cocoon for web/wap
> output.
>
> I'm using the JBoss application server, and looking for a suitable way 
> for
> converting business data coming from my CMP entity beans into XML to be 
> able
> to pass it to Cocoon. I'm trying to use Castor XML directly on my entity
> beans at the moment, but without any success so far. Is there any other,
> maybe easier / more natural solution for doing that work? Maybe anyone 
> has
> did such successfully in the past, and can show me any piece of example 
> code
> for that?
>
> I can post my tries and failures with Castor privately if someone's 
> familiar
> with that topic..
>
> Thanks much,
>
> Christopher
> --
> .Digital.Yearning.for.Networked.Assassination.and.Xenocide
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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

Reply via email to