org.apache.cocoon.components.flow.util
Class PipelineUtil

java.lang.Object
  extended byorg.apache.cocoon.components.flow.util.PipelineUtil

public class PipelineUtil
extends Object

Utility class to process a pipeline to various destinations. This class must be setup from the flowscript before being used. This means that instances must be created with cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);

Version:
$Id: PipelineUtil.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Constructor Summary
PipelineUtil()
           
 
Method Summary
protected static org.apache.cocoon.el.objectmodel.ObjectModel getNewObjectModel()
           
protected static Map getObjectModel()
          Helper method to get the current object model.
protected static SourceResolver getSourceResolver()
          Helper method to get the current source resolver.
 Document processToDOM(String uri, Object viewData)
          Process a pipeline and gets is result as a DOM Document
 void processToSAX(String uri, Object viewData, ContentHandler handler)
          Process a pipeline to a SAX ContentHandler
 void processToStream(String uri, Object viewData, OutputStream output)
          Process a pipeline to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipelineUtil

public PipelineUtil()
Method Detail

processToStream

public void processToStream(String uri,
                            Object viewData,
                            OutputStream output)
                     throws IOException
Process a pipeline to a stream.

Parameters:
uri - the pipeline URI
viewData - the view data object
output - the stream where pipeline result is output. Note: this stream is not closed.
Throws:
IOException

processToSAX

public void processToSAX(String uri,
                         Object viewData,
                         ContentHandler handler)
                  throws SAXException,
                         IOException,
                         org.apache.cocoon.ProcessingException
Process a pipeline to a SAX ContentHandler

Parameters:
uri - the pipeline URI
viewData - the view data object
handler - where the pipeline should be streamed to.
Throws:
SAXException
IOException
org.apache.cocoon.ProcessingException

processToDOM

public Document processToDOM(String uri,
                             Object viewData)
                      throws org.apache.cocoon.ProcessingException,
                             SAXException,
                             IOException
Process a pipeline and gets is result as a DOM Document

Parameters:
uri - the pipeline URI
viewData - the view data object
Returns:
the document
Throws:
org.apache.cocoon.ProcessingException
SAXException
IOException

getSourceResolver

protected static SourceResolver getSourceResolver()
Helper method to get the current source resolver.


getObjectModel

protected static Map getObjectModel()
Helper method to get the current object model.


getNewObjectModel

protected static org.apache.cocoon.el.objectmodel.ObjectModel getNewObjectModel()


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.