You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johannes Becker <jo...@gmx.net> on 2005/05/10 19:19:07 UTC
flowscript - how to replace in real java
Hi,
I'm trying to "rewrite" some flowscript (from CHS) for my java class,
but have no clue how to replace this part:
importClass(Packages.org.springframework.web.context.WebApplicationContext);
...
function getPetStore() {
var appCtx =
cocoon.context.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
petStore = appCtx.getBean("petStoreService");
return petStore;
}
...
Has someone any hints how to realize that.
Thanks
Jonny
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript - how to replace in real java
Posted by Johannes Becker <jo...@gmx.net>.
Hi,
Sébastien Arbogasts "SpringAndAuthentication"-Wikipage is up now. You
can find it at : http://wiki.apache.org/cocoon/SpringAndAuthentication
Cheers
Jonny
Wojciech Biela wrote:
>>I'll put some new page on Cocoon Wiki to make it more generic and I'll
>>notify you as soon as it's done.
>>
>>
>
>please CC the notification to the users list as well
>
>-- Wojtek Biela
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript - how to replace in real java
Posted by Wojciech Biela <il...@gmail.com>.
> I'll put some new page on Cocoon Wiki to make it more generic and I'll
> notify you as soon as it's done.
please CC the notification to the users list as well
-- Wojtek Biela
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript - how to replace in real java
Posted by Johannes Becker <jo...@gmx.net>.
Thanks a lot. I'll have a look at it as soon the page is up.
Jonny
Sebastien Arbogast wrote:
>>I'd be very thankful. I'm struggling with this for days. My email: jonnybecker@gmx.net
>>
>>
>
>I know exactly what you mean. :-P
>
>
>
>>Do your functions provide the some kind of similar functionallity as the authentication-fw?
>>
>>
>
>So far I'm not sure it does exactly everything that the authentication
>framework (or some alternative solutions like CoWarp :
>http://osoco.sourceforge.net/cowarp/) but it does the essential like
>login/logout/authorisation and I'm sure the rest is just a matter of
>adding new very simple functions.
>
>I'll put some new page on Cocoon Wiki to make it more generic and I'll
>notify you as soon as it's done.
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript - how to replace in real java
Posted by Sebastien Arbogast <se...@gmail.com>.
> I'd be very thankful. I'm struggling with this for days. My email: jonnybecker@gmx.net
I know exactly what you mean. :-P
> Do your functions provide the some kind of similar functionallity as the authentication-fw?
So far I'm not sure it does exactly everything that the authentication
framework (or some alternative solutions like CoWarp :
http://osoco.sourceforge.net/cowarp/) but it does the essential like
login/logout/authorisation and I'm sure the rest is just a matter of
adding new very simple functions.
I'll put some new page on Cocoon Wiki to make it more generic and I'll
notify you as soon as it's done.
--
Sebastien ARBOGAST
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript - how to replace in real java
Posted by Johannes Becker <jo...@gmx.net>.
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
Re: flowscript - how to replace in real java
Posted by Sebastien Arbogast <se...@gmail.com>.
> 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
--
Sebastien ARBOGAST
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript - how to replace in real java
Posted by Johannes Becker <jo...@gmx.net>.
Hi,
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.
Cheers
Jonny
Leszek Gawron wrote:
> Johannes Becker wrote:
>
>> Hi,
>>
>> I'm trying to "rewrite" some flowscript (from CHS) for my java class,
>> but have no clue how to replace this part:
>>
>> importClass(Packages.org.springframework.web.context.WebApplicationContext);
>>
>> ...
>> function getPetStore() {
>> var appCtx =
>> cocoon.context.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
>>
>> petStore = appCtx.getBean("petStoreService");
>> return petStore;
>> }
>> ...
>>
>> Has someone any hints how to realize that.
>
> what is exactly you want to achieve?
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: flowscript - how to replace in real java
Posted by Leszek Gawron <lg...@mobilebox.pl>.
Johannes Becker wrote:
> Hi,
>
> I'm trying to "rewrite" some flowscript (from CHS) for my java class,
> but have no clue how to replace this part:
>
> importClass(Packages.org.springframework.web.context.WebApplicationContext);
>
> ...
> function getPetStore() {
> var appCtx =
> cocoon.context.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
>
> petStore = appCtx.getBean("petStoreService");
> return petStore;
> }
> ...
>
> Has someone any hints how to realize that.
what is exactly you want to achieve?
--
Leszek Gawron lgawron@mobilebox.pl
IT Manager MobileBox sp. z o.o.
+48 (61) 855 06 67 http://www.mobilebox.pl
mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org