PPP configuration for preparsers

The PPP configuration for preparsers combines the two configuration items for the preprocessing. PPP stands for preparser properties. A PPP file is a special properties file, so please also refer to section Structure of property files.

In the file you first specify the complete classname of the preparser class in property preparser.class.name. Then you specify the normal properties for the preparser itself.


This allows you to


  • share the preparser configuration as a simple text file,

  • use preparser classes that are not selectable in the combo box,

  • more simply configure the ChainPreParser for chaining several preparsers,

  • use a preparser in a Response with the PreParserPostExecuter,

  • call a preparser in function call-preparser(),

  • switch between different configurations for the PreParserPostExecuter with variables.

Preconditions


  • Important: The configuration of a preparser with a PPP file is only possible for those preparsers that expect the path to a configuration file as configuration parameter.

  • The preparser configuration file has to be in folder ./conf, or a subfolder and

  • the configuration file has to have the ending .ppp and

  • the configuration file has to define a property preparser.class.name with the full class name of the preparser and

  • the class has to be found in the classpath.


If the .ppp file uses variables with the syntax @VAR_VARNAME@, they are resolved during runtime, if they are defined in the profile.

Configuration as preparser


  • The .ppp file is saved in folder ./conf.

  • In the preprocessing on page Advanced Settings select the preparser PPPLauncher and the .ppp file as its configuration file.

  • If the configuration is correct and the class can be found in the classpath, the class name will be displayed in the left field.

Example for a ".ppp" file for the EncodingPatcher


ConvertOemAsciiTo8859_1.ppp
#############################################################################
# properties for class com.ebd.hub.datawizard.parser.stream.EncodingPatcher #
#############################################################################
preparser.class.name=com.ebd.hub.datawizard.parser.stream.EncodingPatcher
# Tranform umlauts from OEM/ASCII to ANSI/8859-1
0x8e=0xc4
0x99=0xd6
0x9a=0xdc
0xe1=0xdf
0x84=0xe4
0x94=0xf6
0x81=0xfc

Configuration as postexecuter


  • Choose com.ebd.hub.datawizard.postexec.PreParserPostExecuter as postexecuter class in phase 6, or in phase 5.

  • Set the path to the .ppp configuration file of the preparser.


The PreParserPostExecuter will start the preparser specified in the .ppp file and manipulate the destination data accordingly. The path to the .ppp file can also be specified by using a variable in syntax @VARNAME@.

Note: An incorrect configuration will cause a runtime error.

Use of the PPP configuration for the ChainPreParser


The ChainPreParser chains several preparsers. If for example, you want to decrypt a GPG encrypted file and after that, transform some of the content with the EncodingPatcher, the following configuration of the ChainPreParser can be used.

GpgDecryptAndCharReplacement.ppp
############################################################################
# properties for class com.ebd.hub.datawizard.parser.stream.ChainPreParser #
############################################################################
preparser.class.name=com.ebd.hub.datawizard.parser.stream.ChainPreParser
#
# GPG decryption by calling a GPG program.
#
ChainPosition.0=./conf/GPG_decrypt.ppp
#
# EncodingPatcher transforms umlauts from OEM/ASCII to ANSI/8859-1.
#
ChainPosition.1=./conf/ConvertOemAsciiTo8859_1.ppp

GPG_decrypt.ppp
# sample properties for Preparser: com.ebd.hub.datawizard.parser.SystemCallPreParser
preparser.class.name=com.ebd.hub.datawizard.parser.SystemCallPreParser
#command is mandatory
#here: call of gpg. Note: PATH is not used to locate the command file.
# for calling a shell script or batch: start command processor (/bin/bash or C:/Windows/cmd.exe) with
# appropriate syntax
# gpg -d -o - - means: call gpg for decryption, use stdout (-o -) and stdin (-),
# keystore may not have a password!
command=C:/Programme/GNU/GnuPG/gpg.exe -d -o - -
# timeout for idle stdout. Each byte from command's stdout will reset the time. Default: 10000 (=10 sec)
#timeout=300000
# current directory for processing command. Default: <IS>
#directory=C:/tmp
# charset for error messages from command's stderr. Default: profile encoding
#charset=8859_1
# additional environment variable (here: HOME) for command. If already set in IS start env, the value is
# replaced.
#ENV.HOME=C:/users/demo