ePages 6.10 - DE_EPAGES/Object/API/ObjectInstaller.pm

Package DE_EPAGES::Object::API::ObjectInstaller

Install/patch/uninstall objects, classes and attributes. Processes Database/XML/Attributes*.xml files.

Base
DE_EPAGES::Cartridge::API::CartridgeInstaller

Functions

getAttributeID
getClassID
install
onPatchDeleteObjects
onPatchDeleteStandards
onPatchImportObjects
onPatchImportStandards
patchLanguages
uninstall

getAttributeID

Returns the attribute id of a direct attribute, i.e. without consideration of the class hierarchy. This is useful for the patch process inside the patchDBStructure() method where it's not safe to use other API functions. Throws the error NoAttributeName if the requested attribute does not exist.

Syntax
$AttributeID = $Installer->getAttributeID($ClassAlias, $AttributeAlias);
Example
$AttributeID = $Installer->getAttributeID('System', 'TaxMatrix');
Input
$ClassAlias (string)
class alias
$AttributeAlias (string)
attribute alias
Return
$AttributeID (integer)
attribute id

getClassID

Returns the class id of a class using direct SQL. This is useful for the patch process inside the patchDBStructure() method where it's not safe to use other API functions. Throws the error NoClassName if the requested class does not exist.

Syntax
$ClassID = $Installer->getClassID($ClassAlias);
Example
$ClassID = $Installer->getClassID('System');
Input
$ClassAlias (string)
class alias
$AttributeAlias (string)
attribute alias
Return
$AttributeID (integer)
attribute id

install

Installs Database/XML/Attributes*.xml and Database/XML/Translation.Attributes.*.xml on installation process.

Syntax
$Installer->install;

onPatchDeleteObjects

Called by PatchImportHandler by Method onPatchDeleteObjects. Deletes the objects at file $File.

Syntax
$Installer->onPatchDeleteObjects($File, $hParams);
Example
$Installer->onPatchDeleteObjects(
          'Database/XML/FormsShop.xml',
          {'CVS' => 'Removed',
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could only be Removed (will be ignored) - string

onPatchDeleteStandards

Called by PatchDeleteHandler by Method onPatchDeleteStandards Deletes the standards at file $File.

Syntax
$Installer->onPatchDeleteStandards($File, $hParams);
Example
$Installer->onPatchDeleteStandards(
          'Database/XML/Languages.xml',
          {'CVS' => 'Changed',
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could be New or Changed (will be ignored) - string

onPatchImportObjects

Called by PatchImportHandler by method onPatchImportObjects Imports the objects in file $File.

Syntax
$Installer->onPatchImportObjects($File, $hParams);
Example
$Installer->onPatchImportObjects(
          'Database/XML/AttributesShop.xml',
          {'CVS' => 'Changed',
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could be New or Changed (will be ignored) - string

onPatchImportStandards

Called by PatchImportHandler by method onPatchImportStandards Imports the standards in file $File.

Syntax
$Installer->onPatchImportStandards($File, $hParams);
Example
$Installer->onPatchImportStandards(
          'Database/XML/Languages.xml',
          {'CVS' => 'Changed',
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could be New or Changed (will be ignored) - string

patchLanguages

Processes the files patch.xx.xml via xml import (DE_EPAGES::XML::API::XMLInstaller::importPatch), where xx are the language codes of all active languages (where IsUsed=1).

Syntax
$Installer->patchLanguages($PatchSubDir, $PatchSection);
Example
$self->patchLanguages('Patch_6_9_1', 'Patch');
Input
$PatchSubDir (string)
name of the sub directory of 'Patches'
$PatchSection (string)
'Patch' or 'PatchCartridgeDir'

uninstall

Uninstalls Database/XML/Attributes*.xml on uninstallation process.

Syntax
$Installer->uninstall;