ePages 7.26.0 - DE_EPAGES/ShopCSVExportImport/API/CSV/ShopObjectExportImport.pm

Package DE_EPAGES::ShopCSVExportImport::API::CSV::ShopObjectExportImport

This module implements the high level interface for import and export of objects to CSV files.

Functions

csvAttributes
csvExport
csvImport
exportDriver
getAttributeInfo
getAttributes
getExportObjects
getHeaderStrings
getLanguages
importDriver
new
warningCodes

csvAttributes

Return list of exportable csv attributes.

Syntax
my $aCSVAttributes = $Driver->csvAttributes($Shop, $LocaleID, $aLanguageCode2s,$IsImport);
Input
$Shop (object)
shop object
$LocaleID (string)
locale identifier (e.g. en_GB)
$aLanguageCode2s (ref.array.string)
array of languages identified by code2
$IsImport (boolean)
true if this is an import ?
Return
$aAttributes (ref.array.hash)
list of attributes

csvExport

Exports objects to a CSV file.

Syntax
$Driver->csvExport($Shop, $PathFileName, $hOptions, $aObjects);
Input
$Shop (object)
alias of shop
$PathFileName (string)
CSV file name
$hOptions (ref.hash)
defines what to export and how
  • LanguageCode2s - list of ISO language codes. defines which
    languages are exported. If the list is empty, then all
    languages are exported. - array of strings
  • LocaleID - locale id - string
$aObjects (ref.array.object)
list of exportable objects

csvImport

Imports objects from a CSV file into a shop.

Syntax
$Driver->csvImport($Shop, $PathFileName, $hOptions);
Input
$Shop (object)
alias of shop
$PathFileName (string)
CSV file name
$hOptions (ref.hash)
defines what to export and how
  • LanguageCode2s - list of ISO language codes. defines which
    languages are imported. If the list is empty, then all
    languages are imported. - array of strings
  • LocaleID - locale id - string
  • ... other options

exportDriver

Return driver package.

Syntax
$Driver->exportDriver();
Return
$DriverPackage (string)
package to driver

getAttributeInfo

Returns hash with information about the attribute.

Syntax
$ahInfo = $self->getAttributeInfo($Attribute, $LanguageID, $ahLanguages, $hInfo);
Input
$Attribute (object)
attribute object
$LanguageID (integer)
language identifier
$ahLanguages (ref.array.hash)
list of information for exportable languages
  • LanguageID - language id - int
  • Code2 - iso-639-1 language code - string
  • English - english name of language - string
  • Native - local name of language - string
$hInfo (ref.hash)
information for result
Return
$ahInfo (ref.array.hash)
information of attribute for each language
  • Type - data type - string
  • IsObject - is object - boolean
  • Position - position (column in csv file) - integer
  • Alias - alias string - string
  • Name - name - string
  • Attribute - attribute object - object
  • IsBaseClassAttribute - class is special class - boolean
  • LanguageID - language identifier for localized attributes - integer
  • HeaderString - localized name for attribute - string
  • AliasString - alias name for attribute (identifier) - string

getAttributes

Return list of exportable attributes.

Syntax
my $aAttributes = $Driver->getAttributes($Shop);
Input
$Shop (object)
shop object
Return
$aAttributes (ref.array.object)
list of attributes

getExportObjects

Returns list of objects to export.

Syntax
$Driver->getExportObjects($Shop, $aObjects);
Input
$Shop (object)
alias of shop
$aObjects (ref.array.integer)
list of exportable objects
Return
$aExportObjects (ref.array)
edited list of exportable objects

getHeaderStrings

Returns hash with names for first line in csv (headline). Names are native and localized.

Syntax
$self->getHeaderStrings($hAttribute, $LanguageID, $hParams);
Input
$hAttribute (ref.hash)
attribute information
  • Alias - alias of attribute - string
  • Name - name of attribute - string
  • IsBaseClassAttribute - attribute is from objects class - boolean
  • Attribute - attribute object (optional) - object
$LanguageID (integer)
language identifier
$hParams (ref.hash)
used for localized attributes or prices (optional)
  • CurrencyID - currency identifier - string
  • TaxModelText - net or gross - string
  • hLanguage - code2 | native - ref.hash
Return
$hHeaderStrings (ref.hash)
localized name and identifier for headline
  • HeaderString - localized name for attribute - string
  • AliasString - alias name for attribute (identifier) - string

getLanguages

Returns array of languages for which localized attributes should exported.

Syntax
$self->getLanguages($Shop, $aLanguageCode2s);
Input
$Shop (object)
object of shop
$aLanguageCode2s (ref.array.string)
list of code2 of languages
Return
$ahLanguages (ref.array.hash)
list of information for exportable languages
  • LanguageID - language id - int
  • Code2 - iso-639-1 language code - string
  • English - english name of language - string
  • Native - local name of language - string

importDriver

Return driver package.

Syntax
$Driver->importDriver();
Return
$DriverPackage (string)
package to driver

new

Creates a new csv export driver.

Syntax
$Driver= DE_EPAGES::Tax::API::CSV::TaxExportImport->new(%options);
Example
$Driver= DE_EPAGES::Tax::API::CSV::TaxExportImport->new;
Input
%options (hash)
exporter options
Return
$Driver (object)
import/export driver

warningCodes

Returns the warning codes for csv export.

Syntax
$aWarningCodes = $Driver->warningCodes();
Return
$aWarningCodes (array.string)
warning codes