Hi, Meanwhile I have built an inputmodule that gets the login ID (and other user info) from the authentication manager and feeds it as an attribute to the modular database actions. You can find the source at http://www.datagram.nl/AuthAttributeModule.java
Configure: 1) put the compiled class in cocoon/WEB-INF/classes/nl/datagram/cocoon/components/modules/input 2) add a line to the cocoon.xconf: <component-instance class="nl.datagram.cocoon.components.modules.input.AuthAttributeModule" logger="core.modules.input" name="j-auth"/> 3) Your db descriptor file must look like: <root> <connection>survey</connection> <table name="t_consult" alias="t_consult"> <keys> <key name="userid" type="string" autoincrement="false"> <mode name="j-auth" parameter="ID" type="others"/> </key> </keys> etc... This will e.g. do a select query on the database "select * from t_consult where userid=ID", where ID is your login ID. This will only work with the modular database actions of 2.1. See the latest docs on modules and database actions. Hugo [EMAIL PROTECTED] -----Original Message----- From: Ralph Rauscher [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 1:45 AM To: [EMAIL PROTECTED] Subject: Re: Authentication framework (sunshine in 2.0.3) and modular database actions hi, ...sorry, no answer to your question! i'm having a similar problem, but i'm still stuck at a lower level. i want to use the result ID of an authentication by the sunrise framework for a database query, using xsp. you said you've found a way to access the ID using org.apache.cocoon.webapps.session.components.SessionManager. is there a simple way to get the ID, say, in a string using java? i would very appreciate your help, since i can't get the cocoon source to go through it myself right now - good old modems... ;) ralph ----- Original Message ----- From: "Hugo Burm" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 17, 2002 8:36 PM Subject: Authentication framework (sunshine in 2.0.3) and modular database actions > Hi, > > I am running 2.1 dev. I want to feed the result ID of an authentication by > the authentication framework, into a database query. > > I made my own subclass of the non-modular DataseSelectAction and by using > org.apache.cocoon.webapps.session.components.SessionManager, I could find > the authentication ID in a sessioncontext and feed it to the select query. > This is working ok, but it is not an elegant solution because I have to > modify all database actions and keep them up to date with the current cvs > version. And these guys are writing code faster than I can compile. > > A better solution would be to use the modular database actions. And feed the > authentication ID into the database action by an input module. In this way I > could use the unmodified database actions. > > I succeeded configuring the input module for "request". But I need one of > two other modes: > > 1) Sitemap parameter. Can I use a sitemap parameter as the input for an > input module? How? This sounds trivial, but I could not find out how. > > 2) Ideally, I would feed the session context, set up by the authentication > framework, directly into the database query via the "session" input module. > I could not find an easy way. It looks like I have to map the xml structure > of the authentication context, which is stored into the session somehow, > into a simple session attribute. So this looks like I have to write my own > input module. I can do that, but any feedback that could point me to the > right direction would be welcome. > > > Thanks > > Hugo > [EMAIL PROTECTED] > > --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>