anil pisze:
> Hi -
> 
> Could someone clarify whether it's possible for me to use the processToDOM
> function in pipelineUtil to talk to a pipeline from another block's sitemap?

It's not possible. PipelineUtil class has been designed before servlet: 
protocol's advent and was
limited to cocoon: protocol by design. This class is completely block-unaware 
and its use (at least
for now) should be avoided.

> I've tried a number of different ways to address the pipeline within the
> other block but each time I have received a No pipeline matched request
> error.
> 
> The syntax I've used to address the pipeline (i.e. the first parameter to
> the processToDOM function) is as follows:
> 
> servlet:rmm-search:/transformForSolr
> 
> /rmm-search/transformForSolr
> 
> The first parameter is supposed to be a URI but the documentation for
> processPipelineTo (which I believe processToDOM is built on top of) says
> that the url cannot contain a scheme, so I didn't expect the first option
> above to work.
> 
> The documentation for processPipelineTo does say that if the pipeline URI
> beings with a / then cocoon will process the request from the root sitemap,
> so I thought that may work. Unfortunately not.
> 
> If someone could clarify how I should address the pipeline in my other block
> I'd be really grateful? 

One of the goals behind Servlet Service Framework was coherence so the rule is 
to always reference
pipelines from other blocks the same way. Having said that, you must use this 
URI:

  servlet:rmm-search:/transformForSolr

As noted above, this won't work with PipelineUtil but will work with 
SourceUtil#toDOM[1]. All you
need is Source representation of your URI. You can get it using 
SourceResolver[2] which can be
obtained using

  cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);

NOTE: Don't forget to release obtained source and resolver itself!

This method can be treated as a work-around so patches improving this situation 
are welcome.

> I wondered is there any way I can call a pipeline in block that my
> flowscript is running from, get the parameter in that local pipeline and
> then forward the request on to the other block & receive the result back in
> flowscript?

You can access pipelines from current block by omitting connection's name when 
using servlet: protocol.

[1]
http://cocoon.apache.org/2.2/core-modules/core/2.2/apidocs/org/apache/cocoon/components/source/SourceUtil.html#toDOM(org.apache.excalibur.source.Source)
[2] 
http://excalibur.apache.org/apidocs/org/apache/excalibur/source/SourceResolver.html

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to