ePages 6.17.48 - DE_EPAGES/MultiStoreCommon/API/Synchronization.pm

Package DE_EPAGES::MultiStoreCommon::API::Synchronization

MultiStoreCommon - Synchronization module

Base
Exporter
@EXPORT_OK
CleanupTable
GetCategoryObjXML
GetCategoryObjXMLType
GetDefaultValues
GetLastUpdateID
GetLastUpdates
GetObjectPathToIdMap
GetSyncPath
RunClocked
SetLastUpdateID
SetPeriodicUpdateID
TransformExportXML

Functions

CleanupTable
GetCategoryObjXML
GetCategoryObjXMLType
GetDefaultValues
GetLastUpdateID
GetLastUpdates
GetObjectPathToIdMap
GetSyncPath
RunClocked
SetLastUpdateID
SetPeriodicUpdateID
TransformExportXML

CleanupTable

Deletes each record from table ObjectUpdate older than MS_UPDATE_DAYS.

Syntax
CleanupTable($Shop)
Input
$Shop (DE_EPAGES::Shop::API::Object::Shop)
shop object

GetCategoryObjXML

Removes the CategoryProductMap from a category object data hash

Syntax
GetCategoryObjXML($hXML);
Input
$hXML (ref.hash)
Category object data hash including CategoryProductMap; input from XMLin
Return
$hXML (ref.hash)
Category object data hash without CategoryProductMap

GetCategoryObjXMLType

Returns the type of a category given by a category object data hash

Syntax
GetCategoryObjXMLType($hXML);
Input
$hXML (ref.hash)
Category object data hash; input from XMLin
Return
$hXML (string)
Category type, either 'Category' or 'CategorySpecialOffer'

GetDefaultValues

Triggers hook 'API_MS_GetDefaultValues' and returns the result.

Syntax
my $hValues = GetDefaultValues();
Return
$hValues (ref.hash)
default values

GetLastUpdateID

Returns the value of shop attribute 'MS_LastUpdate' or '0' for default.

Syntax
my $LastUpdateID = GetLastUpdateID($Shop, $ShopAlias);
Input
$Shop (DE_EPAGES::Shop::API::Object::Shop)
shop object
$ShopAlias (String)
(optional) shop alias; if ommited, $Shop->alias is used.
Return
$LastUpdateID (Integer)
last update id

GetLastUpdates

Returns the info list of recently updated objects.

Syntax
my $ahLastUpdates = GetLastUpdates($Shop, $LastUpdateID_LB, $LastUpdateID_UB);
Input
$Shop (DE_EPAGES::Shop::API::Object::Shop)
shop object
$LastUpdateID_LB (Integer)
(optional) lower bound - starting number for updates to look for;
if ommited, gets the value from GetLastUpdateID()
$LastUpdateID_UB (Integer)
(optional) upper bound - last record to look for
even if it is not the last one at all
Return
$ahLastUpdates (ref.array.hash)
List of recently updated objects

GetObjectPathToIdMap

Maps objects paths to a list of associate objects ids.

Syntax
my %Map = GetObjectPathToIdMap($ahInfoObjects);
Example
my %Map = GetObjectPathToIdMap( LoadClassByAlias('ObjectUpdateID')->infoObjects );
Input
$ahInfoObjects (ref.array.hash)
object info
Return
%ObjectPathToIdMap (hash)
path to id map

GetSyncPath

returns the path to the sync folder for the shop.

Syntax
my $SyncPath = GetSyncPath($StoreName,$ShopName);
Input
$StoreName (String)
store name
$ShopName (String)
shop name
Return
$SynPath (String)
sync path

RunClocked

Runs the given code for this shop in a clocked mode. The process can be startet several times, but ensures that the current shop is processed only once at the same time.

Syntax
RunClocked($Store,$Shop,$cSub);
Input
$Store (String)
store name
$Shop (DE_EPAGES::Shop::API::Object::Shop)
shop object
$cSub (ref.code)
code reference

SetLastUpdateID

Sets a value for shop attribute 'MS_LastUpdate'.

Syntax
SetLastUpdateID($Shop, $MS_LastUpdate, $ShopAlias);
Input
$Shop (DE_EPAGES::Shop::API::Object::Shop)
shop object
$MS_LastUpdate (Integer)
value to set
$ShopAlias (String)
(optional) shop alias; if ommited, $Shop->alias is used.

SetPeriodicUpdateID

Calls function 'SetLastUpdateID' depending on DE_EPAGES::MultiStoreCommon::API::Constants::MS_LASTUPDATE_SAVE_PERIOD.

Syntax
SetPeriodicUpdateID($Shop, $ProcessedUpdatesCount, $ObjectUpdateID, %ScheduledUpdateIDs, $ShopAlias);
Input
$Shop (DE_EPAGES::Shop::API::Object::Shop)
shop object
$ProcessedUpdatesCount (Integer)
current counter of iteration in update process
$ObjectUpdateID (Integer)
value of current update id
$hScheduledUpdateIDs (Integer)
all update ids that have not been processed yet
$ShopAlias (String)
(optional) shop alias; if ommited, $Shop->alias is used.

TransformExportXML

Transformation of some attributes during export of an object.

Syntax
TransformExportXML($TagName, $hAttributes)
Input
$TagName (String)
tag name
$hAttributes (ref.hash)
attributes of the tag