cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hed" <hed4s...@interia.pl>
Subject Re: Authentication context and modular database action.
Date Fri, 12 Dec 2003 01:27:38 GMT
> I am using a ModularDatabaseAction to insert a row into a database.
> Everything is working fine as most of the field values are available
> as request parameters.However I also need to store a value that is
> stored in the authentication context.
> I am sure that writing my own InputModule for this is overkill as the
> information is available already.
>

I've had the same problem a couple days ago.
I think that I've found a bug in this module - it doesn't use a parameter
name correctly.
So I've write my own - and now everything's ok.
simply, I've redefined getAttribute method:

public Object getAttribute(String name,
Configuration modeConf,
Map objectModel)
throws ConfigurationException {
if ( name == null ) {
return null;
}
if ( modeConf != null ) {
name = modeConf.getAttribute( "parameter", name );
// preferred
name = modeConf.getChild("parameter").getValue(name);
}
return super.getAttribute(name,modeConf,objectModel);
}

>
> 1). Is it possible to access the authentication context using the
> session-context InputModule in the database descriptor ?
>
> ie
>
> <value name="fieldname"  type="int">
> <mode name="session-context">
> <parameter>authentication/authentication/ID</parameter>
>           </mode>
> </value>
>
>
> note: I tried this and it didn't work.The IDs value is available in the
> sitemap using the same input module

it is correct, theoretically (but doesn't work cause of the bug)

regards
hed




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


Mime
View raw message