Hi Christopher,

Sorry for not being clearer on that.  Your normal generate, transform, and
serialize steps would go where I have the vague "... stuff to process
pipeline based on params" text.  =)  Feel free to send me any other
questions you have once you get a chance to look at resources and selects!

Harry


-----Original Message-----
From: Christopher Painter-Wakefield [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 10:39 AM
To: [EMAIL PROTECTED]
Subject: RE: how do I redirect in an Action?



Thanks for all the suggestions.  I'm pretty confused at this point, as I
haven't used <map:resource> or <map:select> previously, so I need to spend
some time understanding the code you've offered.  One thing in particular I
don't see is where I should put my normal generate, transform, and
serialize steps for the protected URL.  Do they just go after the call to
the resource?

-Christopher



Hi Christopher and Edgar,

Couple things.  I could be wrong, but I believe in Edgar's example, the
redirect would always execute (since it sits outside the action).

Also, depending on how many protected url matchers you have, you can also
delegate all work to a resource where you could put all your authentication
and redirect logic (so you don't have to have it in each matcher).  So you
could do something like this:

 <map:match pattern="some protected url">
  <map:call resource="authenticatedAccess">
   <map:parameter name="someIDForThisPipe"
value="foo"/>
   ... any other params you might need to process this
pipe ...
  </map:call>
 </map:match>

 <map:match pattern="some other protected url">
  <map:call resource="authenticatedAccess">
   <map:parameter name="someIDForThisPipe"
value="bar"/>
   ... any other params you might need to process this
pipe ...
  </map:call>
 </map:match>

And the resource might look like:

 <map:resource name="authenticatedAccess">
  <map:act type="my-authenticator">
   <map:select type="parameter">
    <map:parameter
name="parameter-selector-test" value="{authStatus}"/>
    <map:when test="success">
     ... stuff to process pipeline based
on params
    </map:when>
    <map:otherwise>
     <map:redirect-to
uri="loginpage.html"/>
    </map:otherwise>
   </map:select>
  </map:act>
 </map:resource>


Anyway, hope that helps!

Harry




---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.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/faqs.html>

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

Reply via email to