You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <vg...@hns.com> on 2001/07/27 20:57:22 UTC

DatabaseAuthenticatorAction and other Database*Actions

Two questions about database actions:

1) I have got a suggestion to use PreparedStatement in DatabaseAuthenticatorAction,
and it makes sence because all other database actions already using it.
Is there any problems with this change?

2) Database actions take column values from request parameters or request attributes.
There is a suggestion to obtain values from request methods, like getServerName or
getRemoteHost, etc.


Vadim

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


RE: DatabaseAuthenticatorAction and other Database*Actions

Posted by Vadim Gritsenko <vg...@hns.com>.
> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: Friday, July 27, 2001 3:03 PM
> To: cocoon-dev@xml.apache.org
> Subject: Re: DatabaseAuthenticatorAction and other Database*Actions
> 
> 
> Vadim Gritsenko wrote:
> > 
> > Two questions about database actions:
> > 
> > 1) I have got a suggestion to use PreparedStatement in DatabaseAuthenticatorAction,
> > and it makes sence because all other database actions already using it.
> > Is there any problems with this change?
> 
> No problem at all.  The DatabaseAuthenticatorAction also is the least tested of all
> the Database*Actions.

Cool.


> 
> > 2) Database actions take column values from request parameters or request attributes.
> > There is a suggestion to obtain values from request methods, like getServerName or
> > getRemoteHost, etc.
> 
> How do you propose to specify them in the configuration file?

Right now auth action uses different descriptor format then other db actions...
Thinking about common syntax for all actions, I can suggest something like this:

<employee>
  <connection>personnel</connection>
  <table name="employee_table">
...
      <!-- authenticate against username column using request.getParam("username") -->
      <value auth-request-param="username" dbcol="name" type="string"/>
      <!-- ...and server_name column using request.getServerName() -->
      <value auth-request-method="getServerName" dbcol="server_name" type="string"/>
...
  </table>
</employee>

Other suggestions on syntax are welcome - I'm not sure how it should look like.

Another though about descriptor: 
Right now auth action's descriptor have "to-session" attribute to propagate values into session.
Select action and Auth action can make use of this attribute:

      <!-- get skin to session -->
      <value session-param="skin" dbcol="skin" type="string"/>

Then, param attribute:
      <value param="department" dbcol="department_id" type="int"/>
Might be renamed as request-param:
      <value request-param="department" dbcol="department_id" type="int"/>

What do you think?


Vadim


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


Re: DatabaseAuthenticatorAction and other Database*Actions

Posted by Berin Loritsch <bl...@apache.org>.
Vadim Gritsenko wrote:
> 
> Two questions about database actions:
> 
> 1) I have got a suggestion to use PreparedStatement in DatabaseAuthenticatorAction,
> and it makes sence because all other database actions already using it.
> Is there any problems with this change?

No problem at all.  The DatabaseAuthenticatorAction also is the least tested of all
the Database*Actions.

> 2) Database actions take column values from request parameters or request attributes.
> There is a suggestion to obtain values from request methods, like getServerName or
> getRemoteHost, etc.

How do you propose to specify them in the configuration file?

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