You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <vg...@yahoo.com> on 2001/07/24 04:29:08 UTC

Sitemap handler & environment state

Hello,

I've got question: why handler's process method alters environment state
and does not restores it? The releveant code snippet:

    public boolean process(Environment environment) throws Exception {
        checkSanity();
        try {
            environment.setSourceHandler(this.sourceHandler);
            return sitemap.process(environment);
        } finally {
            environment.setSourceHandler(null);
        }
    }

After process() is invoked, no processing can be done in parent
sitemap (if any), which in turn means that no <map:handle-error>
pipelines might be executed.

Right now I'm going for walk-around: surround process() with
environment pushURI() and popURI() calls.

Vadim

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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


AW: Sitemap handler & environment state

Posted by Carsten Ziegeler <cz...@sundn.de>.
Yes, you're right this is a bad behaviour. I think we should add a
getSourceHandler()
method to the environment and change the snipped below, so that the
process() method
restores the source handler previously set.
This would avoid the push/pop calls.

(Sorry for this late response, I'm way behind my emails.


Carsten

Open Source Group                        sunShine - b:Integrated
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                          mailto: cziegeler@sundn.de
================================================================

> Vadim Gritsenko wrote
>
> Hello,
>
> I've got question: why handler's process method alters environment state
> and does not restores it? The releveant code snippet:
>
>     public boolean process(Environment environment) throws Exception {
>         checkSanity();
>         try {
>             environment.setSourceHandler(this.sourceHandler);
>             return sitemap.process(environment);
>         } finally {
>             environment.setSourceHandler(null);
>         }
>     }
>
> After process() is invoked, no processing can be done in parent
> sitemap (if any), which in turn means that no <map:handle-error>
> pipelines might be executed.
>
> Right now I'm going for walk-around: surround process() with
> environment pushURI() and popURI() calls.
>
> Vadim
>
>
> _________________________________________________________
>
> Do You Yahoo!?
>
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


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