You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Berin Loritsch <bl...@apache.org> on 2001/06/04 19:51:52 UTC

How do you redirect in Actions.

IMO, there should be two locations where it would be
safe and correct to redirect: Sitemap, and Actions.

However, I need to know if I can still redirect from
Actions.  If not, how will my sitemap know whether
to redirect or not?

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


Re: AW: How do you redirect in Actions.

Posted by Berin Loritsch <bl...@apache.org>.
Carsten Ziegeler wrote:
> 
> > Berin Loritsch wrote:
> >
> > IMO, there should be two locations where it would be
> > safe and correct to redirect: Sitemap, and Actions.
> >
> Currently it is only possible to redirect from the sitemap.

That sucks.

> > However, I need to know if I can still redirect from
> > Actions.  If not, how will my sitemap know whether
> > to redirect or not?
> >
> The action's act method returns a map object.
> In the sitemap you can act on exactly this return value:
> 
> <map:act type="my_action">
>    <!-- If a map object is returned -->
>    <map:redirect-to uri="{key_from_map}"/>
> </map:act>
> <!-- if no map object (null) is returned: -->
> <map:redirect-to uri="otherwise"/>

Not intuitive.  We need to rethink this.

> If you return a map object you can redirect to any value
> given in this map by specifying the redirect inside the
> act tag.

What if the action is part of an action set?  Redirect is
important when we are talking pure logic.  I think we need
to rethink the sitemap only thing.  It causes too much
to deal with by restricting ourselves so much.  It is unnatural
to delay redirecting to the sitemap, and then throw in some
PROGRAM logic in the sitemap.  This is mixing concerns, and I
don't like it.

What if we included the Environment object in the Action's
ObjectMap?  I think this will solve the issues for easy
programming--without relying on the site admin to not screw
up your site's security.

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


AW: How do you redirect in Actions.

Posted by Carsten Ziegeler <cz...@sundn.de>.
> Berin Loritsch wrote:
> 
> IMO, there should be two locations where it would be
> safe and correct to redirect: Sitemap, and Actions.
> 
Currently it is only possible to redirect from the sitemap.

> However, I need to know if I can still redirect from
> Actions.  If not, how will my sitemap know whether
> to redirect or not?
> 
The action's act method returns a map object. 
In the sitemap you can act on exactly this return value:

<map:act type="my_action">
   <!-- If a map object is returned -->
   <map:redirect-to uri="{key_from_map}"/> 
</map:act>
<!-- if no map object (null) is returned: -->
<map:redirect-to uri="otherwise"/>

If you return a map object you can redirect to any value
given in this map by specifying the redirect inside the 
act tag.

If your act method returns null no statement from inside
the act element is called. But the next statement directly
after the act is called.



Carsten 

Open Source Group                        sunShine - b:Integrated
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                          mailto: cziegeler@sundn.de 
================================================================

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

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