You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Zamek <za...@vili.pmmf.hu> on 2004/03/01 18:27:55 UTC

execute xsp and then redirect

Hello All,

I have a pattern like:
     <map:match pattern="list">
        <map:generate type="directory" src=".">
          <map:parameter name="depth" value="20"/>
          <map:parameter name="exclude" value="\.xmap$"/>
        </map:generate>
        <map:transform src="dir2html.xsl"/>
        <map:serialize/>
    </map:match>

and if I have a do-delete-** pattern I have to delete the parameter file, 
and then need to redirect to list.

      <map:match pattern="do-delete-**">
        <map:generate src="java/delete.xsp" type="serverpages">
          <map:parameter name="file" value="{1}"/>
        </map:generate>
        <map:redirect-to uri="list"/>
      </map:match>

Redirect cannot works:
Redirection limit for this URL exceeded. Unable to load the requested page. 
This may be caused by cookies that are blocked.

How can I combine this?
-- 
thx,
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694


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


Re: execute xsp and then redirect

Posted by Zamek <za...@vili.pmmf.hu>.
Hello All,

I have a new problem. After delete i have remaining uri with filename:

     <map:match pattern="do-delete-**">
        <map:act type="xsp-action" src="java/delete.xsp">
          <map:parameter name="file" value="{1}"/>
          <map:generate type="directory" src=".">
            <map:parameter name="depth" value="20"/>
            <map:parameter name="exclude" value="\.xmap$"/>
          </map:generate>
          <map:transform src="dir2html.xsl"/>
        <map:serialize/>
        </map:act>
      </map:match>

forexample if I call it with do-delete-dir/filename.ext
it delete file successfully, and make directory list, but its uri is 
remaining:

do-delete-dir/filename.ext
and the next delete is: do-delete-dir/do-delete/dir/newfile.ext and so 
on :-(

So I need to make redirection or forwarding, but how?
Simple redirection have got a redirection limit for this url is exceeded...

-- 
thx,
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694


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


Re: execute xsp and then redirect

Posted by Zamek <za...@vili.pmmf.hu>.
Hello All,

Thanks it works, but the basically problem is, I cannot redirect after 
delete. Originally I want to do:

 <map:match pattern="delete-**">
    <map:act type="xsp-action" src="java/delete.xsp">
        <map:parameter name="file" value="{1}"/>
        <map-redirect-to uri="list"/>
    </map:act>
    <map:redirect-to uri="error"/>
 </map:match>

but I've got an error:

Redirection limit for this URL exceeded. Unable to load the requested
page. This may be caused by cookies that are blocked.

If I change "<map:redirec-to..." to 

 <map:match pattern="delete-**">
   <map:act type="xsp-action" src="java/delete.xsp">
      <map:parameter name="file" value="{1}"/>
      <map:generate type="directory" src=".">
        <map:parameter name="depth" value="20"/>
        <map:parameter name="exclude" value="\.xmap$"/>
      </map:generate>
      <map:transform src="dir2html.xsl"/>
      <map:serialize/>
   <map:act>
    <map:redirect-to uri="error"/>
 </map:match>

it works well, but its generate section is similar to "list" pattern.
Are there any forward directive instead of redirect like <jsp:forward>?

On Monday 01 March 2004 21.36, Unico Hommes wrote:
> What you want is not possible. A pipeline consists of at least a
> generator and a serializer. Putting a map:redirect-to after a
> map:generate is incorrect. What you may want to do is use actions or
> else flowscript (the latter being the preferred method).
>
> Something like this (not tested, so will contain bugs):
>
> sitemap.xmap:
> -------------
> <map:match pattern="delete">
>    <map:call function="remove">
>      <map:parameter name="file" value="{request-param:file}"/>
>    </map:call>
> </map:match>
>
> <map:match pattern="list">
>    <map:generate type="directory" src=".">
>      <map:parameter name="depth" value="20"/>
>      <map:parameter name="exclude" value="\.xmap$"/>
>    </map:generate>
>    <map:transform src="dir2html.xsl"/>
>    <map:serialize/>
> </map:match>
>
> flow.js:
> --------
>
> importPackage(Packages.java.io);
>
> function remove() {
>     var file = new File(cocoon.parameters.file);
>     file["delete"];
>     cocoon.redirectTo("list");
> }
>
> Unico
>
> Zamek wrote:
> > Hello All,
> >
> > I have a pattern like:
> >      <map:match pattern="list">
> >         <map:generate type="directory" src=".">
> >           <map:parameter name="depth" value="20"/>
> >           <map:parameter name="exclude" value="\.xmap$"/>
> >         </map:generate>
> >         <map:transform src="dir2html.xsl"/>
> >         <map:serialize/>
> >     </map:match>
> >
> > and if I have a do-delete-** pattern I have to delete the parameter
> > file, and then need to redirect to list.
> >
> >       <map:match pattern="do-delete-**">
> >         <map:generate src="java/delete.xsp" type="serverpages">
> >           <map:parameter name="file" value="{1}"/>
> >         </map:generate>
> >         <map:redirect-to uri="list"/>
> >       </map:match>
> >
> > Redirect cannot works:
> > Redirection limit for this URL exceeded. Unable to load the requested
> > page. This may be caused by cookies that are blocked.
> >
> > How can I combine this?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org

-- 
thx,
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694


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


Re: execute xsp and then redirect

Posted by Unico Hommes <un...@hippo.nl>.
What you want is not possible. A pipeline consists of at least a 
generator and a serializer. Putting a map:redirect-to after a 
map:generate is incorrect. What you may want to do is use actions or 
else flowscript (the latter being the preferred method).

Something like this (not tested, so will contain bugs):

sitemap.xmap:
-------------
<map:match pattern="delete">
   <map:call function="remove">
     <map:parameter name="file" value="{request-param:file}"/>
   </map:call>
</map:match>

<map:match pattern="list">
   <map:generate type="directory" src=".">
     <map:parameter name="depth" value="20"/>
     <map:parameter name="exclude" value="\.xmap$"/>
   </map:generate>
   <map:transform src="dir2html.xsl"/>
   <map:serialize/>
</map:match>

flow.js:
--------

importPackage(Packages.java.io);

function remove() {
    var file = new File(cocoon.parameters.file);
    file["delete"];
    cocoon.redirectTo("list");
}

Unico


Zamek wrote:

> Hello All,
> 
> I have a pattern like:
>      <map:match pattern="list">
>         <map:generate type="directory" src=".">
>           <map:parameter name="depth" value="20"/>
>           <map:parameter name="exclude" value="\.xmap$"/>
>         </map:generate>
>         <map:transform src="dir2html.xsl"/>
>         <map:serialize/>
>     </map:match>
> 
> and if I have a do-delete-** pattern I have to delete the parameter file, 
> and then need to redirect to list.
> 
>       <map:match pattern="do-delete-**">
>         <map:generate src="java/delete.xsp" type="serverpages">
>           <map:parameter name="file" value="{1}"/>
>         </map:generate>
>         <map:redirect-to uri="list"/>
>       </map:match>
> 
> Redirect cannot works:
> Redirection limit for this URL exceeded. Unable to load the requested page. 
> This may be caused by cookies that are blocked.
> 
> How can I combine this?

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