package com.telegraph.online.orbeon; import java.io.InputStream; import java.io.PipedInputStream; import org.orbeon.oxf.pipeline.api.PipelineContext; import org.orbeon.oxf.processor.ProcessorInputOutputInfo; import org.xml.sax.ContentHandler; /** * A template for creating SimpleProcessor classes with access to an InputStream. See {@link StreamingSimpleProcessorBase} * for more information. * * @author Henrik Pettersen, ©Sparkling Ideas, 2008 */ public class StreamingProcessorTemplate extends StreamingSimpleProcessorBase { /** * Constructor declares inputs and outputs, like we do for all SimpleProcessor extensions. * See Orbeon Forms documentation. */ public StreamingProcessorTemplate() { addInputInfo(new ProcessorInputOutputInfo(INPUT_DATA)); addOutputInfo(new ProcessorInputOutputInfo(OUTPUT_DATA)); } /** * All input and output parameter names have been declared in the constructor (see Orbeon Forms documentation). * Multiple inputs to the SimpleProcessor are allowed, and so we must specifu which one of these inputs * we would like to generate an inputstream for. This method returns the name of this XML document. Also * see constructor above. */ protected String getStreamingInputName(){ return INPUT_DATA; } /* (non-Javadoc) * @see com.telegraph.online.orbeon.StreamingSimpleProcessorBase#generateStreamingData(org.orbeon.oxf.pipeline.api.PipelineContext, org.xml.sax.ContentHandler, java.io.InputStream) */ @Override public void generateStreamingData(PipelineContext context, ContentHandler contentHandler, InputStream pipedInputStream) throws Throwable { // TODO Your implementation goes here } /* (non-Javadoc) * @see com.telegraph.online.orbeon.StreamingSimpleProcessorBase#generateData(org.orbeon.oxf.pipeline.api.PipelineContext, org.xml.sax.ContentHandler) * WARNING: Please do not make any changes to this function. This function is here because of an issue with how * Orbeon Forms uses reflection to invoke these classes. */ @Override public void generateData(PipelineContext context, ContentHandler contentHandler) throws Throwable { super.generateData(context, contentHandler); } }