How to Create a Format Definition with CSV Output
Configuration
In order to create a format definition with CSV output, the engine class and format definition parameters must be defined. By default, an example format definition will be included in your copy of AvantGard Trax. CSV is only supported for account statement details and payments.
Constants are written by means of double quotes. If the CF_PF.properties file is appended with constant=”your value here” then the resulting CSV file will contain a final column containing the string: your value here.
Under Message > Format factory > Format definition, the example CSV_AS can be found. Let’s take a look at this in detail to see what is defined here:
Custom engine class = com.trax.message.formatfactory.SeparatedFormatFactoryEngine
The format definition parameters
DelimiterCharacter: The delimiter character is the character which is used in the CSV output file as separator between the columns. Make sure that you choose a value which is not included in your resulting data as this would result in inconsistent columns. It is possible to combine single characters to form a multi-character delimiter.
Mapping: The mapping configuration must be stored in the database as an application property. This property contains the different columns of the CSV file and a reference to determine which information is to be included for that column.
ValueObjectTransformer: this must be com.trax.payment.csv.extractor.EnvelopToPaymentTransformer (Notice the spelling of envelop, this is not a typo in this document) for Payments and com.trax.accountstatement.extractor.InternalClassificationTypeAccountStatementTransformer for account statement details.
DateFormat: The formatting used for dates. By default, this is dd/MM/yyyy but other combinations such as DD/mmm/YYYY are possible
AmountPrecision: The number of decimals which are carried over to the output. By default, four decimals will be used. If the number of decimals is larger than the amount precision, a rounding of the number will be performed, not a truncation.
IncludeHeader: If set to true, the header information is carried over as first line. If not, the top line will simply contain data like all the others. The header line equals all the values listed in the properties file on the left of the “=” mark. As such, the header name of a column is also defined in the properties file. As for the data, the column names should also be separated making use of the specified delimiter
Example
By default, the account statement example which is provided in AvantGard Trax has the following mapping. Note that this mapping always begins from the object transformer entity.
TransactionReferenceNumber=accountStatement/transactionReferenceNumber RelatedReference=accountStatement/relatedReference PrimaryIdentifier=accountStatement/account/primaryIdentifier/identifier StatementNumber=accountStatement/statementNumber SequenceNumber=accountStatement/sequenceNumber
ValueDate=valueDate
EntryDate=entryDate
DebitCreditMark=debitCreditMark/value
FundsCode=fundsCode SignedAmount=signedAmount TransactionType=transactionType/type
TransactionCode=transactionType/code
ReferenceForAccountHolder=referenceForAccountHolder AccountServicingInstitutionReference=accountServicingInstitutionReference SupplementaryDetails=supplementaryDetails CounterpartyPrimaryIdentifier=counterparty/primaryIdentifier CounterpartyName=counterparty/name
GLOffsetAccountCode=GLOffset/accountCode
GLOffsetLedgerCode=GLOffset/ledger/code
GLOffsetName=GLOffset/name
GLCashAccountCode=GLCash/accountCode
GLCashLedgerCode=GLCash/ledger/code
GLCashName=GLCash/name
InternalClassificationType=internalClassificationType/code
Currency=currency
File 158 Mapping Properties