You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Thomas Markus <t....@proventis.net> on 2010/01/28 15:18:15 UTC

Bug in pipeline handling in C2.2

Hi,

it seems there is a bug in pipeline handling via flowscript in C2.2

http://cocoon.apache.org/2.2/blocks/flowscript/1.0/1382_1_1.html says in
function sendPage:
"uri is the sitemap URI of the page to be sent back to the client. If
the URI starts with a slash, it is resolved starting at the root
sitemap, otherwise it is resolved relative to the current sitemap. The
URI should not contain a scheme (such as cocoon:)."

that's ok in C2.1 (tested). In C2.2 a cocoon.sendPage("test.jx"); starts
always in root sitemap
"test.jx" should transform to a cocoon://test.jx call and "/test.jx" to
a cocoon:/test.js

this new block is mounted at /

with mvn jetty:run an access to http://localhost:8888/ should generate
only one line in console
sitemapURI=

but there are always 2:
sitemapURI=
sitemapURI=test.jx


whats wrong here?

regards
Thomas

my files:

sitemap.xmap:
------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://apache.org/cocoon/sitemap/1.0
http://cocoon.apache.org/schema/sitemap/cocoon-sitemap-1.0.xsd"
    xmlns:map="http://apache.org/cocoon/sitemap/1.0">

    <map:pipelines>
        <map:pipeline>
            <map:act type="log">
                <map:parameter name="level" value="info" />
                <map:parameter name="message"
value="sitemapURI={request:sitemapURI}" />
                <map:parameter name="console" value="true" />
            </map:act>

            <map:mount src="test/test.xmap" uri-prefix="" />
        </map:pipeline>
    </map:pipelines>

</map:sitemap>
------------------------------------------------------------------------

test/test.xmap
------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://apache.org/cocoon/sitemap/1.0
http://cocoon.apache.org/schema/sitemap/cocoon-sitemap-1.0.xsd"
    xmlns:map="http://apache.org/cocoon/sitemap/1.0">

    <map:pipelines>
        <map:pipeline>
            <map:mount src="test/test.xmap" uri-prefix="" />
        </map:pipeline>

    </map:pipelines>

</map:sitemap>
------------------------------------------------------------------------

test/test/test.xmap
------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://apache.org/cocoon/sitemap/1.0
http://cocoon.apache.org/schema/sitemap/cocoon-sitemap-1.0.xsd"
    xmlns:map="http://apache.org/cocoon/sitemap/1.0">

    <map:flow language="javascript" />

    <map:pipelines>
        <map:pipeline>
            <map:match pattern="**.jx">
                <map:generate src="test.xmap" />
                <map:serialize type="xml" />
            </map:match>
            <map:call function="test" />
        </map:pipeline>

    </map:pipelines>
</map:sitemap>
------------------------------------------------------------------------

test/test/flow/test.js
------------------------------------------------------------------------
function test() {
    cocoon.sendPage("test.jx");
}
------------------------------------------------------------------------


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