ePages 6.11.0 - DE_EPAGES/Presentation/API/CSV/MonitoredImportHandler.pm

Package DE_EPAGES::Presentation::API::CSV::MonitoredImportHandler

This a base for your servlet driven imports of comma-separated files. Overwrite the readLines function to implement a custom CSV format.

Base
DE_EPAGES::Core::API::CSV::BaseImportHandler
Example
use DE_EPAGES::Presentation::API::CSV::MonitoredImportHandler;
DE_EPAGES::Presentation::API::CSV::MonitoredImportHandler->importCSV(
    'Products.csv', {}, $Shop );

Functions

importCSV
importLine
monitor
monitorContent
monitorIncrement
object
readLines

importCSV

Imports data from a CSV file.

Syntax
$Package->importCSV($FileName, $hFormat, $ViewObject);
Input
$FileName (string)
import file
$hFormat (ref.hash)
import file format
$ViewObject (object)
object to view monitor

importLine

Imports one data line, get the line element (object) from function topID('Item'). Updates the attribute value if the object already exists, otherwise creates a new object.

Syntax
$self->importLine();

monitor

Return the progress monitor.

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

monitorContent

Writes the monitor page to a file.

Syntax
$self->monitorContent;

monitorIncrement

Increments the monitor counter.

Syntax
$self->monitorIncrement;

object

Returns the current view object (central object for imported objects).

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

readLines

Sets the class of importable objects to "Object". Reads all lines of the CSV file via $self->SUPER::readLines().

Syntax
$self->readLines();