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

java.lang.Object
  extended by org.apache.cocoon.components.flow.util.PipelineUtil
All Implemented Interfaces:
Disposable, Contextualizable, Serviceable

public class PipelineUtil
extends Object
implements Contextualizable, Serviceable, Disposable

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:
CVS $Id: PipelineUtil.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Sylvain Wallez

Constructor Summary
PipelineUtil()
           
 
Method Summary
 void contextualize(Context context)
           
 void dispose()
           
 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.
 void service(ServiceManager manager)
           
 
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

dispose

public void dispose()
Specified by:
dispose in interface Disposable

contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

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,
                         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
ProcessingException

processToDOM

public Document processToDOM(String uri,
                             Object viewData)
                      throws 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:
ProcessingException
SAXException
IOException


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