Hi Eric!

> addInput() is called when the pipeline engine is connecting inputs to
> outputs, so this should allow you at runtime to know exactly all the
> inputs that are connected. This is the mechanism used by the XSLT
> processor, for example, to get additional inputs.
>
> This is as opposed to getInputsInfo(), which returns the InputInfo
> declared statically by the processor.
>
> When exactly are you calling getInputs()? Maybe you are calling the
> method prior to the processor being conneced.

Here is a snipplet from my code:
  public ListInput() {
    addInputInfo( new ProcessorInputOutputInfo( "required-input" ) );
    addOutputInfo( new ProcessorInputOutputInfo( "list" ) );
  }

  public void generateList( PipelineContext pipelineContext,
                            ContentHandler contentHandler ) {
    try {
      Map inputMap = getInputs();
      Set keySet = inputMap.keySet();
      Iterator it = keySet.iterator();
      contentHandler.startDocument();
      contentHandler.startElement( "", "inputs", "inputs",
                                   new AttributesImpl() );
      while ( it.hasNext() ) {
 String inputName = (String)it.next();
 addStringElement( contentHandler, "input", inputName );
 logger.debug( "generateList: input="+inputName );
      }
      contentHandler.endElement( "", "inputs", "inputs" );
      contentHandler.endDocument();
    } catch ( Exception e ) {
      throw new OXFException( e );
    }
  }

and this is the except from my .xpl-file:
 <p:processor name="oxf:java">
  <p:input name="config">
   <config sourcepath="oxf:/" class="ListInput"/>
  </p:input>
  <p:input  name="required-config">
   <config>
    <name>Martin</name>
   </config>
  </p:input>
  <p:input  name="optional-input"  href="#instance"/>
  <p:output name="list"            id="save-list"/>
 </p:processor>

Both in the log and in the output to what I forward the list I only see 
"required-input", not "optional-input".

The complete example is in the attached .jar-file (if you can read, please 
send me a note, Eric!).

Thanks a lot,

Martin

Attachment: listinput.jar
Description: application/jar

Reply via email to