Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Date:

Author:

Version:

Changes:

Ext.

Int.

Is in Core

Jira Ref.

21 December 2010Kilroy

Davide Silvestre

0.1

Doc. created

x

 

N/A

 

02 November 2015Karuna Thulluri0.2Added details about GenericXMLFiller  N/A 
26 November 2015Karuna Thulluri0.3Updated Value Formatter details    

Description

The purpose of this document is to provide a description of the configuration of XML Cdr files, so that they can be read correctly by the Service Providers.

...

Code Block
languagesql
Select vrrec.* from VOUCHER_EXPORT_RECORD vr where vr.VOUCHER_EXPORT_RECORDS recwhere rec.SOURCE_ID = <BILLING_SOURCE_ID> order by vrrec.id;

Example value for XML_DOCUMENT_DEF.SQL_RELOAD_RECORDS column can be:

Code Block
languagesql
Select vrrec.* from VOUCHER_EXPORT_RECORD vr where vr.VOUCHER_EXPORT_RECORDS recwhere rec.SOURCE_ID = <BILLING_SOURCE_ID> and vrrec.id > <MAX_LOADED_ID> order by vrrec.id;

If there are 20,000 records, then the GenericXMLFiller uses the SQL-queries configured in the above parameter tree entries corresponding XML_DOCUMENT_DEF entry like this:

  • The query from RECORDSQL_RETRIEVELOAD_SQL parameter RECORDS column is used to load the first batch of records (10000) .
  • If there are more records to be added to the same XML-file and the reload_method on one of the XML_TAG_DEF entries is set to 'reloadRecords', the SQL from RECORD_RETRIEVE_SQL_WITH_ID_GREATERTHAN_CLAUSE parameter RELOAD_RECORDS column is used to load the next batches, with 10000 max rows selected in each subsequent batch, until all pending records have been added to the file.

...

Detailed description of XmlFillerBillingRecords and XmlFillerIdl can be found here: Xml Cdr Exporterat /wiki/spaces/Technology/pages/126782302  (internal link).

3.4 - ValueFormatter

The value formatter has been introduced in order to be able to configure the formatting of objects. Here a formatter class and a pattern can be specified that will be used to generate a string.

...

_CLASSClass used to
NAMEFormatter name
CODEFormatter code
DESCRIPTIONDescribes the purpose of the formatter
VALUE_CLASS

Defines the input for the formatter (i.e. java.util.Date or java.lang.Number or java.lang.String)

Important Note: The formatter should be chosen based on the actual value type. If the value type is not compatible with the java type defined in VALUE_FORMATTER

.VALUE_CLASS, the formatting fails and hence file generation fails.

  • If the value to be formatter is a String, then use a Value_Formatter that has the VALUE_CLASS = 'java.lang.String'
  • If the value to be formatter is a Number type (int or long or Amount or float or Integer etc..), then use a Value_Formatter that has the VALUE_CLASS = 'java.lang.Number'
  • If the value to be formatter is a Date, then use a Value_Formatter that has the VALUE_CLASS = 'java.util.Date'
FORMATTER_CLASSClass used to format (i.e. com.CDRator.billing.utils.formatter.DateFormatter)
FORMATTER_METHODUsually it is format
FORMATTER_EXPRESSION

Pattern used to convert the object

in the

to formatted string

(i.e.

. This is optional for the formatters that do not require a pattern to be defined.

Examples:

  • “dd.MM.yyyy”
or
  • to format a Date object to a string in this format
  • “#,##0.00”
)
  • to format a Number to decimal format String
NULL_VALUEValue returned if the input object is null. This is optional and defaults to null.

4 - Example of Generation

...