Le mardi 08 f�vrier 2005 � 16:50 +0100, Erik Bruchez a �crit :
> Eric van der Vlist wrote:
>
> > Where can I get and/or see it?
>
> Actually the CVS and nightly build are moving so I'll let Dan answer
> this question once dust has settled down.
>
> This said I haven't added anything that hasn't been mentioned on this
> thread.
OK.
> >From what I see, the thing would be:
> >
> > * Derive a processor from ProcessorImpl.
>
> Yes.
>
> > * The actions (since there will be outputs) will be triggered
> > through the createOutput() method that expects a ProcessorOutput
> > object.
>
> Yes.
>
> > * This return object can be derived from
> > ProcessorImpl.ProcessorOutputImpl and the only abstract method
> > which is abstract and requires to be overloaded (if you have no
> > dynamic outputs) is readImpl that sends the output as a stream
> > of SAX events --the delegation processor doesn't overload any
> > other methods.
>
> Yes.
>
> > * The other methods to overload in
> > ProcessorImpl.ProcessorOutputImpl seem to deal with dynamic
> > outputs, cache and validation and I don't find it obvious to
> > guess their roles from the code. Could you briefly explain what
> > they are used for?
>
> Ouch. I don't think I want to venture into the methods that deal with
> caching just now,
I didn't mean to require a detailed explanation :-) ...
If I want to implement dynamic outputs (even without caching for the
time being), which of these methods do I need to implement and what is
the minimal implementation?
I must be missing something since when I try this (very sub-minimal)
implementation:
public class ArchiveConverter extends ProcessorImpl {
public ArchiveConverter() {
}
/* (non-Javadoc)
* @see
org.orbeon.oxf.processor.Processor#start(org.orbeon.oxf.pipeline.api.PipelineContext)
*/
public void start(PipelineContext pipelineContext) {
}
public ProcessorOutput createOutput(final String name) {
ProcessorOutput output = new ProcessorImpl.ProcessorOutputImpl(
getClass(), name) {
public void readImpl(PipelineContext context,
ContentHandler contentHandler) {
readInputAsSAX(context, "manifest",
contentHandler);
}
};
addOutput(name, output);
return output;
}
}
with this pipeline:
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:oxf="http://www.orbeon.com/oxf/processors">
<p:processor name="oxf:java">
<p:input name="config">
<config sourcepath="file:///usr/local/eclipse/workspace/XMLfr/"
class="org.xmlfr.orbeon.ArchiveConverter"/>
</p:input>
<p:input name="manifest" debug="manifest">
<empty/>
</p:input>
<p:output name="whatever" id="manifest-out" debug="manifest-out"/>
</p:processor>
<p:processor name="oxf:xml-serializer">
<p:input name="config">
<config>
<content-type>application/xml</content-type>
<method>xml</method>
<indent>true</indent>
<version>1.0</version>
<encoding>utf-8</encoding>
</config>
</p:input>
<p:input name="data" href="#manifest-out"/>
</p:processor>
</p:config>
I get the following exception:
2005-02-08 18:19:31,141 ERROR org.orbeon.oxf.pipeline.InitUtils null -
Exception with no location data
java.lang.NullPointerException
at
org.orbeon.oxf.processor.JavaProcessor$1.readImpl(JavaProcessor.java:68)
at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:945)
at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$ConcreteProcessorFilter$ForwarderProcessorOutput.read(ProcessorImpl.java:899)
at
org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:340)
at
org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:345)
at
org.orbeon.oxf.processor.DebugProcessor$1.readImpl(DebugProcessor.java:62)
at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:945)
at
org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1106)
(note that the exception is raised by the xml serialzer and that I don't
see my processor in the stack.
.../...
> Still, the basics are pretty simple, i.e. you can write a simple
> processor in 30 seconds,
Yes, I have done that for my lucene processor :-) ...
> but if you plan to add dynamic outputs,
> caching, etc. things become slightly more complex.
I can see that too!
Thanks,
Eric
--
Tired of typing XML tags?
http://wikiml.org
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
orbeon-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/orbeon-user