Package DE_EPAGES::CSVExportImport::API::CSV::ObjectImportHandler
This module implements a handler to import objects
Base |
DE_EPAGES::Presentation::API::CSV::MonitoredImportHandler |
Example |
use DE_EPAGES::CSVExportImport::API::CSV::ObjectImportHandler; DE_EPAGES::CSVExportImport::API::CSV::ObjectImportHandler->importCSV($FileName, $hFileFormat, $ViewObject); |
Functions
- analyzeHeaderLine
- attributes
- baseAttributeClassAlias
- drive
- getUsedAttribute
- headerColumn
- importCSV
- importLine
- importObject
- languages
- locale
- modifyUsedAttributes
- readLines
- startMonitor
- testHeaderColumn
- testMissingFields
analyzeHeaderLine
analyzes the headerline, gets the header columns via function $self->header Calls for each column function getUsedAttribute, modifyUsedAttributes. Calls function testMissingFields.
Syntax |
my $hUsedAttributes = $self->analyzeHeaderLine(); |
Return |
|
attributes
return the possible Attributes
Syntax |
$hhAttributes = $self->attributes; |
Return |
|
baseAttributeClassAlias
return Base AttributeClass Alias, here : 'Object'
Syntax |
$self->baseAttributeClassAlias(); |
Return |
|
drive
starts the monitor 'CSVImportMonitor', set Monitor 'Total' to $self->linesCount and starts the import of data via $self->SUPER::drive()
Syntax |
$self->drive(); |
getUsedAttribute
return attribute info, called by analyzeHeaderLine throws Error 'UNKNOWN_ATTR' if $hHeader->{'AliasString'} isn't a key of $self->attributes call function testHeaderColumn before return $hAttribute
Syntax |
$self->getUsedAttribute($HeaderString, $ColumnIndex); |
Input |
|
Return |
|
headerColumn
returns everything between[] eg: Jacket/InstructionManual/de $aHeaderParts='ARRAY(0x9943360)' [0] => 'Jacket' [1] => 'InstructionManual' [2] => 'de' used by function getUsedAttribute
Syntax |
my $hHeaderInfo = $self->headerColumn($HeaderString, $Index); |
Input |
|
Return |
|
importCSV
imports data (2 dim. array) into a file.
Syntax |
$importer->importCSV($FileName, $hFormat, $aAttributes, $ViewObject); |
Input |
|
importLine
imports one data line via function importObject, increments the monitor if $self->monitor is defined
Syntax |
$self->importLine(); |
importObject
dummy function which have to be overwritten, gets the current line with $self->topID('Item');
Syntax |
$self->importObject(); |
languages
return the languages for attributes
Syntax |
$ahLanguages = $self->languages; |
Return |
|
locale
return the current Locale
Syntax |
$Locale = $self->locale; |
Return |
|
modifyUsedAttributes
possibility to change $hUsedAttributes, called by analyzeHeaderLine only dummy function here
Syntax |
$self->modifyUsedAttributes($hUsedAttributes, $ColumnIndex); |
Input |
|
readLines
reads the content lines
Syntax |
$self->readLines(); |
startMonitor
starts the monitor
Syntax |
$self->startMonitor($PageTypeName); |
Input |
|
testHeaderColumn
possibility to test $hHeader, called by getUsedAttribute only dummy function here
Syntax |
$self->testHeaderColumn($hAttribute, $hHeader, $ColumnIndex); |
Input |
|
testMissingFields
possibility to test for mandatory columns, called by analyzeHeaderLine only dummy function here
Syntax |
$self->testMissingFields($hUsedAttributes); |
Input |
|