cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist ...@wrinkledog.com>
Subject Re: How can i activate XSP in cocoon-2.2 ?
Date Sat, 13 Sep 2008 03:56:10 GMT

On Sep 12, 2008, at 8:53 AM, hussayn wrote:

> well, i am now quite a few steps further. Sometimes when you dig and  
> dig,
> you miss
> the obvious. Now i understood, that the flow-script is indeed  
> javascript,
> but it only
> regulates the when which page will be called, yes server side, and  
> no, thats
> not where
> the business logic is placed, tht is in the jx-templates served by the
> JXTemplateGenerator

Actually no.  Business logic doesn't belong anywhere near JXTemplates.

> (this is what you mean by "template block"? ).

yes

>  Well, it looks, like there
> finally i get the
> bridge to my java stuff...

Flowscript should be the bridge to your Java stuff (the business  
logic).  You use flowscript to program the controller layer.

> So i expect now, that i can feed my java based backend into the
> JXTemplateGenerator

No, not directly.  Flowscript calls your Java backend objects and  
injects data from them into the presentation templates via calls to  
cocoon.sendPage().  (The sendPage() is called on some resources that  
maps to a pipeline that starts with JXTemplateGenerator).

> and that is
> almost where i want to get... The last bit i need is, how to  
> introduce my
> own classes.
>
> I guess it is sufficient to pack them into a jar file and then  
> simply adress
> them out of the *.jx files ?

No, call them from flowscript.

> My classes already conform to beans, so they have getters and  
> setters. is
> that enough ?

I don't know, I guess it depends, see below.

> or do i have to register my classes as beans to spring ? well... i  
> will see
> ;-)

I like to use Spring to create a "services layer" object.  Spring  
takes care of all the plumbing and initialization and finding things  
or whatever has to happen to get that services layer fired up at  
initialization time (e.g., the first time the flowscript is invoked).   
Flowscript asks Spring for the services layer bean and then calls its  
methods.

HTH/cheers,

—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message