|
From: Stefan K. <ste...@co...> - 2003-07-15 20:41:20
|
Hello,
I have seen that the new RouterPipelineStage has an option wether to copy
the attributes to the new document or not.
I think this should be done generally for all PipelineStage that can split
up documents.
I have the same requirement for XPathSpillter and fixed it into the base
PiplineStage method.
What do you think about introducing a new "standard" stage option, i.e.
"copyAttributes" ?
This could be defaulted to false, so it want break with the existing way.
BTW: During our project we have had tremendous trouble with your
configuration appending mechanism.
I can't give you any more details, I am just happy that we have it now
running.
We ended up with copies of some "config.properties" in our config dir and
removed some from the babeldoc JARs.
We are still on version 1.0, so I am not sure if this is already fixed.
Stefan
protected PipelineStageResult[] processHelper(String[] results)
throws PipelineException, JournalException {
IJournal journal = JournalFactory.getJournal();
PipelineStageResult[] psresults = new
PipelineStageResult[results.length];
String name = this.getNextPipelineStageName();
//Process each of the documents
for (int i = 0; i < results.length; ++i) {
IJournalTicket newTicket = journal.forkTicket(ticket);
PipelineDocument newDoc = new PipelineDocument(results[i].getBytes());
// PATCH: copy attributes
PipelineDocument doc = getDocument() ;
for ( Iterator it = doc.keys().iterator(); it.hasNext() ; ) {
String key = (String) it.next() ;
newDoc.put( key, doc.get( key ) ) ;
}
psresults[i] = new PipelineStageResult(name, newDoc, newTicket);
}
return psresults;
}
|