on 6/27/03 11:48 AM Stefano Mazzocchi wrote:

> As for implementing this, I planned to look into this today.

Ok, I dived into the code and I found where the problem is. The call to
the sitemap invocation is located in the class

 org.apache.cocoon.components.flow.AbstractInterpreter

and explicitly in the methods process(...) and forwardTo(...)

IIRC, the forwardTo() method was written by Ovidiu and uses a sitemap
redirector. The process() method was written by Pier and directly
obtains the pipeline and invoques it from the sitemap.

I would love to see the different approaches unified, whichever is
easier to adapt.

Both end up calling the method process(...) of the o.a.c.Processor
interface while (if I'm not mistaked) they should be calling the
processInternal() method.

In short, the flow ends up emulating a request as it came from the
outside, while it should emulate it as it came from the inside (as the
cocoon: protocol does)

Now, the change between process() and processInternal() is not that
trivial because the second returns a ProcessingPipeline while the first
returns a boolean and I have no clue on what I should do with that
pipeline, expecially regarding how to setup the environment and all
those things. I've patched it locally but I end up screwing up the
environment (I suppose) and I end up having NPE on component .release()
which is not nice at all.

Looking around the code I found the following code

 Object processKey = CocoonComponentManager.startProcessing(newEnv);
 try {
   if (!this.internal) {
     processingResult = usedProcessor.process(newEnv);
   } else {
     ProcessingPipeline pp = usedProcessor.processInternal(newEnv);
     if (pp != null) pp.release();
     processingResult = pp != null;
   }
 } finally {
   CocoonComponentManager.endProcessing(newEnv, processKey);
 }

in o.a.c.Environment.ForwardRedirector, can anybody explain what the
hell does it mean that the processing results depends on the result of
releasing the processing pipeline?

But more important, can anybody with sufficient knowledge of the tree
processor internals help us poor people having the flow calling
processInternal() instead of process()?

TIA

-- 
Stefano.


Reply via email to