You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robert Sösemann <ro...@gmx.de> on 2002/11/23 13:00:34 UTC

Communication between Sitmap and Action

I have this matcher with an action which passes 2 parameters to the included
generator. Also the generator must use the two parameters that are given to
him.

 ######### SITEMAP ###########################
...
    <map:match pattern="**item_*.html">
        <map:act type="url-extract">
            <map:generate src="logicsheets/item_view.xsp" type="xsp">
                <map:parameter name="article_id" value="{2}"/>
                <map:parameter name="base-path" value="/rauser-cocoon"/>
            </map:generate>
        </map:act>
...
########### ACTION url-extract #######################
...
    request.setAttribute("unterrubrik", unterrubrik);
    request.setAttribute("oberrubrik", oberrubrik);

    Map sitemapParams = new HashMap();

    return sitemapParams;
...
########### XSP item_view.xsp #######################
...
        <xsp:attribute
name="BASEPATH"><xsp:expr>parameters.getParameter("base-path","default_value
")</xsp:expr></xsp:attribute>

        <esql:connection>
            <esql:pool>mysql_pool</esql:pool>

            <esql:execute-query>
                <esql:query>
                    SELECT o.verzeichnis, o.titel, o.id, u.verzeichnis,
u.titel, i.id, i.ueberschrift, i.pdfdruck , i.bild, i.zusammenfassung,
i.text, i.erstellungsdatum, b.name, i.typ_kuerzel
                    FROM infoitem i, benutzer b, unterrubrik u, oberrubrik o
                    WHERE i.id =
<xsp:expr>parameters.getParameter("article_id","default_value")</xsp:expr>
                    AND b.kuerzel = i.benutzer_kuerzel
                    AND i.unterrubrik_id = u.id
                    AND u.oberrubrik_id = o.id
                    AND u.verzeichnis = '<xsp-request:get-attribute
name="unterrubrik"/>'
                    AND o.verzeichnis = '<xsp-request:get-attribute
name="oberrubrik"/>'
                </esql:query>
                <esql:results>
        ...
################

Is it correct to access their value in the item_view.xsp like that? I always
get: "Error compiling item_view_xsp: Line 0, column 0: error: variable
debug_enabled might already have been assigned to 1 error "??????

Maybe some can help me?!



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Communication between Sitmap and Action

Posted by Joerg Heinicke <jo...@gmx.de>.
Hi Robert,

I can see at least one thing:

Robert Sösemann wrote:
> I have this matcher with an action which passes 2 parameters to the included
> generator. Also the generator must use the two parameters that are given to
> him.
> 
>  ######### SITEMAP ###########################
> ...
>     <map:match pattern="**item_*.html">
>         <map:act type="url-extract">
>             <map:generate src="logicsheets/item_view.xsp" type="xsp">
>                 <map:parameter name="article_id" value="{2}"/>

This has to be {../2} ------------------------------------^^^.

Joerg

>                 <map:parameter name="base-path" value="/rauser-cocoon"/>
>             </map:generate>
>         </map:act>
> ...
> ########### ACTION url-extract #######################
> ...
>     request.setAttribute("unterrubrik", unterrubrik);
>     request.setAttribute("oberrubrik", oberrubrik);
> 
>     Map sitemapParams = new HashMap();
> 
>     return sitemapParams;
> ...
> ########### XSP item_view.xsp #######################
> ...
>         <xsp:attribute
> name="BASEPATH"><xsp:expr>parameters.getParameter("base-path","default_value
> ")</xsp:expr></xsp:attribute>
> 
>         <esql:connection>
>             <esql:pool>mysql_pool</esql:pool>
> 
>             <esql:execute-query>
>                 <esql:query>
>                     SELECT o.verzeichnis, o.titel, o.id, u.verzeichnis,
> u.titel, i.id, i.ueberschrift, i.pdfdruck , i.bild, i.zusammenfassung,
> i.text, i.erstellungsdatum, b.name, i.typ_kuerzel
>                     FROM infoitem i, benutzer b, unterrubrik u, oberrubrik o
>                     WHERE i.id =
> <xsp:expr>parameters.getParameter("article_id","default_value")</xsp:expr>
>                     AND b.kuerzel = i.benutzer_kuerzel
>                     AND i.unterrubrik_id = u.id
>                     AND u.oberrubrik_id = o.id
>                     AND u.verzeichnis = '<xsp-request:get-attribute
> name="unterrubrik"/>'
>                     AND o.verzeichnis = '<xsp-request:get-attribute
> name="oberrubrik"/>'
>                 </esql:query>
>                 <esql:results>
>         ...
> ################
> 
> Is it correct to access their value in the item_view.xsp like that? I always
> get: "Error compiling item_view_xsp: Line 0, column 0: error: variable
> debug_enabled might already have been assigned to 1 error "??????
> 
> Maybe some can help me?!


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>