You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Robert Hoffmann (JIRA)" <ji...@apache.org> on 2007/01/27 17:08:49 UTC

[jira] Created: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
------------------------------------------------------------------

                 Key: COCOON-1990
                 URL: https://issues.apache.org/jira/browse/COCOON-1990
             Project: Cocoon
          Issue Type: Bug
          Components: * Cocoon Core
    Affects Versions: 2.1.10
            Reporter: Robert Hoffmann


Hi cocoon developers,

I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...

Test case:

1) Sitemaps:

Root sitemap >>
...
<map:pipeline>

   <map:match pattern="test/**">
     <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>

</map:pipeline>
...<<

Sub sitemap >>
...
 <map:match pattern="A.html">
  <map:redirect-to uri="cocoon:/B.html"/>
 </map:match>

 <map:match pattern="B.html">
  <map:redirect-to uri="http://www.google.com"/>
 </map:match>
...<<

2) NOW: When you request "http://testserver/cocoon/test/A.html"...
you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.

3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
[So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]

3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount

I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).

Many thanks!!!

Robert

PS: Cocoon really rocks!

--
Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Robert Hoffmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469411 ] 

Robert Hoffmann commented on COCOON-1990:
-----------------------------------------

Hi Grzegorz, 

Thanks for your reply! - I tested it again, and it really does not behave as expected.

I included the sitemaps that I used below, and also two "test-cases". 

A) SITEMAPS:
A1) Root sitemap:

...
<map:pipelines>

   <map:pipeline>

      <map:match pattern="test/**">
        <map:mount check-reload="yes" src="test_sub_sitemap.xmap" uri-prefix="test" />
      </map:match>
  </map:pipeline>

 </map:pipelines>
...

!!! Please find the full sitemap at: http://cbio.mskcc.org/~hoffmann/tmp/test_sitemap.xmap


A2) Sub-Sitemap: "test_sub_sitemap.xmap"
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">

 <map:pipelines>

  <map:pipeline>

   <map:match pattern="A1.html">
    <map:redirect-to uri="cocoon://test/B.html"/>
   </map:match>

   <map:match pattern="A2.html">
    <map:redirect-to uri="cocoon:/B.html"/>
   </map:match>

   <map:match pattern="B.html">
    <map:redirect-to uri="http://www.google.com?SUCCESS"/>
   </map:match>

  </map:pipeline>

 </map:pipelines>

</map:sitemap>

B) TEST-CASES:
So there are two test-requests that should both lead to the google page with the word SUCCESS in the URL:

B1) http://server/test/A1.html 
This works because it redirects to the root sitemap.

B2) http://server/test/A2.html
This redirect inside the sub-sitemap does not work (against my expectations).

C) ENV:
- OS X 10.4.8
- Processor: Intel
- Java version "1.5.0_06"
- Cocoon: 2.1.10



> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Vadim Gritsenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549634 ] 

Vadim Gritsenko commented on COCOON-1990:
-----------------------------------------

Alfred, do you mean to say that with this fix, sitemap and root sitemap no longer can be in the same directory?

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Alfred Nathaniel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549708 ] 

Alfred Nathaniel commented on COCOON-1990:
------------------------------------------

Vadim, sub-sitemap and root sitemap can be in the same directory.  Only, before I put my hands on the code, cocoon:/ could not be used in the sub-sitemap (it would be interpreted as cocoon://).

I am not completely sure that the latest version with the explicit check for cocoon:// works, because there may be additional effects due to the MutableEnvironmentFacade case.  If that turns out to be the case, I propose to revert to the original version, which has been working for years, except for the recently discovered corner case.

Jörg, I agree, that the hardwired "cocoon://" check is not the most appealing solution.  But given the facts that 2.1 is in maintenance mode, 2.2 already has a completely different code in that area, and people are discussion a deprecation of the cocoon; protocol, I am pragmatic and don't think it is worthwhile to invest much more effort on this.  I only would want to have a working solution in 2.1.11.

Of course, if you feel like it, you are welcome to do it better.

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Alfred Nathaniel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alfred Nathaniel closed COCOON-1990.
------------------------------------

    Resolution: Fixed

That was a weird way to find out, whether it was a redirect to the root sitemap.
I now put in a direct check:

        ConcreteTreeProcessor processor = this;
        if (uri.startsWith("cocoon://"))
            processor = ((TreeProcessor)getRootProcessor()).concreteProcessor;

Please try again if that also fixes your use case.
If not, we should revert to the old code.
That works except for the easy-to-avoid case of root sitemap and sub-sitemap placed in the same directory.


> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Andreas Hartmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548602 ] 

Andreas Hartmann commented on COCOON-1990:
------------------------------------------

Here's the stack trace:

java.io.FileNotFoundException: /Users/nobby/apache/lenya/clean/trunk/src/modules-core/usecase/global-sitemap.xmap (No such file or directory)

full exception chain stacktraceorg.apache.cocoon.ProcessingException: Sitemap: error calling function 'executeUsecase'
	at <map:call> - file:///Users/nobby/apache/lenya/clean/trunk/src/modules-core/usecase/usecase.xmap:104:45
	at <map:mount> - file:///Users/nobby/apache/lenya/clean/trunk/build/lenya/webapp/lenya/usecase.xmap:55:131
	at <map:mount> - file:///Users/nobby/apache/lenya/clean/trunk/build/lenya/webapp/global-sitemap.xmap:288:105
	at <map:mount> - file:///Users/nobby/apache/lenya/clean/trunk/build/lenya/webapp/sitemap.xmap:712:106

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Alfred Nathaniel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alfred Nathaniel reassigned COCOON-1990:
----------------------------------------

    Assignee: Alfred Nathaniel

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549894 ] 

Jörg Heinicke commented on COCOON-1990:
---------------------------------------

But the code you tried to backport from 2.2 did neither work. So is 2.2 so different that it works there or is it broken as well?

The deprecation is not a valid argument IMO. We are not yet talking about removing it ...

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by Vadim Gritsenko <va...@reverycodes.com>.
On Dec 8, 2007, at 7:24 AM, Alfred Nathaniel wrote:

> On Fri, 2007-12-07 at 23:09 -0500, Vadim Gritsenko wrote:
>> On Dec 7, 2007, at 10:37 PM, Jörg Heinicke (JIRA) wrote:
>>
>>> Also I don't like the idea of checking for a particular protocol. In
>>> theory somebody could have implemented its own protocol doing
>>> something similar as cocoon://.
>>
>> You do not even need a theory :) Simply edit cocoon.xconf, and use  
>> any
>> protocol you like.
>>
>> <component-instance name="sitemap"
>> class 
>> ="org.apache.cocoon.components.source.impl.SitemapSourceFactory"/>
>
> Unfortunately, that is only a theoretical possibility.  There are
> already 11 places where startsWith("cocoon:") is hardwired in the  
> code.

True... Hm, I'm not even sure how to avoid hardcoding it... May be we  
should just legalize this, define a constant somewhere -  
COCOON_PROTOCOL = "cocoon:";

Vadim

Re: [jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by Alfred Nathaniel <an...@apache.org>.
On Fri, 2007-12-07 at 23:09 -0500, Vadim Gritsenko wrote:
> On Dec 7, 2007, at 10:37 PM, Jörg Heinicke (JIRA) wrote:
> 
> >
> >    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel 
> > #action_12549643 ]
> >
> > Jörg Heinicke commented on COCOON-1990:
> > ---------------------------------------
> >
> > Also I don't like the idea of checking for a particular protocol. In  
> > theory somebody could have implemented its own protocol doing  
> > something similar as cocoon://.
> 
> You do not even need a theory :) Simply edit cocoon.xconf, and use any  
> protocol you like.
> 
> <component-instance name="sitemap"
>                       
> class="org.apache.cocoon.components.source.impl.SitemapSourceFactory"/>
> 
> 
> Vadim

Unfortunately, that is only a theoretical possibility.  There are
already 11 places where startsWith("cocoon:") is hardwired in the code.

Cheers, Alfred.



Re: [jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by Vadim Gritsenko <va...@reverycodes.com>.
On Dec 7, 2007, at 10:37 PM, Jörg Heinicke (JIRA) wrote:

>
>    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel 
> #action_12549643 ]
>
> Jörg Heinicke commented on COCOON-1990:
> ---------------------------------------
>
> Also I don't like the idea of checking for a particular protocol. In  
> theory somebody could have implemented its own protocol doing  
> something similar as cocoon://.

You do not even need a theory :) Simply edit cocoon.xconf, and use any  
protocol you like.

<component-instance name="sitemap"
                      
class="org.apache.cocoon.components.source.impl.SitemapSourceFactory"/>


Vadim

[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549643 ] 

Jörg Heinicke commented on COCOON-1990:
---------------------------------------

Also I don't like the idea of checking for a particular protocol. In theory somebody could have implemented its own protocol doing something similar as cocoon://.

What about cocoon:/ vs. cocoon://?

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Andreas Hartmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548606 ] 

Andreas Hartmann commented on COCOON-1990:
------------------------------------------

java.io.FileNotFoundException: /Users/nobby/apache/lenya/clean/trunk/src/modules-core/usecase/global-sitemap.xmap (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	at org.apache.excalibur.source.impl.FileSource.getInputStream(FileSource.java:153)
	at org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper.getInputStream(DelayedRefreshSourceWrapper.java:68)
	at org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:191)
	at org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:140)
	at org.apache.cocoon.components.treeprocessor.DefaultTreeBuilder.build(DefaultTreeBuilder.java:367)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.buildConcreteProcessor(TreeProcessor.java:341)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.setupConcreteProcessor(TreeProcessor.java:306)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:252)
	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
	at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.handleCocoonRedirect(ConcreteTreeProcessor.java:300)
	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.access$000(ConcreteTreeProcessor.java:48)
	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor$TreeProcessorRedirector.cocoonRedirect(ConcreteTreeProcessor.java:341)
	at org.apache.cocoon.environment.ForwardRedirector.redirect(ForwardRedirector.java:60)
	at org.apache.cocoon.components.flow.AbstractInterpreter.forwardTo(AbstractInterpreter.java:210)
	at org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.forwardTo(FOM_JavaScriptInterpreter.java:865)
	at org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.forwardTo(FOM_Cocoon.java:701)
	at org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.jsFunction_sendPage(FOM_Cocoon.java:270)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:145)
	at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:471)
	at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3085)
	at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2251)
	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:161)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758)
	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:159)
	at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:915)
	at org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.callFunction(FOM_JavaScriptInterpreter.java:764)
	at org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:139)

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Alfred Nathaniel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alfred Nathaniel closed COCOON-1990.
------------------------------------

                     Resolution: Fixed
                  Fix Version/s: 2.1.11-dev (Current SVN)
    Affects version (Component): Parent values: Components: Sitemap(10152). 
        Fix version (Component): Parent values: Components: Sitemap(10229). 

Fixed in 2.1.11-dev.
Never was an issue for 2.2.

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Andreas Hartmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549979 ] 

Andreas Hartmann commented on COCOON-1990:
------------------------------------------

Alfred, thanks a lot for the fix! It is working in Lenya again.

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Andreas Hartmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549099 ] 

Andreas Hartmann commented on COCOON-1990:
------------------------------------------

ConcreteTreeProcessor:287

        // Get the processor that should process this request
        ConcreteTreeProcessor processor;
        if ( newEnv.getURIPrefix().equals("") ) {
            processor = ((TreeProcessor)getRootProcessor()).concreteProcessor;
        } else {
            processor = this;
        }

Why does the selection of the processor depend on the URI prefix?
In our case the sub-sitemap is mounted based on a request parameter.
Should in this case all sendPageAndWait() calls from flowscript end up in the root sitemap?
If yes - why is the context directory not the directory where the sitemap is actually located?

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Alfred Nathaniel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546916 ] 

Alfred Nathaniel commented on COCOON-1990:
------------------------------------------

Your case does not work only because the sub-sitemap is in the same directory as the root sitemap.  If you move it to a sub-directory as in

  <map:mount check-reload="yes" src="subdir/test_sub_sitemap.xmap" uri-prefix="test" />

then it works.  The problem is here in ConcreteTreeProcessor: 

          // Get the processor that should process this request
          ConcreteTreeProcessor processor;
!         if (newEnv.getRootContext().equals(newEnv.getContext())) {
              processor = ((TreeProcessor)getRootProcessor()).concreteProcessor;
          } else {
              processor = this;
          }

In 2.2 that reads (already since 2004):

          // Get the processor that should process this request
          ConcreteTreeProcessor processor;
!         if ( newEnv.getURIPrefix().equals("") ) {
              processor = ((TreeProcessor)getRootProcessor()).concreteProcessor;
          } else {
              processor = this;
          }

I don't have the time right now to backport that fix to 2.1.  I'll do it later if nobody else steps in beforehand.

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Grzegorz Kossakowski (aka g[R]eK) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468210 ] 

Grzegorz Kossakowski (aka g[R]eK) commented on COCOON-1990:
-----------------------------------------------------------

I couldn't reproduce this issue. I've put into build/webapp/test these sitemaps:

sitemap.xmap:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:pipelines>
    <map:pipeline>
      <map:match pattern="test2/**">
        <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test2"/>
      </map:match>
  </map:pipeline>
  </map:pipelines>
</map:sitemap>
{code}

subsitemap.xmap:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:pipelines>
    <map:pipeline>
    <map:match pattern="A.html">
      <map:redirect-to uri="cocoon:/B.html"/>
    </map:match>
    <map:match pattern="B.html">
      <map:redirect-to uri="http://www.wp.pl"/>
    </map:match>
  </map:pipeline>
  </map:pipelines>
</map:sitemap>
{code}

Could you attach simple sitemaps where bug shows up?
Also include version of your OS, Cocoon and Java.

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (COCOON-1990) Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount

Posted by "Andreas Hartmann (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Hartmann reopened COCOON-1990:
--------------------------------------


The fix (revision 600218) causes problems in Apache Lenya. It can be reproduced with the Lenya default publication (standard installation). You'll find more information on the Lenya users list:

http://www.nabble.com/Error-tf4933528.html

The involved sitemaps are

webapp/sitemap.xmap - mounts
webapp/global-sitemap.xmap - mounts
modules-core/usecase/usecase.xmap - calls function in
modules-core/usecase/usecases.js - sendPageAndWait()

This causes

java.io.FileNotFoundException: [...]/modules-core/usecase/global-sitemap.xmap (No such file or directory) 

> Redirect bug WITHIN sub sitemap WHEN using uri-prefix in map:mount
> ------------------------------------------------------------------
>
>                 Key: COCOON-1990
>                 URL: https://issues.apache.org/jira/browse/COCOON-1990
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.10
>            Reporter: Robert Hoffmann
>            Assignee: Alfred Nathaniel
>             Fix For: 2.1.11-dev (Current SVN)
>
>
> Hi cocoon developers,
> I found the following problem with redirects within sub-sitemaps WHEN using the uri-prefix in map:mount...
> Test case:
> 1) Sitemaps:
> Root sitemap >>
> ...
> <map:pipeline>
>    <map:match pattern="test/**">
>      <map:mount check-reload="yes" src="subsitemap.xmap" uri-prefix="test" />     </map:match>
> </map:pipeline>
> ...<<
> Sub sitemap >>
> ...
>  <map:match pattern="A.html">
>   <map:redirect-to uri="cocoon:/B.html"/>
>  </map:match>
>  <map:match pattern="B.html">
>   <map:redirect-to uri="http://www.google.com"/>
>  </map:match>
> ...<<
> 2) NOW: When you request "http://testserver/cocoon/test/A.html"...
> you should get redirected to B.html WITHIN the sub sitemap (that's why we use 'cocoon:/B.html' and not 'cocoon://B.html')...
> BUT the redirect does NOT work correctly, hence we will not get the google-site which would be the correct result.
> 3) The cocoon.log says: http-11080-Processor23/CocoonServlet: No pipeline matched request: test/B.html !!!
> [So it seems to me that the uri-prefix from the sub-sitemap mount is added in the this redirect, which might be why it does not match then within the sub-sitemap.]
> 3) Important: This only goes wrong when using the uri-prefix[-remove] attribute in map:mount
> I hope this detailed test case will be helpful to one of the cocoon gurus... I really would hate if I had to use redirects to the ROOT sitemap (that's not the idea of sub sitemaps).
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.