cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <>
Subject global sitemap variables bug.
Date Tue, 01 Apr 2003 14:59:17 GMT
What I found may be a bug in {global:XXX} input module
First the sitemap then the explanation:
<map:pipeline type="noncaching">
    <map:match pattern="stylesheets/*">
        <map:generate src="stylesheets/{1}"/>
    <map:match pattern="picker/**">
        <map:mount check-reload="yes" reload-method="synchron" src="picker/" uri-prefix="picker"/>

A part of sub sub sitemap that matches "picker/**" looks like this:
<map:pipeline type="noncaching">
    <map:match pattern="form/*">
        <map:generate src="data/{1}/form.xml"/>
        <map:transform src="cocoon://{global:baseURL}/stylesheets/reportform2html.xsl">
            <map:parameter name="baseURL" value="/{global:baseURL}"/>
        <map:transform type="simpleform"/>
    <map:match pattern="data/*/*/*">
        <map:generate type="serverpages" src="data/{1}/content.xsp"/>
        <map:transform src="stylesheets/picker-table.xsl">
            <map:parameter name="baseURL" value="/{global:baseURL}"/>
            <map:parameter name="formname" value="{2}"/>
            <map:parameter name="fieldname" value="{3}"/>
    <map:match pattern="content/*/*/*">
        <map:select type="request-parameter">
            <map:parameter name="parameter-name" value="visited"/>
            <map:when test="1">
                <map:act type="form-validator">
                    <map:parameter name="descriptor" value="data/{1}/form-descriptor.xml"/>
                    <map:parameter name="validate-set" value="main"/>
                    <map:aggregate element="content">
                        <map:part src="cocoon:/form/{../1}" strip-root="true"/>
                        <map:part src="cocoon:/data/{../1}/{../2}/{../3}"/>
        <map:aggregate element="content">
            <map:part src="cocoon:/form/{1}"/>
         | 1 - picker source
         | 2 - form name
         | 3 - field name
    <map:match pattern="*/*/*">
        <map:aggregate element="root">
            <map:part src="cocoon://content/{1}/{2}/{3}"/>
        <map:transform src="cocoon://{global:baseURL}/stylesheets/site2html.xsl">
            <map:parameter name="baseURL" value="/{global:baseURL}"/>
        <map:serialize type="html"/>

The default view (<map:match pattern="*/*/*">) is being constructed of :
1. the form displayed on top of the page
2. results from database (filtered with data entered in form) if form has been

My cocoon serves a lot of subsitemaps (serveral web applications in one web
application). Sometimes several versions of the same application exist in the
same cocoon space so I needed the way to distinguish between them.
The "main subsitemap" contains global variable definition named baseURL that I
add to all links. What's wrong then?

If you request
http://localhost:8080/myapp01/picker/form/pickername - this part of the page
gets properly rendered but if you request:

you get an error:
Unable to get transformer handler for

which leads us to this line of code:
<map:generate src="data/{1}/form.xml"/>
<map:transform 	src="cocoon://{global:baseURL}/stylesheets/reportform2html.xsl">
    <map:parameter name="baseURL" value="/{global:baseURL}"/>
When requesting "form/pickername"
"cocoon://{global:baseURL}/stylesheets/reportform2html.xsl" gets resolved to :
"cocoon://myapp01/stylesheets/reportform2html.xsl" but it does not resolve
when "content/pickername/formname/fieldname" gets requested.

Is it a bug ?

         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/          _\\()//_
         .'/()\'.     Phone: +48(600)341118     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |

View raw message