ePages 6.10 - DE_EPAGES/FactFinder/API/CSV/FactFinderExportDriver.pm

Package DE_EPAGES::FactFinder::API::FactFinderExport

csv export functions

Package DE_EPAGES::FactFinder::API::CSV::FactFinderExportDriver

Functions

GetCategories
GetPrices
addPipes
exportCSV
exportLine
getExportValues
replaceEqualSigns
replaceHashSigns
replaceNewLinesAndQuotes
replacePipes
replaceSemicolonsAndSlashes
writeHeader

GetCategories

returns a refarray to the categories

Syntax
GetCategories($Product, $Locale);
Input
$Product (object)
the product
$Locale (object)
the locale
Return
$hCatHash (hash.ref)
category hash reference
used keys are:
  • CatPath
  • Cat1
  • Cat2
  • Cat3
  • Cat4
  • GetPrices

    returns a string with all the prices in all the active currencies

    Syntax
    GetPrices($Product);
    Input
    $Product (object)
    the product
    $aCurrencies (array.string)
    currencies
    Return
    (string)
    $String

    addPipes

    returns a string, with pipes added to the both ends if not empty

    Syntax
    addPipes($string);
    Input
    $string
    the string
    Return
    (the purified string)
    $string

    exportCSV

    exports data (2 dim. array) into a file. sets default file format parameters : sep_char = "|" , always_quote = 1 , encoding = encoding(utf-8)

    Syntax
    $Exporter->exportCSV($FileName, $hFormat, $aColumns, $ViewObject, $aObjects );
    Input
    $FileName (string)
    export file
    $hFormat (ref.hash)
    export file format
    $aColumns (attribute object)
    column attributes (used for header and values)
    $ViewObject (object)
    FactFinder channel
    $aObjects (ref.array.object)
    list of objects

    exportLine

    Export one line, increments monitor.

    Syntax
    $aProductIDs = $self->exportLine;

    getExportValues

    helper method of exportLine to convert column names to methods names of this exporter and calls the method to get the values of the exported object. The order of return values depends on order of column names.

    Syntax
    $self->getExportValues($Product);
    Input
    $Product (object)
    product
    Return
    $aValues (ref.array.string)
    list of values

    replaceEqualSigns

    returns a string, cleaned from equal signs, pipes, new lines and tabs

    Syntax
    replaceEqualSigns($string);
    Input
    $string
    the string
    Return
    (the purified string)
    $string

    replaceHashSigns

    returns a string, cleaned from hash signs, pipes, new lines and tabs

    Syntax
    replaceHash($string);
    Input
    $string
    the string
    Return
    (the purified string)
    $string

    replaceNewLinesAndQuotes

    returns a string, cleaned from new lines and tabs

    Syntax
    replaceNewLinesAndQuotes($string);
    Input
    $string
    the string
    Return
    (the purified string)
    $string

    replacePipes

    returns a string, cleaned from pipes, new lines and tabs

    Syntax
    replacePipes($string);
    Input
    $string
    the string
    Return
    (the purified string)
    $string

    replaceSemicolonsAndSlashes

    returns a string, cleaned from semicolons, slashes, new lines and tabs

    Syntax
    replaceSemicolonsAndSlashes($string);
    Input
    $string
    the string
    Return
    (the purified string)
    $string

    writeHeader

    writes the header

    Syntax
    $self->writeHeader();