ePages 6.10 - DE_EPAGES/Presentation/API/CSV/MonitoredExportDriver.pm

Package DE_EPAGES::Presentation::API::CSV::MonitoredExportDriver

This a base for your servlet driven exports of comma-separated files. Overwrite the drive function to implement a custom CVS file format.

Base
DE_EPAGES::Core::API::CSV::BaseExportDriver
Example
use DE_EPAGES::Presentation::API::CSV::MonitoredExportDriver;
my $Driver = DE_EPAGES::Presentation::API::CSV::MonitoredExportDriver->new;
my $Class = LoadClassByAlias('Product');
my @Columns = map { $Class->attribute($_) } qw( Alias Name );
$Driver->exportCSV( $FileName, {}, \@Columns, $Shop, $aObjects->get('Products') );

Functions

exportCSV
exportLine
monitor
monitorContent
monitorIncrement
object
writeHeader

exportCSV

Exports objects to a comma-separated file.

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)
object to view monitor
$aObjects (ref.array.object)
list of objects

exportLine

Exports one data line, get the line element (object) from function topID('Item') get attribute value from object, writes line. Increments the progress monitor.

Syntax
$self->exportLine();

monitor

Returns the progress monitor object.

Syntax
$Monitor = $self->monitor;
Return
$Monitor (object)
progress monitor

monitorContent

Write the monitor page to a file.

Syntax
$self->monitorContent;

monitorIncrement

Increments the monitor counter.

Syntax
$self->monitorIncrement;

object

Return the current view object (central object for exported objects).

Syntax
$Object = $self->object;
Return
$Object (object)
object

writeHeader

Writes the header line using the attribute alias names of the columns.

Syntax
$self->writeHeader();