Package DE_EPAGES::Product::API::CSV::ProductTypeImportHandler
This module implements a handler to import producttypes
Base |
DE_EPAGES::ShopCSVExportImport::API::CSV::ShopObjectImportHandler |
Example |
use DE_EPAGES::Product::API::CSV::ProductTypeImportHandler; DE_EPAGES::Product::API::CSV::ProductTypeImportHandler->importCSV($FileName, $hFileFormat, $Shop); |
Functions
- analyzeAttributeLine
- baseAttributeClassAlias
- importObject
- importSpecialData
- modifyUsedAttributes
- testHeaderColumn
- testMissingFields
analyzeAttributeLine
Analyzes the current line in the CSV file and fills the object data hash with information for the actual import. Uses $self->topID('Item') as input, which contains the list of values in the current line.
Syntax |
my $hAttributeValues = $self->analyzeAttributeLine(); |
Return |
|
baseAttributeClassAlias
return Base AttributeClass Alias, here : 'ProductType'
Syntax |
$self->baseAttributeClassAlias(); |
Return |
|
importObject
calls $hAttributeValues = $self->analyzeAttributeLine, return if (not defined $hAttributeValues or $hAttributeValues->{'DoNotImport'}) if the object exists, it should be at $hAttributeValues->{'Object'} then a $Object->set($hAttributeValues->{'DirectAttributes'}) is called else $Class must exists $hAttributeValues->{'DirectAttributes'}{'Class'} then calls $Class->insertObject($hAttributeValues->{'DirectAttributes'}); then calls foreach language id keys %{ $hAttributeValues->{'LocalizedAttributes'}} : my $hInfo = $hAttributeValues->{'LocalizedAttributes'}{$LanguageID}; $Object->set($hInfo, $LanguageID); calls function $self->importSpecialData($Object, $hAttributeValues); to give the possibility to save more data
Syntax |
$self->importObject; |
importSpecialData
possibility to import special object data, called by importObject saves template design
Syntax |
$self->importSpecialData($Object, $hAttributeValues); |
Input |
|
modifyUsedAttributes
add keys: $hUsedAttributes->{$ColumnIndex}{'IsAliasColumn'} = $hUsedAttributes->{$ColumnIndex}{'Alias'} eq 'Alias' ? 1 : 0; $hUsedAttributes->{'AliasColumn'} with value=$ColumnIndex if $hUsedAttributes->{$ColumnIndex}{'IsAliasColumn'}; $hUsedAttributes->{$ColumnIndex}{'IsProductAttributeAliasColumn'} = $hUsedAttributes->{$ColumnIndex}{'Alias'} eq 'Alias' ? 1 : 0; $hUsedAttributes->{'AliasProductAttributeColumn'} with value=$ColumnIndex if $hUsedAttributes->{$ColumnIndex}{'IsProductAttributeAliasColumn'}; $hUsedAttributes->{$ColumnIndex}{'IsPreDefAttributeAliasColumn'} = $hUsedAttributes->{$ColumnIndex}{'Alias'} eq 'Alias' ? 1 : 0; $hUsedAttributes->{'AliasPreDefAttributeColumn'} with value=$ColumnIndex if $hUsedAttributes->{$ColumnIndex}{'IsPreDefAttributeAliasColumn'}; $hUsedAttributes->{$ColumnIndex}{'IsProductAttributeTypeColumn'} = $hUsedAttributes->{$ColumnIndex}{'Alias'} eq 'Type' ? 1 : 0; $hUsedAttributes->{'TypeProductAttributeColumn'} with value=$ColumnIndex if $hUsedAttributes->{$ColumnIndex}{'IsProductAttributeTypeColumn'};
Syntax |
$self->modifyUsedAttributes($hUsedAttributes, $ColumnIndex); |
Input |
|
testHeaderColumn
possibility to test $hHeader, called by getUsedAttribute only dummy function here
Syntax |
$self->testHeaderColumn($hAttribute, $hHeader, $ColumnIndex); |
Input |
|
testMissingFields
throws error 'MISSING_FIELD', if field Alias is missing
Syntax |
$self->testMissingFields($hUsedAttributes); |
Input |
|