ePages 6.11.0 - DE_EPAGES/ShopTransfer/API/Transform.pm

Package DE_EPAGES::ShopTransfer::API::Transform

Functions

createSystemMapping
createTableMapping
getCountOfRows
getSourceFile
getVisibleLocales
loadSystem
transferFiles
transferTable

createSystemMapping

Loads System Mappings (IDs to IDs).

Syntax
$hSystemMapping = $trans->createSystemMapping($Table, $hOptions);
Input
$Table (string)
table name
$hOptions (ref.hash)
options, keys: versions, storePath, sourcePath, encoding
Return
$hSystemMapping (ref.hash.integer)
mapping keys: old ids values: new ids

createTableMapping

Adds shop mapping to system mapping.

Syntax
$Count = $trans->createTableMapping($Table, $ShopAlias, $FirstID, $SystemMappings, $hOptions)
Input
$Table (string)
table name
$ShopAlias (string)
shop alias
$FirstID (integer)
first identifier
$hOptions (ref.hash)
options, keys: versions, sourcePath, encoding
Return
$hSystemMapping (ref.hash.integer)
mapping keys: old ids values: new ids
$Count (integer)
count of rows in table

getCountOfRows

Counts rows of source bcp file.

Syntax
$Count = $trans_>getCountOfRows($Table, $ShopAlias, $hOptions)
Input
$Table (string)
table name
$ShopAlias (string)
shop alias
$hOptions (ref.hash)
options, keys: versions, sourcePath, encoding
Return
$Count (integer)
count of rows in table

getSourceFile

Returns existing file name (may be bcp file was changed in patch).

Syntax
$FileName = $trans->getSourceFile($StorePath, $SiteAlias, $Table, $hOptions);
Input
$StorePath (string)
bcp path to store sometimes $hOptions 'storePath' or 'sourcePath'
$SiteAlias (string)
SYSTEM or shop alias
$Table (string)
table name
$hOptions (ref.hash)
options, keys: versions, storePath, db_name, bcpParameter, encoding
Return
$FileName (string)
file name

getVisibleLocales

Gets visible locales of bcp file.

Syntax
%VisibleLocales = $trans->getVisibleLocales($hOptions)
Input
$hOptions (ref.hash)
options, keys: versions, sourcePath, encoding
Return
%VisibleLocales (ref.hash)
visible locales in system

loadSystem

Loads System Mappings (IDs to UniqueExternalPresentation).

Syntax
$hSystemMapping = $trans->loadSystem($Table, $hOptions, $IsNew);
Input
$Table (string)
table name
$hOptions (ref.hash)
options, keys: versions, storePath, sourcePath, encoding
$IsNew (string)
load new or old system
Return
$hSystemMapping (ref.hash)
mapping keys: internal identifier values: external identifier

transferFiles

Copies the files public.tar and private.tar to the "import" directory. Renames all GUID-based subdirectries in shop directory to new GUIDs

Syntax
$trans->transferFiles( $hGUIDMapping, $ShopAlias, $hOptions )
Input
$hGUIDMapping (ref.hash)
GUID mapping from old to new GUIDs
$ShopAlias (string)
shop alias
$hOptions (ref.hash)
options, keys: versions, sourcePath, encoding

transferTable

Replaces old identifier of shop bcp file with new identifier. Returns a hash with mappings from old GUID subdirectories to new ones (Used for private files)

Syntax
$hGUIDMapping = $trans->transferTable($Table, $ShopAlias, $hOptions)
Input
$Table (string)
table name
$ShopAlias (string)
shop alias
$hOptions (ref.hash)
options, keys: versions, sourcePath,storePath,encoding
Return
$hGUIDMapping (ref.hash)
GUID mapping from old to new GUIDs