I just wanted to add a note here to respond to your email about creating a custom processor with no output. You are right; this case is not covered in the current documentation. This is definitely something that we will add in the upcoming 2.0 documentation. Now, to implement custom processor with no output, you need to override the start(PipelineContext) method. I have attached the source of a very simple processor with one input and no output that will display the input XML in System.out.
Alex
Bob Daly wrote:
We're trying to develop a simple prototype using OXF, and it's going to rely on the file system for storage. The bundled file serializer writes an HTML header to the file no matter what, but we need to write & read XML docs (the <content-type> tags seem to have no effect) . I guess my first question is whether or not there is a way around this file serializer HTML header issue.
A custom processor has been written to write XML docs to disk, but I
haven't been able to successfully get this to work either. The class
extends SimpleProcessor and simply attempts to write a file containing
the instance doc passed in. All debug statements in the .xpl before and
after the call to the custom processor do not output to catalina.out. Since there is no output back to the calling .xpl, is it necessary to
have an output parameter? At this point I'm not able to even verify
that the processor is being called. An entry to processors.xml was made
and the processor .jar was placed in the WEB-INF/lib directory, and
there are no complaints from or errors generated from oxf.
Any comments or suggestions are welcomed, thanks!
-bob daly
_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users
package org.orbeon.oxf;
import org.dom4j.Document;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
import org.orbeon.oxf.common.OXFException;
import org.orbeon.oxf.processor.ProcessorInputOutputInfo;
import org.orbeon.oxf.processor.SimpleProcessor;
import org.orbeon.oxf.processor.pipeline.PipelineContext;
import java.io.IOException;
import java.io.StringWriter;
public class SystemOutProcessor extends SimpleProcessor {
public SystemOutProcessor() {
addInputInfo(new ProcessorInputOutputInfo("data"));
}
public void start(PipelineContext context) {
try {
Document dataDocument = readInputAsDOM4J(context, "data");
OutputFormat format = OutputFormat.createPrettyPrint();
format.setIndentSize(4);
StringWriter writer = new StringWriter();
XMLWriter xmlWriter = new XMLWriter(writer, format);
xmlWriter.write(dataDocument);
xmlWriter.close();
System.out.println(writer.toString());
} catch (IOException e) {
throw new OXFException(e);
}
}
}
_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users
