cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Hunsberger <>
Subject Re: POST XML to cocoon protocol
Date Thu, 27 Jan 2005 15:18:46 GMT
n Thu, 27 Jan 2005 00:04:22 -0500, Irv Salisbury III <> wrote:
> I want to use the CIncludeTransformer to call another pipeline and pass
> it XML using the POST mechanism.  Before posting this question, I tried
> to make my way through the Source code, eventually finding my way to the
> SitemapSource class.  It doesn't look like the cocoon: protocol allows
> for POST.  Is this the case?
> I guess a side question is, is there a better way to pass XML to another
> cocoon pipeline as input to it.  It is pretty easy to call another
> pipeline and get its output, but I want to pass XML to another cocoon
> pipeline.
> I'd be fine with a solution that uses flowscript.

Don't have time to figure out exactly what you want, but from
flowscript you can invoke another pipeline using processPieplineTo.

    var sourceURI = "run/_validate/"+collection;
    var destinationURI = "xmodule:request-attr:validate";

    var resolver = null;
    var destination = null;
    try {
        resolver = cocoon.getComponent( );
        destination = resolver.resolveURI( destinationURI );
        output = destination.getOutputStream();
        cocoon.processPipelineTo( sourceURI, {}, output );
    finally {
        if (destination != null) {
            resolver.release( destination );
        cocoon.releaseComponent( resolver );

As others note, you can set a requestAttribute in the pipeline and
have the generator of the other pipeline pick it up, you can also
communicate back to the flowscript from the invoked pipeline this way,

       cocoon.request.setAttribute( "y", y );


       var x =  cocoon.request.getAttribute( "x" );

where the request attributes can be any object (more or less)...

Peter Hunsberger

View raw message