You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Leszek Gawron <lg...@mobilebox.pl> on 2004/06/10 20:22:06 UTC
cocoon:/ pseudoprotocol bug - test case
could anybody try to confirm what I see?:
make a test directory. put this sitemap there:
> <?xml version="1.0"?>
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> <map:pipelines>
> <map:pipeline>
> <map:match pattern="*_cf">
> <map:generate type="request"/>
> <map:serialize type="xml"/>
> </map:match>
> <map:match pattern="*_llf">
> <map:aggregate element="aggregate">
> <map:part src="cocoon:/{1}_cf"/>
> </map:aggregate>
> <map:serialize type="xml"/>
> </map:match>
> <map:match pattern="index1">
> <map:aggregate element="sitepage">
> <map:part src="cocoon:/test_llf" element="test"/>
> </map:aggregate>
> <map:serialize type="xml"/>
> </map:match>
> <map:match pattern="index2">
> <map:aggregate element="sitepage">
> <map:part src="cocoon://test/test_llf" element="test"/>
> </map:aggregate>
> <map:serialize type="xml"/>
> </map:match>
> </map:pipeline>
> </map:pipelines>
> </map:sitemap>
request: http://localhost:8888/test/test_lff - works
request: http://localhost:8888/test/index1 - works
request: http://localhost:8888/test/index2 - does not work
the error will tell you that test_cf was not matched. It looks for
test_cf in the main sitemap and not in test/test_cf - clearly looks like
wrong context.
This sample uses one sitemap only but http://localhost:8888/test/index2
simulates calling other sitemap.
change this:
> <map:match pattern="*_llf">
> <map:aggregate element="aggregate">
> <map:part src="cocoon:/{1}_cf"/>
> </map:aggregate>
> <map:serialize type="xml"/>
> </map:match>
into this:
> <map:match pattern="*_llf">
> <map:aggregate element="aggregate">
> <map:part src="cocoon://test/{1}_cf"/>
> </map:aggregate>
> <map:serialize type="xml"/>
> </map:match>
and all links will work
Look like if you generate your multiply aggregated sources and use
cocoon:// pseudo protocol subsequent calls to cocoon:/ will fail finding
no match because they will be resolved in wrong context.
If you keep using only global cocoon:// protocol everything will work.
If you keep everything in single sitemap and use cocoon:/ only it will
also work.
sorry for code quotations. I still do not get it why my Mozilla
Thunderbird got "Paste without formatting" disabled.
--
Leszek Gawron lgawron@mobilebox.pl
Re: cocoon:/ pseudoprotocol bug - test case
Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 11 juin 04, à 14:21, Leszek Gawron a écrit :
> Vadim Gritsenko wrote:
>
>> Leszek Gawron wrote:
>>> I checked current HEAD today - the problem is still there.
>> Can you write anteater test for it?
> If only I get to know how - I will.
There's some info at
http://wiki.cocoondev.org/Wiki.jsp?page=TestingFramework
It's fairly easy if you look at the existing test scripts, for example
src/test/anteater/calc.xml
-Bertrand
Re: cocoon:/ pseudoprotocol bug - test case
Posted by Leszek Gawron <lg...@mobilebox.pl>.
Vadim Gritsenko wrote:
> Leszek Gawron wrote:
>
>> I checked current HEAD today - the problem is still there.
>
>
>
> Can you write anteater test for it?
If only I get to know how - I will.
--
Leszek Gawron lgawron@mobilebox.pl
Re: cocoon:/ pseudoprotocol bug - test case
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Leszek Gawron wrote:
> I checked current HEAD today - the problem is still there.
Can you write anteater test for it?
Vadim
> Leszek Gawron wrote:
>
>> could anybody try to confirm what I see?:
>>
>> make a test directory. put this sitemap there:
>>
>>> <?xml version="1.0"?>
>>> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>>> <map:pipelines>
>>> <map:pipeline>
>>> <map:match pattern="*_cf">
>>> <map:generate type="request"/>
>>> <map:serialize type="xml"/>
>>> </map:match>
>>> <map:match pattern="*_llf">
>>> <map:aggregate element="aggregate">
>>> <map:part src="cocoon:/{1}_cf"/>
>>> </map:aggregate>
>>> <map:serialize type="xml"/>
>>> </map:match>
>>> <map:match pattern="index1">
>>> <map:aggregate element="sitepage">
>>> <map:part src="cocoon:/test_llf" element="test"/>
>>> </map:aggregate>
>>> <map:serialize type="xml"/>
>>> </map:match>
>>> <map:match pattern="index2">
>>> <map:aggregate element="sitepage">
>>> <map:part src="cocoon://test/test_llf"
>>> element="test"/>
>>> </map:aggregate>
>>> <map:serialize type="xml"/>
>>> </map:match>
>>> </map:pipeline>
>>> </map:pipelines>
>>> </map:sitemap>
>>
>>
>>
>> request: http://localhost:8888/test/test_lff - works
>> request: http://localhost:8888/test/index1 - works
>> request: http://localhost:8888/test/index2 - does not work
>>
>> the error will tell you that test_cf was not matched. It looks for
>> test_cf in the main sitemap and not in test/test_cf - clearly looks
>> like wrong context.
>>
>> This sample uses one sitemap only but
>> http://localhost:8888/test/index2 simulates calling other sitemap.
>>
>> change this:
>>
>>> <map:match pattern="*_llf">
>>> <map:aggregate element="aggregate">
>>> <map:part src="cocoon:/{1}_cf"/>
>>> </map:aggregate>
>>> <map:serialize type="xml"/>
>>> </map:match>
>>
>>
>> into this:
>>
>>> <map:match pattern="*_llf">
>>> <map:aggregate element="aggregate">
>>> <map:part src="cocoon://test/{1}_cf"/>
>>> </map:aggregate>
>>> <map:serialize type="xml"/>
>>> </map:match>
>>
>>
>> and all links will work
>>
>> Look like if you generate your multiply aggregated sources and use
>> cocoon:// pseudo protocol subsequent calls to cocoon:/ will fail
>> finding no match because they will be resolved in wrong context.
>>
>> If you keep using only global cocoon:// protocol everything will work.
>> If you keep everything in single sitemap and use cocoon:/ only it
>> will also work.
>>
>> sorry for code quotations. I still do not get it why my Mozilla
>> Thunderbird got "Paste without formatting" disabled.
>>
>
>
Re: cocoon:/ pseudoprotocol bug - test case
Posted by Leszek Gawron <lg...@mobilebox.pl>.
I checked current HEAD today - the problem is still there.
Leszek Gawron wrote:
> could anybody try to confirm what I see?:
>
> make a test directory. put this sitemap there:
>
>> <?xml version="1.0"?>
>> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>> <map:pipelines>
>> <map:pipeline>
>> <map:match pattern="*_cf">
>> <map:generate type="request"/>
>> <map:serialize type="xml"/>
>> </map:match>
>> <map:match pattern="*_llf">
>> <map:aggregate element="aggregate">
>> <map:part src="cocoon:/{1}_cf"/>
>> </map:aggregate>
>> <map:serialize type="xml"/>
>> </map:match>
>> <map:match pattern="index1">
>> <map:aggregate element="sitepage">
>> <map:part src="cocoon:/test_llf" element="test"/>
>> </map:aggregate>
>> <map:serialize type="xml"/>
>> </map:match>
>> <map:match pattern="index2">
>> <map:aggregate element="sitepage">
>> <map:part src="cocoon://test/test_llf"
>> element="test"/>
>> </map:aggregate>
>> <map:serialize type="xml"/>
>> </map:match>
>> </map:pipeline>
>> </map:pipelines>
>> </map:sitemap>
>
>
> request: http://localhost:8888/test/test_lff - works
> request: http://localhost:8888/test/index1 - works
> request: http://localhost:8888/test/index2 - does not work
>
> the error will tell you that test_cf was not matched. It looks for
> test_cf in the main sitemap and not in test/test_cf - clearly looks like
> wrong context.
>
> This sample uses one sitemap only but http://localhost:8888/test/index2
> simulates calling other sitemap.
>
> change this:
>
>> <map:match pattern="*_llf">
>> <map:aggregate element="aggregate">
>> <map:part src="cocoon:/{1}_cf"/>
>> </map:aggregate>
>> <map:serialize type="xml"/>
>> </map:match>
>
> into this:
>
>> <map:match pattern="*_llf">
>> <map:aggregate element="aggregate">
>> <map:part src="cocoon://test/{1}_cf"/>
>> </map:aggregate>
>> <map:serialize type="xml"/>
>> </map:match>
>
> and all links will work
>
> Look like if you generate your multiply aggregated sources and use
> cocoon:// pseudo protocol subsequent calls to cocoon:/ will fail finding
> no match because they will be resolved in wrong context.
>
> If you keep using only global cocoon:// protocol everything will work.
> If you keep everything in single sitemap and use cocoon:/ only it will
> also work.
>
> sorry for code quotations. I still do not get it why my Mozilla
> Thunderbird got "Paste without formatting" disabled.
>
--
Leszek Gawron lgawron@mobilebox.pl