cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Becker <jonnybec...@gmx.net>
Subject Re: flowscript - how to replace in real java
Date Tue, 10 May 2005 20:06:29 GMT
Hi,

> If you're interested I can give you my functions and you'll see authentication 
> framework is not compulsory when using Spring.
I'd be very thankful. I'm struggling with this for days. My email: jonnybecker@gmx.net

Do your functions provide the some kind of similar functionallity as the authentication-fw?


Thanks
Jonny




Sebastien Arbogast wrote:

>>I'm trying to combine the CHS (Cocoon + Hibernate + Spring) example with
>>the authentication-fw.
>>
>>For example:
>>User comes and has to login -> only after succesful login he is able to
>>see the products and shop -> ...
>>
>>Since the CHS has its own datasource and sessionfactory I want to
>>"reuse" them for my authentication.
>>
>>          I want to use a java class as the authentication resource, like:
>>
>><authentication authenticator="com.MyAuthenticator"/>
>>
>>My problem is that I don't know how to use the datasource and sessionfactory from
CHS >in this context.
>>    
>>
>
>I've tried to do that at the beginning but it has proven to be more
>difficult than necessary. If you manage your users and authentication
>data inside the Spring layer it's very easy to write a few flowscript
>functions to do that in association with session framework. If you're
>interested I can give you my functions and you'll see authentication
>framework is not compulsory when using Spring.
>
>As for your first question, you have nothing to really adapt, except
>the service bean name. For example if you have a shopService bean,
>it's gonna be something like that:
>
>var shop;
>
>function getShop(){
>  if (shop == null){
>    var appCtx =
>cocoon.context.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
>//This line refers to the application context you've defined in
>web.xml
>  shop = appCtx.getBean("shopService");
>  return shop;
>}
>
>And then each time you need to access your shop, you call getShop()
>first to be sure the variable is initialized and you can use it as any
>bean.
>
>Good luck
>
>  
>


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


Mime
View raw message