|
From: Dejan K. <dej...@ya...> - 2003-04-25 09:08:32
|
Hi Erik, getOptions methods are used for getting values of configuration options. By default Velocity templatization is performed on option values. If you need to get option value without templatization use methods getOptions(optionName, false). If you have option with multiple suboptions use getOptionList method (look in Enrich, XpathExtract and some other stage's source). There are some other methods fot getting options but they are used rarely if used at all. (I think we need some refactorings here. For example, I think that it would be more natural if method getOptions is called getOption since it gets only one option. There are unused methods here too...) AdditionalInfo was workaround for solving some problems specific to my project that was not implemented in Babeldoc. Basicly, you can use it in pipeline stages to store some information in Journal like exception message or anything else. I am not very satisfied with this solution and I am open to some other solutions here. get() method in PipelineDocument is used for getting attribute values from document. There are some other get methods here which gets some specific attribute so they are just shortcuts (getName, getMimeType). PipelineStageResult object represents result of operation. It is used for specifying where document should go after processing in one stage. In most cases you don't need to deal with PipelineStageResult. There are helpers methods that are used for creating PipelineStageResult objects. Since most stages just performs some operation on a document you can call processHelper method that will just create PipelineStageResult object with current document, current ticket and nextStage and will return it in array. There are also situations where you perform some operations that changes document. XslTransform, XslFoTransform and few other stages are exampe of this. In this case you will create a new document and call processHelper(PipelineDocument) method. Some stages performs operations that results in more that one document (XPathSplitter) or routes same document on different stages (Router). In this case you shoud create PipelineStageResult[] array by yourself. Dejan --- ek...@ba... wrote: > Also, when/where would I want to use "Options" from > the PipelineStage? > > I guess I need to know the usage, source, and > differences between: > -- PipelineStage Options > -- PipelineStage AdditionalInfo > -- PipelineDocument get( ) methods > -- PipelineStageResult array from > PipelineStage.process( ) method > > as well as how to get at the information from the > input to babeldoc (my > XML and specific tags within it, for example) > > Thanks. Good night. > > ---------------------- Forwarded by Erik > Klein/NY/DOMESTIC/BNY on 04/24/2003 05:50 PM > --------------------------- > To: bab...@li... > cc: > Subject: Simple Question > > This might sound simple to you, but I am trying to > do something basic and > want to verify. > > My input to babeldoc is an XML string. I want to be > able to reference > tags from the XML String from within the stages of > the pipeline. One of > my PipelineStages is the Script stage (I am using > Jython). I want to > reference some of the XML tags from within the > script but have had no luck > using document.get(<tagName>). > > A few questions: > 1. Should I be using the XPath Pipeline Stage to > extract the wanted tags > and use document.put(<tagName>,<tagValue>) so that > my later Script stage > can use document.get(<tagName)? > 2. If so, where would I find some decent > documentation/examples for coding > XPath? > 3. Should I use the Enrich Pipeline Stage instead? > 4. Is there a better way to do this than my above > approach? > > Thanks in advance. > > > > ________________________________________________________________________ > The information in this e-mail, and any attachment > therein, is confidential and for use by the > addressee only. If you are not the intended > recipient, please return the e-mail to the sender > and delete it from your computer. Although The Bank > of New York attempts to sweep e-mail and attachments > for viruses, it does not guarantee that either are > virus-free and accepts no liability for any damage > sustained as a result of viruses. __________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com |