Hi all,
I'm having a tough time figuring out how to use the output
of a transformation in the sitemap.
The task is fairly simple user authentication. Pseudocode for
the desired operation:

1) check the id and password request params against the user database (users.xml)
   <map:generate src="data/users.xml" />
   <map:transform src="transforms/authenticate.xsl" />

The stylesheet checks the id and password params against users.xml
for a match. It outputs <success userid="lars"/> if successful; <failed/>
otherwise.

2) If step 1 was successful, create a session and store the valid
  of userid in it; then redirect to the "menu" pipeline.
   Otherwise, redirect to the "login?login-failed=true" pipeline,
   which will present an error message and a login form.

PROBLEM: how to get the result from step 1 into a form that can
be used by the sitemap for a conditional to control step 2?
The only thing I can think of would be for authenticate.xsl
to generate XML for the "session" transformer, conditional on
the success of authentication. So the pipeline looks like
   <map:generate src="data/users.xml" />
   <map:transform src="transforms/authenticate.xsl" />
   <map:transform type="session" />
The "session" transformer code could create a session and write
the userid into a session context. However, I still have the problem
that at some point in the pipeline, I need to do things (namely,
redirect to another URL) which cannot be done by a transformer,
at least not that I know of. So I have to get the authentication
result (success or failure) out of the XML stream into something
the sitemap can use. How do I do that?

Also, the "session" transformer has the drawback that it writes
session contexts but cannot write session attributes. This means
that later on, when the user tries to access a document and so
we have to the current session for a userid, we're stuck...
there are Input Modules (session-attr) for accessing session
attributes, but not session contexts. Nor can I use
SessionSelector for a conditional because it wants session
attributes.

Any help would be greatly appreciated!

Yes, I've looked at the Authentication Framework but it doesn't
seem to do what we need.

I've counted about 8 different ways to access sessions in Cocoon,
all for use in different contexts and with different limitations,
and with documentation in varying degrees of scattered sparseness...
if I had more hair to spare I'd be pulling it!  :-#

Lars


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to