You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Leona Slepetis <le...@gorillacommunications.com> on 2002/06/27 22:35:41 UTC

null pointer passed as base exception

Hi All,

I have part of  a pipeline that looks like this:

    <map:match pattern="matrix">
      <map:generate src="gs.xml"/>
      <map:transform src="gs.xsl">
        <map:parameter name="pagename" value="matrix"/>
        <map:parameter name="dealID" value="{1}"/>
        <map:parameter name="playerID" value="123"/>
        <map:parameter name="matrixfile" value="{3}"/>
        <map:parameter name="projectname" value="{4}"/>
      </map:transform>
      <map:transform src="default-html.xsl"/>
      <map:serialize type="html"/>
    </map:match>

In gs.xml I have:

<application>
  <page name="matrix"/>
<!-- some other stuff that doesn't matter in this example -->
</application>

In gs.xsl I have:

  <xsl:template match="application">
    <xsl:if test="not($pagename)">
      <xsl:apply-templates select="page[@name='default']"/>
    </xsl:if>
    <xsl:if test="$pagename">
      <xsl:apply-templates select="page[@name=$pagename]"/>
    </xsl:if>
  </xsl:template>

And default-html.xsl has:

  <xsl:template match="page">
    <html>
      <head>
        <title>title</title>
      </head>
      <body>
        <xsl:apply-templates/>
      </body>
    </html>
  </xsl:template>

I get to it by calling
http://localhost:8080/GS/matrix?dealID=1001&playerID=&matrixfile=file:///D:/
matrix.xml&projectname=new

When I run it, the following error occurs:
Could not read resource file:/D:/tomcat/webapps/GS/gs.xml

org.apache.cocoon.ProcessingException: Could not read resource
file:/D:/tomcat/webapps/GorillaStation/gs.xml: java.lang.RuntimeException:
java.lang.IllegalArgumentException: Null pointer passed as base

One thing I notice is that playerID is not set to the value '123'. Why is
this?
The other thing is that if I take out    <map:parameter name="pagename"
value="matrix"/>  from the pipeline it works
according to the default logic in <xsl:application>.

There doesn't appear to be anything wrong with gs.xml; it was working under
C1.
Other pipeline segments using the parameter "pagename" work just fine, such
as:

    <map:match pattern="summary">
      <map:generate src="gs.xml"/>
      <map:transform src="gs.xsl">
        <map:parameter name="pagename" value="summary"/>
      </map:transform>
      <map:transform src="default-html.xsl"/>
      <map:serialize type="html"/>
    </map:match>

Can anyone give me a clue as to what is wrong?

Thanks very much,
Leona


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: null pointer passed as base exception

Posted by KOZLOV Roman <r-...@opencascade.com>.
Hello Leona,

Where do you define {1}, {3} and {4} in your pipeline?
IMO it should be like this:

    <map:match pattern="matrix">
      <map:generate src="gs.xml"/>
      <map:transform src="gs.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
          <map:parameter name="pagename" value="matrix"/>
          <map:parameter name="playerID" value="123"/>
      </map:transform>
      <map:transform src="default-html.xsl"/>
      <map:serialize type="html"/>
    </map:match>

Here you say to transformer to use request parameters by setting
"use-request-parameters" to true.
Then in your xsl you can get parameters' values by means of the following
top-level elements:
<xsl:param name="dealID"/>
<xsl:param name="matrixfile">default_value</xsl:param>
...
and then you can use them as variables, like "$dealID".

PS: It seems that in this case you need not lines with extra "pagename" and
"playerID" definition in your sitemap.

Best regards,
Roman

Leona Slepetis wrote:

> Hi All,
>
> I have part of  a pipeline that looks like this:
>
>     <map:match pattern="matrix">
>       <map:generate src="gs.xml"/>
>       <map:transform src="gs.xsl">
>         <map:parameter name="pagename" value="matrix"/>
>         <map:parameter name="dealID" value="{1}"/>
>         <map:parameter name="playerID" value="123"/>
>         <map:parameter name="matrixfile" value="{3}"/>
>         <map:parameter name="projectname" value="{4}"/>
>       </map:transform>
>       <map:transform src="default-html.xsl"/>
>       <map:serialize type="html"/>
>     </map:match>
>
> In gs.xml I have:
>
> <application>
>   <page name="matrix"/>
> <!-- some other stuff that doesn't matter in this example -->
> </application>
>
> In gs.xsl I have:
>
>   <xsl:template match="application">
>     <xsl:if test="not($pagename)">
>       <xsl:apply-templates select="page[@name='default']"/>
>     </xsl:if>
>     <xsl:if test="$pagename">
>       <xsl:apply-templates select="page[@name=$pagename]"/>
>     </xsl:if>
>   </xsl:template>
>
> And default-html.xsl has:
>
>   <xsl:template match="page">
>     <html>
>       <head>
>         <title>title</title>
>       </head>
>       <body>
>         <xsl:apply-templates/>
>       </body>
>     </html>
>   </xsl:template>
>
> I get to it by calling
> http://localhost:8080/GS/matrix?dealID=1001&playerID=&matrixfile=file:///D:/
> matrix.xml&projectname=new
>
> When I run it, the following error occurs:
> Could not read resource file:/D:/tomcat/webapps/GS/gs.xml
>
> org.apache.cocoon.ProcessingException: Could not read resource
> file:/D:/tomcat/webapps/GorillaStation/gs.xml: java.lang.RuntimeException:
> java.lang.IllegalArgumentException: Null pointer passed as base
>
> One thing I notice is that playerID is not set to the value '123'. Why is
> this?
> The other thing is that if I take out    <map:parameter name="pagename"
> value="matrix"/>  from the pipeline it works
> according to the default logic in <xsl:application>.
>
> There doesn't appear to be anything wrong with gs.xml; it was working under
> C1.
> Other pipeline segments using the parameter "pagename" work just fine, such
> as:
>
>     <map:match pattern="summary">
>       <map:generate src="gs.xml"/>
>       <map:transform src="gs.xsl">
>         <map:parameter name="pagename" value="summary"/>
>       </map:transform>
>       <map:transform src="default-html.xsl"/>
>       <map:serialize type="html"/>
>     </map:match>
>
> Can anyone give me a clue as to what is wrong?
>
> Thanks very much,
> Leona
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Form Validator

Posted by Eric Dalquist <eb...@mtu.edu>.
Thanks for the detailed example. It gives me a good alternative if the
DBAuth SessionValidator stuff falls through. I think I might look into the
DatabaseAuthenticatorAction class and see how it does things for the
PASSWORD() stuff.

-Eric Dalquist

----- Original Message -----
From: "Tim Myers" <ph...@stserv.hcf.jhu.edu>
To: "Eric Dalquist" <eb...@mtu.edu>
Sent: Monday, July 01, 2002 11:41 AM
Subject: Re: Form Validator


>
>
> On Mon, Jul 01, 2002 at 08:56:18AM -0400, Eric Dalquist wrote:
> > Tim,
> >     Could I get an example of how you would set your sitemap up to use
the
> > XSP you attached?
>
> Hi Eric,
>
> This is probably more than you wanted to see,
>
> my directory layout is a little like this:
>
> shortcourses/
>   sitemap.xmap
>   xsp/
>     action/
>       authenticate.xsp
>       permissions.xsp
>     admin/
>       login.xsp
>       menu.xsp
>     signup.xsp
>     index.xsp
>
> in the components/actions section:
>
>     <map:action name="xsp-action"
src="org.apache.cocoon.acting.ServerPagesAction"/>
>
> in the pipeline:
>
>     <map:match pattern="admin/*">
>       <map:act type="req-params">
>         <map:parameter name="parameters" value="login"/>
>         <map:act type="session-invalidator"/>
>         <map:act type="xsp-action" src="xsp/action/authenticate.xsp">
>           <map:act type="xsp-action" src="xsp/action/permissions.xsp">
>             <map:parameter name="permissions" value="sc_admin"/>
>             <map:generate src="xsp/admin/{../../../1}"
type="serverpages"/>
>             <map:transform src="../stylesheets/page2html.xsl"/>
>             <map:transform src="../stylesheets/html/content.xsl"/>
>             <map:serialize/>
>           </map:act>
>         </map:act>
>         <map:generate src="xsp/admin/login.xsp" type="serverpages"/>
>         <map:transform src="../stylesheets/page2html.xsl"/>
>         <map:transform src="../stylesheets/html/content.xsl"/>
>         <map:serialize/>
>       </map:act>
>
>       <map:act type="req-params">
>         <map:parameter name="parameters" value="logout"/>
>         <map:act type="session-invalidator"/>
>       </map:act>
>
>       <map:act type="xsp-action" src="xsp/action/permissions.xsp">
>         <map:parameter name="permissions" value="sc_admin"/>
>         <map:act type="xsp-action" src="xsp/action/dateformat.xsp"/>
>
>         <map:act type="req-params">
>           <map:parameter name="parameters" value="mod-db-add table-set"/>
>           <map:act type="mod-db-add">
>             <map:parameter name="table-set" value="{table-set}"/>
>           </map:act>
>         </map:act>
>
>         <map:act type="req-params">
>           <map:parameter name="parameters" value="mod-db-upd table-set"/>
>           <map:act type="mod-db-upd">
>             <map:parameter name="table-set" value="{table-set}"/>
>           </map:act>
>         </map:act>
>
>         <map:act type="req-params">
>           <map:parameter name="parameters" value="mod-db-del table-set"/>
>           <map:act type="mod-db-del">
>             <map:parameter name="table-set" value="{table-set}"/>
>           </map:act>
>         </map:act>
>
>         <map:generate src="xsp/admin/{../1}" type="serverpages"/>
>         <map:transform src="../stylesheets/page2html.xsl"/>
>         <map:transform src="../stylesheets/html/content.xsl"/>
>         <map:serialize type="html"/>
>       </map:act>
>
>       <map:act type="session-invalidator"/>
>       <map:generate src="xsp/admin/login.xsp" type="serverpages"/>
>       <map:transform src="../stylesheets/page2html.xsl"/>
>       <map:transform src="../stylesheets/html/content.xsl"/>
>       <map:serialize/>
>
>     </map:match>
>
> My match is obviously far more complicated than necesarry, but i wanted to
show
> you stuff in context quickly.
>
> If you find this helpful, please see that it gets back to the user list.
>
>
> Tim
> >
> > -Eric Dalquist
> >
> > ----- Original Message -----
> > From: "Tim Myers" <ph...@stserv.hcf.jhu.edu>
> > To: <co...@xml.apache.org>
> > Sent: Sunday, June 30, 2002 11:07 PM
> > Subject: Re: Form Validator
> >
> >
> > > > > My other question with the DBAuth stuff is can cocoon run the
> > submitted
> > > > > password through MySQLs PASSWORD() function? I would really like
to be
> > > > able
> > > > > to keep the password column in the table encrypted and still be
able
> > to
> > > > use
> > > > > the DBAuth stuff.
> > >
> > > sometime slightly less than a year ago i sent a patch to the dev
mailing
> > list
> > > for exactly that purpose.  Since then, i don't use it anymore.  I use
an
> > > xsp action with esql that i'll go ahead and attach.
> > >
> > > If you really want the patch for dbauth, let me know-- but i consider
it
> > hackish.
> > >
> > > Tim
> > >
> > >
> >
> >
>
> --------------------------------------------------------------------------
--
> > ----
> >
> >
> > > ---------------------------------------------------------------------
> > > 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:     <co...@xml.apache.org>
> > > For additional commands, e-mail:   <co...@xml.apache.org>
> >
>


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Form Validator

Posted by Tim Myers <ph...@stserv.hcf.jhu.edu>.
> > My other question with the DBAuth stuff is can cocoon run the submitted
> > password through MySQLs PASSWORD() function? I would really like to be
> able
> > to keep the password column in the table encrypted and still be able to
> use
> > the DBAuth stuff.

sometime slightly less than a year ago i sent a patch to the dev mailing list
for exactly that purpose.  Since then, i don't use it anymore.  I use an
xsp action with esql that i'll go ahead and attach.

If you really want the patch for dbauth, let me know-- but i consider it hackish.

Tim


AW: Form Validator - RESOLVED ! Need a Patch ?

Posted by Sascha Kulawik <sa...@kulawik.de>.
Ive made a Patch for Cocoon 2.0.2 for this Problem in the Class
AbstractValidatorAction.
Contact me, if you are interested.

Greetings,

Sascha


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


AW: Form Validator

Posted by Sascha Kulawik <sa...@kulawik.de>.
Same Problem here with the Session-validator.

Currently Im working with: Tomcat 4.0.4b, Cocoon 2.0.2 and JDK1.4, also
the avalon-excalibur-20020506.jar Patch for the Database-Connection
Problems with SDK 1.4.

DB-Auth is working, but the Session-validator doesnt execute perperly.
The core.log will gives the correct Session variables out, here some
code-snipps:

Sitemap:
----------------------------
<map:action name="sessval"
src="org.apache.cocoon.acting.SessionValidatorAction"/>
		</map:actions>
...
<map:match pattern="*/*.xsp">
				<map:act type="sessval">
					<map:parameter name="descriptor"
value="context://mount/sascha/validate.xml"/>
					<map:parameter name="validate"
value="username"/>
					<map:generate
src="xsp/forum.xsp" type="serverpages"/>
					<map:transform
src="templates/forumlist.xsl"/>
					<!--
					<map:generate
src="xsp/{../2}.xsp" type="serverpages"/>
					<map:transform
src="templates/{../1}.xsl"/>
					-->
					<map:serialize type="html"/>
				</map:act>
				<map:generate src="xml/hello.xml"/>
				<map:transform
src="templates/htmloutput.xsl"/>
				<map:serialize type="html"/>
				<!--<map:redirect-to uri="login"/>-->
			</map:match>

Validate.xml
-----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<root>
	<parameter name="username" type="string" nullable="no"/>
</root>

Any idea ?

Thanks,

Sascha


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


AW: Form Validator

Posted by Sascha Kulawik <sa...@kulawik.de>.
ds


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


AW: Form Validator

Posted by Sascha Kulawik <sa...@kulawik.de>.
dddd


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


AW: Form Validator

Posted by Sascha Kulawik <sa...@kulawik.de>.
er


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


AW: Form Validator

Posted by Sascha Kulawik <sa...@kulawik.de>.
d


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Form Validator

Posted by Dave Covert <dw...@yahoo.com>.
Eric-

Glad you have the db auth working. This will likely be files thrown together
because I am getting ready to go out town for a bit.

Here is login.xml
<?xml version="1.0"?>

<page>
<document sidebar="">
 <title>Login page</title>
 <content>
   <linkbar/>
   <para>
     This is a managed system.
   </para>
   <br/><br/>
   <form handler="do-login" name="login" method="get">
   <table width="20" caption="log-in" cellspacing="0" cellpadding="0"
border="0">
    <tr>
    <td width="10" height="0" align="right">WBS id:</td>
    <td width="10" height="0" align="left">
  <input-text name="user_id"/></td>
    </tr>
    <tr>
    <td width="10" height="0" align="right">Password:</td>
    <td width="10" height="0" align="left">
  <input-password name="user_password"/></td>
    </tr>
    <tr>
    <td width="10" height="0" align="center"> </td>
    <td width="10" height="0" align="left">
  <submit name="Login" value="Login"/></td>
    </tr>
 </table>
 <br/>
   </form>
 </content>
</document>
</page>

I flexed heavily off the apache.xsl but if there is anything confusing, let
me know.
I'll give one xsl entry I modified:
  <xsl:template match="input-text">
      <input type="text" name="{@name}" value="{@value}"/>
  </xsl:template>


The pipeline & auth.xml are below from the prior message.
My param.xml is:
<?xml version="1.0" encoding="UTF-8"?>

<!--
This file is used for description of request and session parameters.
parameters that are nullable and are found being null are replaced with
their
default values, non-nullable parameters can make the validation process
fail.
-->
<parameters-descriptor>
  <parameter name="user_id"  type="string" nullable="no"/>
  <parameter name="user_password"  type="string" nullable="no"/>
  <parameter name="user_permission" type="string" nullable="yes"
default="read"/>
</parameters-descriptor>

Your 'login.xsp' and 'do_login.xsp' look very similiar to mine. Just make
sure names match. If it still does not work, I'll have to see your
login.xsp.

      <!-- ================= -->
      <!-- Simple login page -->
      <!-- ================= -->
      <map:match pattern="login">
        <map:generate src="docs/login.xml"/>
        <map:transform src="stylesheets/wbs.xsl"/>
        <map:serialize/>
      </map:match>

      <!-- ========================================= -->
      <!-- Form target which performs auth service   -->
      <!-- ========================================= -->
      <map:match pattern="do-login">
        <!-- first validate whether submitted values are ok -->
        <map:act type="form-validator">
          <map:parameter name="descriptor"
value="context://wbs/descriptors/params.xml"/>
          <map:parameter name="validate" value="user_id"/>
          <!-- now try to log in -->
          <map:act type="db-authenticator">
            <map:parameter name="descriptor"
value="context://wbs/descriptors/auth.xml"/>
            <!-- now go to protected area -->
            <map:redirect-to uri="protected"/>
          </map:act>
  </map:act>
        <!-- something was wrong, try it again -->
  <map:redirect-to uri="login"/>
      </map:match>

On your '*.xsp' pipeline I noticed you used {1}. Once you use an action it
sets a new context and you need to use {../1} to get to the ancestor (or
parent).

Good luck!
Dave.................

----- Original Message -----
From: "Eric Dalquist" <eb...@mtu.edu>
To: <co...@xml.apache.org>
Sent: Monday, July 01, 2002 10:22 AM
Subject: Re: Form Validator


> Thanks for the tips Dave. I have the DBAuthenticator working. But I still
> can't get the session validator and form validator to work. Could you
please
> post an example of the XML file you use in your Form or Session
validators?
> I'm trying to be really simple right now with mine:
>
> <?xml version="1.0"?>
> <root>
>     <parameter name="user_name" type="string" nullable="no"/>
> </root>
>
> Here is an exerpt of my sitemap. I took the FormValidator off the
> do_login.xsp to get the DBAuth working.
>
>             <!-- unprotected login page -->
>             <map:match pattern="login.xsp">
>                 <map:generate type="serverpages" src="logic/login.xsp"/>
>                 <map:transform src="../stylesheets/site_format.xsl"/>
>                 <map:transform src="stylesheets/login.xsl"/>
>                 <map:serialize/>
>             </map:match>
>
>
>             <!--
>              | The page do_login does not actually exist this is just a
> dummy
>              | target for the login auth to take place at.
>              -->
>             <map:match pattern="do_login.xsp">
>                 <!-- now try to log in -->
>                 <map:act type="db-authenticator">
>                     <map:parameter name="descriptor"
> value="context://house_bills/descriptors/auth.xml"/>
>
>                     <!-- now go to protected area -->
>                     <map:redirect-to uri="index.xsp"/>
>                 </map:act>
>
>                 <!-- something was wrong, try it again -->
>                 <map:redirect-to uri="login.xsp"/>
>             </map:match>
>
>
>             <!--
>              | Just like with do_login.xsp there is no logout.xsp page. It
> is
>              | just a dummy target which kills the user's session.
>              -->
>             <map:match pattern="logout.xsp">
>                 <map:act type="session-invalidator">
>                     <map:redirect-to uri="login.xsp"/>
>                 </map:act>
>             </map:match>
>
>             <!-- the whole site requires a login so we do special
> excludes -->
>             <map:match pattern="*.xsp">
>                 <map:act type="session-validator">
>                     <map:parameter name="descriptor"
> value="context://house_bills/descriptors/params.xml"/>
>                     <map:parameter name="validate" value="user_name"/>
>
>                     <!-- Now generate the page -->
>                     <map:generate type="serverpages" src="logic/{1}.xsp"/>
>                     <map:transform src="../stylesheets/site_format.xsl"/>
>                     <map:transform src="stylesheets/{1}.xsl"/>
>                     <map:serialize/>
>                     <!-- End generated page -->
>                 </map:act>
>
>                 <!-- something was wrong, redirect to login page -->
>                 <map:redirect-to uri="login.xsp"/>
>             </map:match>
>
>
> ----- Original Message -----
> From: "Dave Covert" <dw...@yahoo.com>
> To: <co...@xml.apache.org>
> Sent: Sunday, June 30, 2002 10:54 PM
> Subject: Re: Form Validator
>
>
> > Eric-
> > I have a simple authentication running with mySql.
> >
> > The db-authenticator is missing from the pipeline given. form-validator
is
> > only validating that the values in your form meet the constraints in
> > params.xml. db-authenticator will check the database table against what
> the
> > user typed in.
> >
> > The corresponding pipeline in my sub-site is:
> >       <map:match pattern="do-login">
> >         <!-- first validate whether submitted values are ok -->
> >         <map:act type="form-validator">
> >           <map:parameter name="descriptor"
> > value="context://wbs/descriptors/params.xml"/>
> >           <map:parameter name="validate" value="user_id"/>
> >           <!-- now try to log in -->
> >           <map:act type="db-authenticator">
> >             <map:parameter name="descriptor"
> > value="context://wbs/descriptors/auth.xml"/>
> >             <!-- now go to protected area -->
> >             <map:redirect-to uri="protected"/>
> >           </map:act>
> >   </map:act>
> >         <!-- something was wrong, try it again -->
> >   <map:redirect-to uri="login"/>
> >       </map:match>
> > (Yes, it was shamelessly stolen from the example.)
> > The auth.xml I use looks like this:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <auth-descriptor>
> >   <connection>wbs</connection>
> >   <table name="tbl_users">
> >     <select dbcol="user_id" request-param="user_id"
to-session="user_id"/>
> >     <select dbcol="user_password" request-param="user_password"
> > to-session="user_password"/>
> >     <select dbcol="user_permission" to-session="user_permission"
> > type="string"/>
> >   </table>
> > </auth-descriptor>
> >
> > An item of note: the names for the id & password MUST match in login.xsp
> > (request name - html form), in params.xml (name=), and auth.xml
> > (request-param=). The "dbcol" in auth.xml is the column name in your
> table -
> > "user_name" from your table def.
> > If the request name in login.xsp (from the html form) is not the same as
> in
> > params.xml (in your case "user_id") that may be why the form is not
> > validated - sending you back to login.
> >
> >
> > Then, assuming other pipes will be 'protected' you need to wrap each
one.
> > Such as:
> >   <map:match pattern="*-meter.html*">
> >     <map:act type="session-validator">
> >       <map:parameter name="descriptor"
> > value="context://wbs//descriptors/params.xml"/>
> >       <map:parameter name="validate" value="user_id, user_password"/>
> >       <!-- Now generate the page -->
> >       <map:generate type="serverpages" src="docs/{../1}-meter.xsp"/>
> >       <map:transform src="stylesheets/wbs.xsl"/>
> >       <map:serialize/>
> >       <!-- End generated page -->
> >     </map:act>
> >     <!-- something was wrong, redirect to login page -->
> >     <map:redirect-to uri="login"/>
> >   </map:match>
> > "session-validator" will validate that the user_id & user_password
(placed
> > in session variables by "db-authenticator" from the "to-session" of
> > auth.xml) are valid. It only checks validity in terms of a 'form'
check -
> it
> > does not access the database again (as far as I know).
> > These values are invalidated on session timeout, forcing the user to
login
> > again.
> > Since I am still playing, I am allowing the password to stay around as a
> > session variable.
> >
> > On your PASSWORD() function question, I can not help. My guess is that
you
> > would have to modify (or make your own)
> > org.apache.cocoon.acting.FormValidatorAction.
> >
> > HTH
> > Dave...................
> >
> > ----- Original Message -----
> > From: "Eric Dalquist" <eb...@mtu.edu>
> > To: <co...@xml.apache.org>
> > Sent: Saturday, June 29, 2002 12:06 PM
> > Subject: Form Validator
> >
> >
> > > I've been trying to get the form validator and DB Validator working
for
> > > about a week now. I decided to try and just got the form stuff working
> > first
> > > but I can't even get that. I'm running Cocoon 2.0.2-dev and Tomcat
> 4.1.3.
> > >
> > > In my sitemap.xmap I have the following:
> > >
> > > <!--
> > >  | The page do_login does not actually exist this is just a dummy
> > >  | target for the login auth to take place at.
> > >  -->
> > > <map:match pattern="do_login.xsp">
> > >     <map:act type="form-validator">
> > >         <map:parameter name="descriptor"
> > > value="context://house_bills/descriptors/params.xml"/>
> > >         <map:parameter name="validate-set" value="user-pass"/>
> > >
> > >         <map:redirect-to uri="index.xsp"/>
> > >     </map:act>
> > >
> > >     <map:redirect-to uri="login.xsp"/>
> > > </map:match>
> > >
> > > login.xsp has a form that posts to do_login.xsp and has two inputs
named
> > > user_name and user_password.
> > >
> > > Here is my params.xml
> > > <?xml version="1.0"?>
> > > <root>
> > >   <parameter name="user_name" type="string" nullable="no"/>
> > >   <parameter name="user_password" type="string" nullable="no"/>
> > >
> > >   <constraint-set name="name-pass">
> > >     <validate name="user_name"/>
> > >     <validate name="user_password"/>
> > >   </constraint-set>
> > > </root>
> > >
> > > I've checked through the logs and there aren't any context errors so
> > Cocoon
> > > seems to be finding the params.xml file OK. Everytime I submit the
form
> I
> > > get bounced back to the login.xsp page instead of getting sent to
> > index.xsp.
> > > It doesn't matter if I don't put anything in the inputs or have valid
> data
> > > in both.
> > >
> > > I would also like to be able to validate the user_name &
password_fields
> > > against a MySQL database and setting the value in the corresponding
> > user_id
> > > column in a session variable. I played with it a little and cocoon was
> > > connection to the DB but not authenticating, I don't have my
descriptor
> > file
> > > for that any more. Here is my DDL for the table I want to auth
against.
> > >
> > > CREATE TABLE `users` (
> > >   `user_id` int(11) unsigned NOT NULL auto_increment,
> > >   `user_name` varchar(255) NOT NULL default '',
> > >   `user_password` varchar(16) NOT NULL default '',
> > >   `user_first_name` varchar(255) NOT NULL default '',
> > >   `user_last_name` varchar(255) NOT NULL default '',
> > >   `user_email` varchar(255) NOT NULL default '',
> > >   `user_status` tinyint(4) unsigned NOT NULL default '1',
> > >   PRIMARY KEY  (`user_id`),
> > >   UNIQUE KEY `user_login` (`user_name`,`user_password`),
> > >   UNIQUE KEY `user_id` (`user_id`)
> > > ) TYPE=MyISAM
> > >
> > > My other question with the DBAuth stuff is can cocoon run the
submitted
> > > password through MySQLs PASSWORD() function? I would really like to be
> > able
> > > to keep the password column in the table encrypted and still be able
to
> > use
> > > the DBAuth stuff.
> > >
> > > I hope someone can give me a hand with this. After a week of searching
> the
> > > mailing lists, coocon site and web in general I'm stuck!
> > >
> > > -Eric Dalquist
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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:     <co...@xml.apache.org>
> > > For additional commands, e-mail:   <co...@xml.apache.org>
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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:     <co...@xml.apache.org>
> > For additional commands, e-mail:   <co...@xml.apache.org>
> >
>
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Form Validator

Posted by Eric Dalquist <eb...@mtu.edu>.
Thanks for the tips Dave. I have the DBAuthenticator working. But I still
can't get the session validator and form validator to work. Could you please
post an example of the XML file you use in your Form or Session validators?
I'm trying to be really simple right now with mine:

<?xml version="1.0"?>
<root>
    <parameter name="user_name" type="string" nullable="no"/>
</root>

Here is an exerpt of my sitemap. I took the FormValidator off the
do_login.xsp to get the DBAuth working.

            <!-- unprotected login page -->
            <map:match pattern="login.xsp">
                <map:generate type="serverpages" src="logic/login.xsp"/>
                <map:transform src="../stylesheets/site_format.xsl"/>
                <map:transform src="stylesheets/login.xsl"/>
                <map:serialize/>
            </map:match>


            <!--
             | The page do_login does not actually exist this is just a
dummy
             | target for the login auth to take place at.
             -->
            <map:match pattern="do_login.xsp">
                <!-- now try to log in -->
                <map:act type="db-authenticator">
                    <map:parameter name="descriptor"
value="context://house_bills/descriptors/auth.xml"/>

                    <!-- now go to protected area -->
                    <map:redirect-to uri="index.xsp"/>
                </map:act>

                <!-- something was wrong, try it again -->
                <map:redirect-to uri="login.xsp"/>
            </map:match>


            <!--
             | Just like with do_login.xsp there is no logout.xsp page. It
is
             | just a dummy target which kills the user's session.
             -->
            <map:match pattern="logout.xsp">
                <map:act type="session-invalidator">
                    <map:redirect-to uri="login.xsp"/>
                </map:act>
            </map:match>

            <!-- the whole site requires a login so we do special
excludes -->
            <map:match pattern="*.xsp">
                <map:act type="session-validator">
                    <map:parameter name="descriptor"
value="context://house_bills/descriptors/params.xml"/>
                    <map:parameter name="validate" value="user_name"/>

                    <!-- Now generate the page -->
                    <map:generate type="serverpages" src="logic/{1}.xsp"/>
                    <map:transform src="../stylesheets/site_format.xsl"/>
                    <map:transform src="stylesheets/{1}.xsl"/>
                    <map:serialize/>
                    <!-- End generated page -->
                </map:act>

                <!-- something was wrong, redirect to login page -->
                <map:redirect-to uri="login.xsp"/>
            </map:match>


----- Original Message -----
From: "Dave Covert" <dw...@yahoo.com>
To: <co...@xml.apache.org>
Sent: Sunday, June 30, 2002 10:54 PM
Subject: Re: Form Validator


> Eric-
> I have a simple authentication running with mySql.
>
> The db-authenticator is missing from the pipeline given. form-validator is
> only validating that the values in your form meet the constraints in
> params.xml. db-authenticator will check the database table against what
the
> user typed in.
>
> The corresponding pipeline in my sub-site is:
>       <map:match pattern="do-login">
>         <!-- first validate whether submitted values are ok -->
>         <map:act type="form-validator">
>           <map:parameter name="descriptor"
> value="context://wbs/descriptors/params.xml"/>
>           <map:parameter name="validate" value="user_id"/>
>           <!-- now try to log in -->
>           <map:act type="db-authenticator">
>             <map:parameter name="descriptor"
> value="context://wbs/descriptors/auth.xml"/>
>             <!-- now go to protected area -->
>             <map:redirect-to uri="protected"/>
>           </map:act>
>   </map:act>
>         <!-- something was wrong, try it again -->
>   <map:redirect-to uri="login"/>
>       </map:match>
> (Yes, it was shamelessly stolen from the example.)
> The auth.xml I use looks like this:
> <?xml version="1.0" encoding="UTF-8"?>
> <auth-descriptor>
>   <connection>wbs</connection>
>   <table name="tbl_users">
>     <select dbcol="user_id" request-param="user_id" to-session="user_id"/>
>     <select dbcol="user_password" request-param="user_password"
> to-session="user_password"/>
>     <select dbcol="user_permission" to-session="user_permission"
> type="string"/>
>   </table>
> </auth-descriptor>
>
> An item of note: the names for the id & password MUST match in login.xsp
> (request name - html form), in params.xml (name=), and auth.xml
> (request-param=). The "dbcol" in auth.xml is the column name in your
table -
> "user_name" from your table def.
> If the request name in login.xsp (from the html form) is not the same as
in
> params.xml (in your case "user_id") that may be why the form is not
> validated - sending you back to login.
>
>
> Then, assuming other pipes will be 'protected' you need to wrap each one.
> Such as:
>   <map:match pattern="*-meter.html*">
>     <map:act type="session-validator">
>       <map:parameter name="descriptor"
> value="context://wbs//descriptors/params.xml"/>
>       <map:parameter name="validate" value="user_id, user_password"/>
>       <!-- Now generate the page -->
>       <map:generate type="serverpages" src="docs/{../1}-meter.xsp"/>
>       <map:transform src="stylesheets/wbs.xsl"/>
>       <map:serialize/>
>       <!-- End generated page -->
>     </map:act>
>     <!-- something was wrong, redirect to login page -->
>     <map:redirect-to uri="login"/>
>   </map:match>
> "session-validator" will validate that the user_id & user_password (placed
> in session variables by "db-authenticator" from the "to-session" of
> auth.xml) are valid. It only checks validity in terms of a 'form' check -
it
> does not access the database again (as far as I know).
> These values are invalidated on session timeout, forcing the user to login
> again.
> Since I am still playing, I am allowing the password to stay around as a
> session variable.
>
> On your PASSWORD() function question, I can not help. My guess is that you
> would have to modify (or make your own)
> org.apache.cocoon.acting.FormValidatorAction.
>
> HTH
> Dave...................
>
> ----- Original Message -----
> From: "Eric Dalquist" <eb...@mtu.edu>
> To: <co...@xml.apache.org>
> Sent: Saturday, June 29, 2002 12:06 PM
> Subject: Form Validator
>
>
> > I've been trying to get the form validator and DB Validator working for
> > about a week now. I decided to try and just got the form stuff working
> first
> > but I can't even get that. I'm running Cocoon 2.0.2-dev and Tomcat
4.1.3.
> >
> > In my sitemap.xmap I have the following:
> >
> > <!--
> >  | The page do_login does not actually exist this is just a dummy
> >  | target for the login auth to take place at.
> >  -->
> > <map:match pattern="do_login.xsp">
> >     <map:act type="form-validator">
> >         <map:parameter name="descriptor"
> > value="context://house_bills/descriptors/params.xml"/>
> >         <map:parameter name="validate-set" value="user-pass"/>
> >
> >         <map:redirect-to uri="index.xsp"/>
> >     </map:act>
> >
> >     <map:redirect-to uri="login.xsp"/>
> > </map:match>
> >
> > login.xsp has a form that posts to do_login.xsp and has two inputs named
> > user_name and user_password.
> >
> > Here is my params.xml
> > <?xml version="1.0"?>
> > <root>
> >   <parameter name="user_name" type="string" nullable="no"/>
> >   <parameter name="user_password" type="string" nullable="no"/>
> >
> >   <constraint-set name="name-pass">
> >     <validate name="user_name"/>
> >     <validate name="user_password"/>
> >   </constraint-set>
> > </root>
> >
> > I've checked through the logs and there aren't any context errors so
> Cocoon
> > seems to be finding the params.xml file OK. Everytime I submit the form
I
> > get bounced back to the login.xsp page instead of getting sent to
> index.xsp.
> > It doesn't matter if I don't put anything in the inputs or have valid
data
> > in both.
> >
> > I would also like to be able to validate the user_name & password_fields
> > against a MySQL database and setting the value in the corresponding
> user_id
> > column in a session variable. I played with it a little and cocoon was
> > connection to the DB but not authenticating, I don't have my descriptor
> file
> > for that any more. Here is my DDL for the table I want to auth against.
> >
> > CREATE TABLE `users` (
> >   `user_id` int(11) unsigned NOT NULL auto_increment,
> >   `user_name` varchar(255) NOT NULL default '',
> >   `user_password` varchar(16) NOT NULL default '',
> >   `user_first_name` varchar(255) NOT NULL default '',
> >   `user_last_name` varchar(255) NOT NULL default '',
> >   `user_email` varchar(255) NOT NULL default '',
> >   `user_status` tinyint(4) unsigned NOT NULL default '1',
> >   PRIMARY KEY  (`user_id`),
> >   UNIQUE KEY `user_login` (`user_name`,`user_password`),
> >   UNIQUE KEY `user_id` (`user_id`)
> > ) TYPE=MyISAM
> >
> > My other question with the DBAuth stuff is can cocoon run the submitted
> > password through MySQLs PASSWORD() function? I would really like to be
> able
> > to keep the password column in the table encrypted and still be able to
> use
> > the DBAuth stuff.
> >
> > I hope someone can give me a hand with this. After a week of searching
the
> > mailing lists, coocon site and web in general I'm stuck!
> >
> > -Eric Dalquist
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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:     <co...@xml.apache.org>
> > For additional commands, e-mail:   <co...@xml.apache.org>
>
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Form Validator

Posted by Dave Covert <dw...@yahoo.com>.
Eric-
I have a simple authentication running with mySql.

The db-authenticator is missing from the pipeline given. form-validator is
only validating that the values in your form meet the constraints in
params.xml. db-authenticator will check the database table against what the
user typed in.

The corresponding pipeline in my sub-site is:
      <map:match pattern="do-login">
        <!-- first validate whether submitted values are ok -->
        <map:act type="form-validator">
          <map:parameter name="descriptor"
value="context://wbs/descriptors/params.xml"/>
          <map:parameter name="validate" value="user_id"/>
          <!-- now try to log in -->
          <map:act type="db-authenticator">
            <map:parameter name="descriptor"
value="context://wbs/descriptors/auth.xml"/>
            <!-- now go to protected area -->
            <map:redirect-to uri="protected"/>
          </map:act>
  </map:act>
        <!-- something was wrong, try it again -->
  <map:redirect-to uri="login"/>
      </map:match>
(Yes, it was shamelessly stolen from the example.)
The auth.xml I use looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<auth-descriptor>
  <connection>wbs</connection>
  <table name="tbl_users">
    <select dbcol="user_id" request-param="user_id" to-session="user_id"/>
    <select dbcol="user_password" request-param="user_password"
to-session="user_password"/>
    <select dbcol="user_permission" to-session="user_permission"
type="string"/>
  </table>
</auth-descriptor>

An item of note: the names for the id & password MUST match in login.xsp
(request name - html form), in params.xml (name=), and auth.xml
(request-param=). The "dbcol" in auth.xml is the column name in your table -
"user_name" from your table def.
If the request name in login.xsp (from the html form) is not the same as in
params.xml (in your case "user_id") that may be why the form is not
validated - sending you back to login.


Then, assuming other pipes will be 'protected' you need to wrap each one.
Such as:
  <map:match pattern="*-meter.html*">
    <map:act type="session-validator">
      <map:parameter name="descriptor"
value="context://wbs//descriptors/params.xml"/>
      <map:parameter name="validate" value="user_id, user_password"/>
      <!-- Now generate the page -->
      <map:generate type="serverpages" src="docs/{../1}-meter.xsp"/>
      <map:transform src="stylesheets/wbs.xsl"/>
      <map:serialize/>
      <!-- End generated page -->
    </map:act>
    <!-- something was wrong, redirect to login page -->
    <map:redirect-to uri="login"/>
  </map:match>
"session-validator" will validate that the user_id & user_password (placed
in session variables by "db-authenticator" from the "to-session" of
auth.xml) are valid. It only checks validity in terms of a 'form' check - it
does not access the database again (as far as I know).
These values are invalidated on session timeout, forcing the user to login
again.
Since I am still playing, I am allowing the password to stay around as a
session variable.

On your PASSWORD() function question, I can not help. My guess is that you
would have to modify (or make your own)
org.apache.cocoon.acting.FormValidatorAction.

HTH
Dave...................

----- Original Message -----
From: "Eric Dalquist" <eb...@mtu.edu>
To: <co...@xml.apache.org>
Sent: Saturday, June 29, 2002 12:06 PM
Subject: Form Validator


> I've been trying to get the form validator and DB Validator working for
> about a week now. I decided to try and just got the form stuff working
first
> but I can't even get that. I'm running Cocoon 2.0.2-dev and Tomcat 4.1.3.
>
> In my sitemap.xmap I have the following:
>
> <!--
>  | The page do_login does not actually exist this is just a dummy
>  | target for the login auth to take place at.
>  -->
> <map:match pattern="do_login.xsp">
>     <map:act type="form-validator">
>         <map:parameter name="descriptor"
> value="context://house_bills/descriptors/params.xml"/>
>         <map:parameter name="validate-set" value="user-pass"/>
>
>         <map:redirect-to uri="index.xsp"/>
>     </map:act>
>
>     <map:redirect-to uri="login.xsp"/>
> </map:match>
>
> login.xsp has a form that posts to do_login.xsp and has two inputs named
> user_name and user_password.
>
> Here is my params.xml
> <?xml version="1.0"?>
> <root>
>   <parameter name="user_name" type="string" nullable="no"/>
>   <parameter name="user_password" type="string" nullable="no"/>
>
>   <constraint-set name="name-pass">
>     <validate name="user_name"/>
>     <validate name="user_password"/>
>   </constraint-set>
> </root>
>
> I've checked through the logs and there aren't any context errors so
Cocoon
> seems to be finding the params.xml file OK. Everytime I submit the form I
> get bounced back to the login.xsp page instead of getting sent to
index.xsp.
> It doesn't matter if I don't put anything in the inputs or have valid data
> in both.
>
> I would also like to be able to validate the user_name & password_fields
> against a MySQL database and setting the value in the corresponding
user_id
> column in a session variable. I played with it a little and cocoon was
> connection to the DB but not authenticating, I don't have my descriptor
file
> for that any more. Here is my DDL for the table I want to auth against.
>
> CREATE TABLE `users` (
>   `user_id` int(11) unsigned NOT NULL auto_increment,
>   `user_name` varchar(255) NOT NULL default '',
>   `user_password` varchar(16) NOT NULL default '',
>   `user_first_name` varchar(255) NOT NULL default '',
>   `user_last_name` varchar(255) NOT NULL default '',
>   `user_email` varchar(255) NOT NULL default '',
>   `user_status` tinyint(4) unsigned NOT NULL default '1',
>   PRIMARY KEY  (`user_id`),
>   UNIQUE KEY `user_login` (`user_name`,`user_password`),
>   UNIQUE KEY `user_id` (`user_id`)
> ) TYPE=MyISAM
>
> My other question with the DBAuth stuff is can cocoon run the submitted
> password through MySQLs PASSWORD() function? I would really like to be
able
> to keep the password column in the table encrypted and still be able to
use
> the DBAuth stuff.
>
> I hope someone can give me a hand with this. After a week of searching the
> mailing lists, coocon site and web in general I'm stuck!
>
> -Eric Dalquist
>
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Form Validator

Posted by Eric Dalquist <eb...@mtu.edu>.
I've been trying to get the form validator and DB Validator working for
about a week now. I decided to try and just got the form stuff working first
but I can't even get that. I'm running Cocoon 2.0.2-dev and Tomcat 4.1.3.

In my sitemap.xmap I have the following:

<!--
 | The page do_login does not actually exist this is just a dummy
 | target for the login auth to take place at.
 -->
<map:match pattern="do_login.xsp">
    <map:act type="form-validator">
        <map:parameter name="descriptor"
value="context://house_bills/descriptors/params.xml"/>
        <map:parameter name="validate-set" value="user-pass"/>

        <map:redirect-to uri="index.xsp"/>
    </map:act>

    <map:redirect-to uri="login.xsp"/>
</map:match>

login.xsp has a form that posts to do_login.xsp and has two inputs named
user_name and user_password.

Here is my params.xml
<?xml version="1.0"?>
<root>
  <parameter name="user_name" type="string" nullable="no"/>
  <parameter name="user_password" type="string" nullable="no"/>

  <constraint-set name="name-pass">
    <validate name="user_name"/>
    <validate name="user_password"/>
  </constraint-set>
</root>

I've checked through the logs and there aren't any context errors so Cocoon
seems to be finding the params.xml file OK. Everytime I submit the form I
get bounced back to the login.xsp page instead of getting sent to index.xsp.
It doesn't matter if I don't put anything in the inputs or have valid data
in both.

I would also like to be able to validate the user_name & password_fields
against a MySQL database and setting the value in the corresponding user_id
column in a session variable. I played with it a little and cocoon was
connection to the DB but not authenticating, I don't have my descriptor file
for that any more. Here is my DDL for the table I want to auth against.

CREATE TABLE `users` (
  `user_id` int(11) unsigned NOT NULL auto_increment,
  `user_name` varchar(255) NOT NULL default '',
  `user_password` varchar(16) NOT NULL default '',
  `user_first_name` varchar(255) NOT NULL default '',
  `user_last_name` varchar(255) NOT NULL default '',
  `user_email` varchar(255) NOT NULL default '',
  `user_status` tinyint(4) unsigned NOT NULL default '1',
  PRIMARY KEY  (`user_id`),
  UNIQUE KEY `user_login` (`user_name`,`user_password`),
  UNIQUE KEY `user_id` (`user_id`)
) TYPE=MyISAM

My other question with the DBAuth stuff is can cocoon run the submitted
password through MySQLs PASSWORD() function? I would really like to be able
to keep the password column in the table encrypted and still be able to use
the DBAuth stuff.

I hope someone can give me a hand with this. After a week of searching the
mailing lists, coocon site and web in general I'm stuck!

-Eric Dalquist



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: null pointer passed as base exception

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Leona Slepetis [mailto:leona@gorillacommunications.com]
> 
> Hi All,
> 
> I have part of  a pipeline that looks like this:
> 
>     <map:match pattern="matrix">
>       <map:generate src="gs.xml"/>
>       <map:transform src="gs.xsl">
>         <map:parameter name="pagename" value="matrix"/>
>         <map:parameter name="dealID" value="{1}"/>
>         <map:parameter name="playerID" value="123"/>
>         <map:parameter name="matrixfile" value="{3}"/>
>         <map:parameter name="projectname" value="{4}"/>
>       </map:transform>
>       <map:transform src="default-html.xsl"/>
>       <map:serialize type="html"/>
>     </map:match>
> 
> In gs.xml I have:
> 
> <application>
>   <page name="matrix"/>
> <!-- some other stuff that doesn't matter in this example -->
> </application>
> 
> In gs.xsl I have:
> 
>   <xsl:template match="application">
>     <xsl:if test="not($pagename)">
>       <xsl:apply-templates select="page[@name='default']"/>
>     </xsl:if>
>     <xsl:if test="$pagename">
>       <xsl:apply-templates select="page[@name=$pagename]"/>
>     </xsl:if>
>   </xsl:template>
> 
> And default-html.xsl has:
> 
>   <xsl:template match="page">
>     <html>
>       <head>
>         <title>title</title>
>       </head>
>       <body>
>         <xsl:apply-templates/>
>       </body>
>     </html>
>   </xsl:template>
> 
> I get to it by calling
>
http://localhost:8080/GS/matrix?dealID=1001&playerID=&matrixfile=file://
/D:/
> matrix.xml&projectname=new
> 
> When I run it, the following error occurs:
> Could not read resource file:/D:/tomcat/webapps/GS/gs.xml
> 
> org.apache.cocoon.ProcessingException: Could not read resource
> file:/D:/tomcat/webapps/GorillaStation/gs.xml:
java.lang.RuntimeException:
> java.lang.IllegalArgumentException: Null pointer passed as base

What's the stacktrace? 

Vadim


> One thing I notice is that playerID is not set to the value '123'. Why
is
> this?
> The other thing is that if I take out    <map:parameter
name="pagename"
> value="matrix"/>  from the pipeline it works
> according to the default logic in <xsl:application>.
> 
> There doesn't appear to be anything wrong with gs.xml; it was working
under
> C1.
> Other pipeline segments using the parameter "pagename" work just fine,
such
> as:
> 
>     <map:match pattern="summary">
>       <map:generate src="gs.xml"/>
>       <map:transform src="gs.xsl">
>         <map:parameter name="pagename" value="summary"/>
>       </map:transform>
>       <map:transform src="default-html.xsl"/>
>       <map:serialize type="html"/>
>     </map:match>
> 
> Can anyone give me a clue as to what is wrong?
> 
> Thanks very much,
> Leona
> 
> 
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>