Class Adios2XmlPipe

All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, HasTransactionAttribute, IConfigurable, IForwardTarget, IPipe, IScopeProvider, IWithParameters, NameAware, EventThrowing, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle

@Forward(name="noConversionForwardName", description="when successful, but no conversion took place") @Category(NN_SPECIAL) public class Adios2XmlPipe extends FixedForwardPipe
Transforms between ascii-ADIOS and an XML representation of ADIOS.

Sample xml:


 <adios rekenbox="L76HB150">
     <rubriek naam="BER_VERZ_CD" waarde="COMBIFLEX_BELEGGING" />
     <rubriek naam="INBR_CD" waarde="NIEUWE_VERZEKERING" />
     <rubriek naam="PENS_DT_BEP_CD"  waarde="DT_UIT_PENS_LFT" />
     <rubriek nummer="313" naam="AS_OPSL_PRD_TRM_PRM" index="3" recordnr="74" record="VUT_VERZEKERING" waarde="52.34" />
     ...
 </adios>
 

For input, a 'naam' or a 'nummer'-attribute must be specified. If both are specified, their match is checked. On output, 'nummer', 'naam' and 'waarde'-attributes are always present in each rubriek-element. Where applicable 'index', 'recordnr', 'record' and 'recordindex' are present, too. If sub-records exist, they are present with a 'sub' prefix to all attributes.

Author:
Gerrit van Brakel
  • Field Details

  • Constructor Details

    • Adios2XmlPipe

      public Adios2XmlPipe()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from class: FixedForwardPipe
      Checks for correct configuration of forward.
      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class FixedForwardPipe
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • doPipe

      public PipeRunResult doPipe(Message message, PipeLineSession session) throws PipeRunException
      Description copied from interface: IPipe
      This is where the action takes place. Pipes may only throw a PipeRunException, to be handled by the caller of this object. Implementations must either consume the message, or pass it on to the next Pipe in the PipeRunResult. If the result of the Pipe does not depend on the input, like for the FixedResultPipe, the Pipe can schedule the input to be closed at session exit, by calling Message.closeOnCloseOf(PipeLineSession) This allows the previous Pipe to release any resources (e.g. connections) that it might have kept open until the message was consumed. Doing so avoids connections leaking from pools, while it enables efficient streaming processing of data while it is being read from a stream.
      Throws:
      PipeRunException
    • initializeConversionTables

      protected void initializeConversionTables() throws ConfigurationException
      Throws:
      ConfigurationException
    • findRekenbox

      public String findRekenbox(PipeLineSession session)
    • makeAdios

      public String makeAdios(InputSource bericht, PipeLineSession session) throws PipeRunException
      Throws:
      PipeRunException
    • makeXml

      public String makeXml(String s, PipeLineSession session) throws PipeRunException
      The calcbox tool Adios exports the file "NNRSCONS.PAS" = adiosDefinities in configuration attributes. this file containts both "rubrieken" and "records" which together form the adios message te be send to the calcbox the most difficult format used is record[recordindex],label[index]:waarde; mind the delimiters,where a record has or hasnot an indexnummer and a label likewise.
      Throws:
      PipeRunException
    • addItem

      public void addItem(String item, XmlBuilder builder, Map nummer2naam, String naamLabel, String nummerLabel, String indexLabel)
    • setAdiosDefinities

      public void setAdiosDefinities(String newAdiosDefinities)
      sets URL to the pascal file with label-constants generated by the ADIOS-utility.
      Default value
      nnrscons.pas
    • getAdiosDefinities

      public String getAdiosDefinities()
    • setDirection

      public void setDirection(Adios2XmlPipe.Direction direction)
      Transformation direction.
      Default value
      Adios2Xml
    • getDirection

      public Adios2XmlPipe.Direction getDirection()
    • setRekenbox

      public void setRekenbox(String newRekenbox)
      Sets name of the rekenbox to be called
    • getRekenbox

      public String getRekenbox()
    • setRekenboxSessionKey

      public void setRekenboxSessionKey(String newRekenboxSessionKey)
      Name of the SessionKey to retrieve the rekenbox name from
    • getRekenboxSessionKey

      public String getRekenboxSessionKey()
    • setNoConversionForwardName

      public void setNoConversionForwardName(String string)
      Sets the name of the forward used when no conversion to XML was performed, because the input was already XML.
      Default value
      noconversion
    • getNoConversionForwardName

      public String getNoConversionForwardName()