You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Markus Bernhardt <mb...@swsgmbh.de> on 2000/09/03 10:07:09 UTC

Re: New version of auth taglib

Hello,

is there a possibility to redirect the client after a correct login
to a specific page with the auth taglib.

Know how to implement this,
but is there an option in the auth taglib I missed.

Markus


Ulrich Mayring wrote:

> Hello,
>
> you can download from http://ulim.cocoonhost.com the new version of my
> auth taglib.
>
> I improved the docs quite a bit and added two new authentication
> schemes:
>
> 1.) Authentication against a database table.
> 2.) Authentication against a stored procedure.
>
> The first has been tested by an unsuspecting user and is reported to
> work, the second is untested, but I proved it correct ;-)
>
> ATTENTION: if your database supports stored procedures, you want to use
> 2.) instead of 1.) due to better security. The standard user, that is
> used by auth's database connection, can in the second case be deprived
> of all rights whatsoever except executing the authentication stored
> procedure.
>
> Ulrich
>
> --
> Ulrich Mayring
> DENIC eG, Systementwicklung
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: New version of auth taglib

Posted by Ulrich Mayring <ul...@denic.de>.
Markus Bernhardt wrote:
> 
> Hello,
> 
> the auth taglib is running now.
> I'm using at the moment jdbctable. (I'm only playing around a little bit)
> 
> I wondered where to put the username and
> password for the connection.
> 
> I putted it into the samples/jdbctable/login.xml
> ---        <auth:paramvar name="auth:username"/>
> ---        <auth:paramvar name="auth:password"/>
>  +++       <auth:textvar name="auth:username" value="auth"/>
>  +++       <auth:textvar name="auth:password" value="0815"/>
> 
> Is this the right place ?????

Yes, correct, auth:username and auth:password are always the
username/password used to login to the database. auth:paramvar means the
value is read from the HTTP request parameters and auth:textvar allows
you to put in a static value.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: New version of auth taglib

Posted by Markus Bernhardt <mb...@swsgmbh.de>.
Hello,

the auth taglib is running now.
I'm using at the moment jdbctable. (I'm only playing around a little bit)

I wondered where to put the username and
password for the connection.

I putted it into the samples/jdbctable/login.xml
---        <auth:paramvar name="auth:username"/>
---        <auth:paramvar name="auth:password"/>
 +++       <auth:textvar name="auth:username" value="auth"/>
 +++       <auth:textvar name="auth:password" value="0815"/>

Is this the right place ?????



Re: XSP -> XSL or XML?

Posted by Amit Kaushik <sm...@yahoo.co.uk>.
Hi,
U can remove <?cocoon-process type="xslt"?> from ur XML file.Cocoon won't
prse it and display it as pure XML docyment.

Amit

----- Original Message -----
From: Benjamin Dixon <be...@arches.uga.edu>
To: <co...@xml.apache.org>
Sent: Thursday, December 07, 2000 12:27 AM
Subject: XSP -> XSL or XML?


>
> Quick question,
>
> I have an XSP that currently selects thing from the database dependent on
> what the user wants to see. I then send the data through an XSL stylesheet
> for their platform... all that works fine. But some of my clients are
> gonna want just the pure XML with no styling... in particular, I want to
> make this content available to macromedia flash via its XMLSocket
> interface. Is it possible to selectively style or not style content from
> an XSP? And if so, what steps should I take to do this? If thats not the
> case, I suspect I could send it through to another stylesheet that simply
> copies the XML to output but the, how can I detect a flash user-agent so
> I'll know how to send the data?
>
> Thanks,
>
> Ben
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Cocoon, ESQL, Oracle

Posted by Matthew Cordes <mc...@maine.edu>.
This doesn't fix your connect pronblem, but after you do get it 
fixed, check out the turbin connection pool stuff ( 
cocoon.properties ), then you'd only need to make such a change in 
1 place for each context.

-matt



On Thu, Dec 07, 2000 at 11:46:40AM -0500, Benjamin Dixon wrote:
> 
> Hi all,
> 
> I've got another slight problem. Recently we moved our oracle database
> from internal address 10.1.1.13 to 10.1.1.22. I thought fixing my XSP/ESQL
> pages would be a breeze, I'd just change the line:
> 
> <esql:dburl>jdbc:oracle:thin:@10.1.1.13:1521:dvlp</esql:dburl>
> 
> to something like:
> 
> <esql:dburl>jdbc:oracle:thin:@10.1.1.22:1521:dvlp</esql:dburl>
> 
> Using the 10.1.1.22 address as above, I can connect to Oracle easily via
> regular java code that looks something like this:
> 
> Connection conn = DriverManager.getConnection
> ("jdbc:oracle:thin:@10.1.1.22:1521:dvlp", "xml", "socrates");
> 
> When we switched oracle over nothing changed but address. dvlp and the
> port numbers stayed the same. So I figured the problem had something to do
> cocoon caching the servlet in some way so I restarted apache... didn't
> work. So I deleted the servlet source from my repository... didn't work.
> To make a long story short, I ended up turning off caching in cocoon,
> deleting the source from repository, restarting apache, touching the XSP
> source and still nothing, I still get a "Network Adapter could not connect
> to database" type error. So I looked through the caching docs on the
> webpage but didn't see anything I thought was applicable since it appears
> from those docs that XSP is not cached unless explicitly told to cache (in
> my case I'm not using <util:cacheable>). So I'd appreciate any insight
> into this, seems to me its an odd problem and must have a simple solution.
> 
> Regards,
> Ben
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

Re: Cocoon, ESQL, Oracle

Posted by Benjamin Dixon <be...@arches.uga.edu>.
Oops. Sorry about that! Was a bit premature anyway as I did not realize
there were two queries in the code... and therein was the problem. Solved
now... will be sure to include such minor details in future posts! :>

Thanks all,

Ben

On Thu, 7 Dec 2000, Donald Ball wrote:

> On Thu, 7 Dec 2000, Benjamin Dixon wrote:
> 
> > I've got another slight problem. Recently we moved our oracle database
> > from internal address 10.1.1.13 to 10.1.1.22. I thought fixing my XSP/ESQL
> > pages would be a breeze, I'd just change the line:
> >
> > <esql:dburl>jdbc:oracle:thin:@10.1.1.13:1521:dvlp</esql:dburl>
> >
> > to something like:
> >
> > <esql:dburl>jdbc:oracle:thin:@10.1.1.22:1521:dvlp</esql:dburl>
> >
> > Using the 10.1.1.22 address as above, I can connect to Oracle easily via
> > regular java code that looks something like this:
> >
> > Connection conn = DriverManager.getConnection
> > ("jdbc:oracle:thin:@10.1.1.22:1521:dvlp", "xml", "socrates");
> >
> > When we switched oracle over nothing changed but address. dvlp and the
> > port numbers stayed the same. So I figured the problem had something to do
> 
> you never state what the problem is...! :) hard to debug without that bit
> of information.
> 
> - donald
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

Today's Random Quote--------------------------------------

 Dig a well before you are thirsty. 
   Chinese Proverb
-----------------------------------------------------------


Re: Cocoon, ESQL, Oracle

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 7 Dec 2000, Benjamin Dixon wrote:

> I've got another slight problem. Recently we moved our oracle database
> from internal address 10.1.1.13 to 10.1.1.22. I thought fixing my XSP/ESQL
> pages would be a breeze, I'd just change the line:
>
> <esql:dburl>jdbc:oracle:thin:@10.1.1.13:1521:dvlp</esql:dburl>
>
> to something like:
>
> <esql:dburl>jdbc:oracle:thin:@10.1.1.22:1521:dvlp</esql:dburl>
>
> Using the 10.1.1.22 address as above, I can connect to Oracle easily via
> regular java code that looks something like this:
>
> Connection conn = DriverManager.getConnection
> ("jdbc:oracle:thin:@10.1.1.22:1521:dvlp", "xml", "socrates");
>
> When we switched oracle over nothing changed but address. dvlp and the
> port numbers stayed the same. So I figured the problem had something to do

you never state what the problem is...! :) hard to debug without that bit
of information.

- donald


Bug in hasChanged?

Posted by Per Kreipke <pe...@onclave.com>.
>From hasChanged(), it's not possible to get any values from the request
objects (e.g. parameters).

The base XSPPage object doesn't store the request object (because the page
instance might exist across requests). However, in order to correctly
determine whether or not a page's changeable points really are changeable,
sometimes a query parameter is needed.

Is there a way to get the request parameters from hasChanged()?

Per.


Cocoon, ESQL, Oracle

Posted by Benjamin Dixon <be...@arches.uga.edu>.
Hi all,

I've got another slight problem. Recently we moved our oracle database
from internal address 10.1.1.13 to 10.1.1.22. I thought fixing my XSP/ESQL
pages would be a breeze, I'd just change the line:

<esql:dburl>jdbc:oracle:thin:@10.1.1.13:1521:dvlp</esql:dburl>

to something like:

<esql:dburl>jdbc:oracle:thin:@10.1.1.22:1521:dvlp</esql:dburl>

Using the 10.1.1.22 address as above, I can connect to Oracle easily via
regular java code that looks something like this:

Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@10.1.1.22:1521:dvlp", "xml", "socrates");

When we switched oracle over nothing changed but address. dvlp and the
port numbers stayed the same. So I figured the problem had something to do
cocoon caching the servlet in some way so I restarted apache... didn't
work. So I deleted the servlet source from my repository... didn't work.
To make a long story short, I ended up turning off caching in cocoon,
deleting the source from repository, restarting apache, touching the XSP
source and still nothing, I still get a "Network Adapter could not connect
to database" type error. So I looked through the caching docs on the
webpage but didn't see anything I thought was applicable since it appears
from those docs that XSP is not cached unless explicitly told to cache (in
my case I'm not using <util:cacheable>). So I'd appreciate any insight
into this, seems to me its an odd problem and must have a simple solution.

Regards,
Ben



Re: XSP -> XSL or XML?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 6 Dec 2000, Benjamin Dixon wrote:

>
> Quick question,
>
> I have an XSP that currently selects thing from the database dependent on
> what the user wants to see. I then send the data through an XSL stylesheet
> for their platform... all that works fine. But some of my clients are
> gonna want just the pure XML with no styling... in particular, I want to
> make this content available to macromedia flash via its XMLSocket
> interface. Is it possible to selectively style or not style content from
> an XSP? And if so, what steps should I take to do this? If thats not the
> case, I suspect I could send it through to another stylesheet that simply
> copies the XML to output but the, how can I detect a flash user-agent so
> I'll know how to send the data?

if (browser wants XML) {
  <xsp:pi target="cocoon-format">text/xml</xsp:pi>
} else {
  <xsp:pi target="cocoon-process">type="xslt"</xsp:pi>
  <xsp:pi target="xml-stylesheet">type="text/xsl" href="foo.xsl"</xsp:pi>
}

as far as determining the flash user-agent, i dunno. check the http
request headers and check for whatever the magic indicator is.

- donald


XSP -> XSL or XML?

Posted by Benjamin Dixon <be...@arches.uga.edu>.
Quick question,

I have an XSP that currently selects thing from the database dependent on
what the user wants to see. I then send the data through an XSL stylesheet
for their platform... all that works fine. But some of my clients are
gonna want just the pure XML with no styling... in particular, I want to
make this content available to macromedia flash via its XMLSocket
interface. Is it possible to selectively style or not style content from
an XSP? And if so, what steps should I take to do this? If thats not the
case, I suspect I could send it through to another stylesheet that simply
copies the XML to output but the, how can I detect a flash user-agent so
I'll know how to send the data?

Thanks,

Ben


Re: XSP, toujours... :)

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 6 Dec 2000, Tiberiu DONDERA wrote:

> 2 questions:
>
> 1. When does the      'request'        object become available to my java
> code inside an <xsp:logic> tag?
>    request= the object which holds all parameters received trough post/get
>    I mean:
>
> <xsp:expr>request.getParameter("ID")</xsp:expr> works fine, but
>
> <xsp:logic>
>    id=request.getParameter("ID");
> </xsp:logic>
>
>   produces a NullPointerException.  (obviously, request is the one with the
> null value).

inside the element underneath the xsp:page element.

> 2. Where or how  can I see the generated java source? (I use cocoon1.8,
> tomcat3.1, apache1.3, on Redhat6.2)
>   (it would really help a lot in debugging)

look in your repository directory.

- donald


Re: XSP, toujours... :)

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 18:05 +0100 06/12/00, Tiberiu DONDERA wrote:
>2 questions:
>
>1. When does the      'request'        object become available to my java
>code inside an <xsp:logic> tag?
>   request= the object which holds all parameters received trough post/get
>   I mean:
>
><xsp:expr>request.getParameter("ID")</xsp:expr> works fine, but
>
><xsp:logic>
>   id=request.getParameter("ID");
></xsp:logic>
>
>  produces a NullPointerException.  (obviously, request is the one with the
>null value).

request, session, response etc are only available inside your user root
element (often <page>), as this is what gets put inside the
populateDocument method of your XSP.

They are not available inside <xsp:page> (anything outside the user root is
placed at the class level) you have to pass these parameters from method
calls inside the user root.

>2. Where or how  can I see the generated java source? (I use cocoon1.8,
>tomcat3.1, apache1.3, on Redhat6.2)
>  (it would really help a lot in debugging)

There should be a "repository" directory associated with your servlet engine.
This is where XSP pages are saved as java source and class files.

hope this helps

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

XSP, toujours... :)

Posted by Tiberiu DONDERA <ti...@hotmail.com>.
2 questions:

1. When does the      'request'        object become available to my java
code inside an <xsp:logic> tag?
   request= the object which holds all parameters received trough post/get
   I mean:

<xsp:expr>request.getParameter("ID")</xsp:expr> works fine, but

<xsp:logic>
   id=request.getParameter("ID");
</xsp:logic>

  produces a NullPointerException.  (obviously, request is the one with the
null value).

2. Where or how  can I see the generated java source? (I use cocoon1.8,
tomcat3.1, apache1.3, on Redhat6.2)
  (it would really help a lot in debugging)


Thank you,
Tibi Dondera


Re: New version of auth taglib

Posted by Ulrich Mayring <ul...@denic.de>.
Markus Bernhardt wrote:
> 
> I heared you come to Munich at Friday.
> Do you have time to meet us at our little cocoon-session in the
> 'Forschungsbrauerei'

I'll be there. Bring your code and I'll look at it ;-)

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: New version of auth taglib

Posted by Markus Bernhardt <mb...@swsgmbh.de>.

Ulrich Mayring wrote:

> Markus Bernhardt wrote:
> >
> > Everything is working fine, if you DON'T specify the <auth:success>
> > parameter in login.xml. If you do so, desaster starts.
> >
> > WHY ???????
>
> Well, what happens? Does the page compile? If not you probably have used
> a variable name that was already used in another place. That's why all
> auth-internal variables are called _auth_varname and such.

Yes, the page compiles.
I tried to use your kind of style.
I introduce only one new variable: _auth_continue

>
>
> > Another thing: I had to comment out the 'endAuthSession' in the tag
> > 'auth:fallback'.
> >         Is that a problem ?????
>
> Well, you can't logout without endAuthSession ;-)

Logout works perfect.
I have not commented out endAuthSession, but
the call to endAuthSession in the template auth:fallback.
As I see the only consequence of this is that after processing the
protected page, before redirecting to login.xml, the session-object
is not cleaned.

> Sorry, but I have no time currently to look at it, as I'm away for the
> rest of the week. I'd be happy to implement this feature, but it has to
> wait until next week.

I heared you come to Munich at Friday.
Do you have time to meet us at our little cocoon-session in the
'Forschungsbrauerei'

>
>
> Ulrich
>
> --
> Ulrich Mayring
> DENIC eG, Systementwicklung
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Markus

Re: New version of auth taglib

Posted by Ulrich Mayring <ul...@denic.de>.
Markus Bernhardt wrote:
> 
> Everything is working fine, if you DON'T specify the <auth:success>
> parameter in login.xml. If you do so, desaster starts.
> 
> WHY ???????

Well, what happens? Does the page compile? If not you probably have used
a variable name that was already used in another place. That's why all
auth-internal variables are called _auth_varname and such.

> Another thing: I had to comment out the 'endAuthSession' in the tag
> 'auth:fallback'.
>         Is that a problem ?????

Well, you can't logout without endAuthSession ;-)

Sorry, but I have no time currently to look at it, as I'm away for the
rest of the week. I'd be happy to implement this feature, but it has to
wait until next week.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: New version of auth taglib

Posted by Markus Bernhardt <mb...@swsgmbh.de>.
Hello

Uli Mayring wrote:

> On Sun, 3 Sep 2000, Markus Bernhardt wrote:
>
> > Hello,
> >
> > is there a possibility to redirect the client after a correct login
> > to a specific page with the auth taglib.
> >
> > Know how to implement this,
> > but is there an option in the auth taglib I missed.
>
> Yes, it's called auth:success.

That's not exactly what I need.

>
>
> Ulrich
>
> --
> Ulrich Mayring
> DENIC eG, Softwareentwicklung
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Lets say we have some protected pages:
- account.xml
- calendar.xml
- home.xml
....

What I need is:
account.xml => login.xml => account.xml
calendar.xml => login.xml => calendar.xml
home.xml => login.xml => hellouser.xml
<every other page> => login.xml => <auth:success>

First the good news:
I have modified auth.xsp.xsl to do such things.

How it should work:
        I added the attribute 'continue' to the tag 'auth:protect'.
        With this attribute you can now specify in each protected
        page which document to open after a successfull login.
        It overrides the 'auth:success' textvar in login.xml.
        If you don't set 'continue' 'auth:success' is used.

        This attribute has two different meanings:
                1. continue="this" :
                        After a succesfull login the user is
                        redirected to the protected page.
                2. continue="welcome.xml" :
                        After a succesfull login the user is
                        redirected to 'welcome.xml'

Then the bad news:
There's a problem I really don't understand.
(I'm an experienced java programmer, but know nearly nothing about xml,
xsl, xsp, .....)
Everything is working fine, if you DON'T specify the <auth:success>
parameter in login.xml. If you do so, desaster starts.

WHY ???????

Another thing: I had to comment out the 'endAuthSession' in the tag
'auth:fallback'.
        Is that a problem ?????

I only have tested jdbctable.

You can get the modified auth.xsp.xsl from:
http://pensacola.markus-bernhardt.de/authenticate/changed/auth.xsp.xsl

Markus

Re: New version of auth taglib

Posted by Uli Mayring <ul...@denic.de>.
On Sun, 3 Sep 2000, Markus Bernhardt wrote:

> Hello,
> 
> is there a possibility to redirect the client after a correct login
> to a specific page with the auth taglib.
> 
> Know how to implement this,
> but is there an option in the auth taglib I missed.

Yes, it's called auth:success.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Softwareentwicklung