RE: Authentication framework (sunshine in 2.0.3) and modular database actions

2002-09-21 Thread Hugo Burm

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
  connectionsurvey/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]




Re: Authentication framework (sunshine in 2.0.3) and modular database actions

2002-09-18 Thread Ralph Rauscher

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]



-
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]




Re: Authentication framework (sunshine in 2.0.3) and modular database actions

2002-09-17 Thread Antonio Gallardo Rivera

Nice question! Its very hairy! :)

I resolved it using this sitemap:

!--Paginas HTML de Base de Datos --
  map:match pattern=*-*.html
map:act type=auth-protect
map:parameter name=handler value=agshandler/

!-- catálogos --
map:match pattern=*-*.html

!-- Crear --
map:match type=request-parameter 
pattern=cocoon-action-Crear
map:act action=crear type=form-validator
map:parameter name=descriptor 
value=docs/{../1}-form.xml/
map:parameter name=validate-set value=add/
map:act type=dbAdd
map:parameter name=descriptor 
value=docs/{../../1}-form.xml/
map:parameter name=validate-set value=add/
map:generate src=docs/{../../../1}-confirm.xsp 
type=serverpages/
map:transform src=stylesheets/agssa.xsl/
map:serialize/
/map:act
/map:act
/map:match

!-- Actualizar --
map:match type=request-parameter 
pattern=cocoon-action-Guardar
map:act action=actualizar type=form-validator
map:parameter name=descriptor 
value=docs/{../1}-form.xml/
map:parameter name=validate-set value=update/
map:act type=dbUpd
map:parameter name=descriptor 
value=docs/{../../1}-form.xml/
map:parameter name=validate-set value=add/
map:generate src=docs/{../../../1}-confirm.xsp 
type=serverpages/
map:transform src=stylesheets/agssa.xsl/
map:serialize/
/map:act
/map:act
/map:match

!-- Borrar --
map:match type=request-parameter 
pattern=cocoon-action-Borrar
map:act action=borrar type=dbDel
map:parameter name=descriptor 
value=docs/{../1}-form.xml/
map:generate src=docs/{../../1}-confirm.xsp 
type=serverpages/
map:transform src=stylesheets/agssa.xsl/
map:serialize/
/map:act
map:generate src=docs/{1}-{2}.xsp type=serverpages/
map:transform src=stylesheets/agssa.xsl/
map:serialize/
/map:match

!-- Todo lo demás --
map:match pattern=*-*.html
map:generate src=docs/{1}-{2}.xsp type=serverpages/
map:transform src=stylesheets/agssa.xsl/
map:serialize/
/map:match

   /map:match
/map:act
  /map:match

I know this is not the best, but it works! ;) The problem with actions-set in 
2.1 is resolved in this way. Just get the lastest CVS.

BTW, I call (like in the tutorial) this sitemap with cli-crear.html

cli = clients (a table or form)
crear = create (an action)

I hope it can helps you.

Regards,

Antonio Gallardo.

El Martes, 17 de Septiembre de 2002 12:36, Hugo Burm escribió:
 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