ePages 6.10 - DE_EPAGES/Core/API/FileInstaller.pm

Package DE_EPAGES::Core::API::FileInstaller

install/patch/uninstall files from /Data/Private and /Data/Public

Base
DE_EPAGES::Core::API::BaseInstaller

Functions

copyBinaryFiles
copyJavascriptFiles
copyPrivateFiles
copyPublicFiles
copySchedulerFiles
copyWebRootFiles
deleteJavascriptFiles
deletePrivateFiles
deletePublicFiles
install
onPatchCopyJavascriptFile
onPatchCopyPrivateFile
onPatchCopyPublicDirectory
onPatchCopyPublicFile
onPatchCopySchedulerFile
onPatchCopyWebRootFile
onPatchDeleteCartridgeDirectory
onPatchDeleteCartridgeFile
onPatchDeleteJavascriptFile
onPatchDeletePrivateDirectory
onPatchDeletePrivateFile
onPatchDeletePublicDirectory
onPatchDeletePublicFile
onPatchDeleteSchedulerDirectory
onPatchDeleteSchedulerFile
onPatchDeleteWebRootDirectory
onPatchDeleteWebRootFile
uninstall

copyBinaryFiles

Copies files from /bin/$ArchDir to EPAGES_PERL/bin with backup in EPAGES_BACKUP_DIR/Perl/bin. Directories will be copied with DE_EPAGES::Core::API::File::CopyDirectory. Called by function install.

Syntax
$Installer->copyBinaryFiles();
Example
$Installer->copyBinaryFiles();

copyJavascriptFiles

Copies files from /Data/javascript to EPAGES_WEBROOT/STORE_NAME/javascript/cartridges/<cartridgeDirectory>/ with backup in EPAGES_WEBROOT/STORE_NAME/Backup/Data/javascript. Directories will be copied with DE_EPAGES::Core::API::File::CopyDirectory. Called by function install. If CopyDirectory() creates a file "$BackupDir.inexistent", add it to EPAGES_BACKUP_DIR/Shared/WebRoot.inexistent.

Syntax
$Installer->copyJavascriptFiles;

copyPrivateFiles

Copies files from /Data/Private to EPAGES_STORES/STORE_NAME with backup in EPAGES_BACKUP_DIR/Shared/Stores/STORE_NAME. Directories will be copied with DE_EPAGES::Core::API::File::CopyDirectory. Called by function install. If CopyDirectory() creates a file "$BackupDir.inexistent", add it to EPAGES_BACKUP_DIR/Shared/Stores.inexistent.

Syntax
$Installer->copyPrivateFiles();
Example
$Installer->copyPrivateFiles();

copyPublicFiles

Copies files from /Data/Public to EPAGES_WEBROOT/STORE_NAME with backup in EPAGES_BACKUP_DIR/Shared/WebRoot/STORE_NAME. Directories will be copied with DE_EPAGES::Core::API::File::CopyDirectory. Called by function install. If CopyDirectory() creates a file "$BackupDir.inexistent", add it to EPAGES_BACKUP_DIR/Shared/WebRoot.inexistent.

Syntax
$Installer->copyPublicFiles();
Example
$Installer->copyPublicFiles();

copySchedulerFiles

Reads sections from /Data/Scheduler/Scheduler.conf and writes them to EPAGES_CONFIG/Scheduler.conf (if section not exists) Called by function install

Syntax
$Installer->copySchedulerFiles();
Example
$Installer->copySchedulerFiles();

copyWebRootFiles

Copies files from /Data/WebRoot to EPAGES_WEBROOT with backup in EPAGES_BACKUP_DIR/Shared/WebRoot. Directories will be copied with DE_EPAGES::Core::API::File::CopyDirectory. Called by function install.

Syntax
$Installer->copyWebRootFiles();
Example
$Installer->copyWebRootFiles();

deleteJavascriptFiles

Deletes files that were installed by the cartridge to the directory WebRoot/$Store/javascript/cartridges/<cartridgeDirectory>.

Syntax
$Installer->deleteJavascriptFiles;

deletePrivateFiles

Deletes files that were installed by the cartridge to the directory EPAGES_STORES/$Store.

Syntax
$Installer->deletePrivateFiles;

deletePublicFiles

Deletes files that were installed by the cartridge to the directory WebRoot/$Store.

Syntax
$Installer->deletePublicFiles;

install

Call functions copyPrivateFiles, copyPublicFiles, copyBinaryFiles, copySchedulerFiles, copyWebRootFiles, copyJavascriptFiles.

Syntax
$Installer->install;

onPatchCopyJavascriptFile

Called by PatchImportHandler by Method onPatchCopyJavascriptFile If DE_EPAGES::Core::API::File::CompareMD5File($Target,$hParams->{'OldMD5Digest'}) returns true: Copies Javascript file to $ENV{'EPAGES_WEBROOT'} directory. Else file will be ignored and GetLog->info( "'$Source' not copied. File '$Target' was not overwritten because the original target file has been modified." ) is called. If the file is new or not defined $hParams->{'OldMD5Digest'}: Backups file DE_EPAGES::Core::API::File::BackupFile( $Source, $Target, $Backup ). Copies file DE_EPAGES::Core::API::File::CopyFile( $Source, $Target, { create_directory => 1 } ).

Syntax
$Installer->onPatchCopyJavascriptFile($File, $hParams);
Example
$Installer->onPatchCopyJavascriptFile(
          'Data/javascript/widget/Mywidget.js',
          {'CVS' => 'Changed',
           'OldMD5Digest' => '4c832c34a88de899dab3d00b7ccca632'
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could be New or Changed - string
  • OldMD5Digest - md5 hex digest of the old release of the file
    (only for files with CVS= 'Changed')
    - string

onPatchCopyPrivateFile

Called by PatchImportHandler by Method onPatchCopyPrivateFile. If DE_EPAGES::Core::API::File::CompareMD5File($Target,$hParams->{'OldMD5Digest'}) returns true: Copies private file to store directory. Else file will be ignored and GetLog->info( "'$Source' not copied. File '$Target' was not overwritten because the original target file has been modified." ) is called. If the file is new or not defined $hParams->{'OldMD5Digest'}: Backups file DE_EPAGES::Core::API::File::BackupFile( $Source, $Target, $Backup ) Copies file DE_EPAGES::Core::API::File::CopyFile( $Source, $Target, { create_directory => 1 } )

Syntax
$Installer->onPatchCopyPrivateFile($File, $hParams);
Example
$Installer->onPatchCopyPrivateFile(
         'Data/Private/Templates/DE_EPAGES/Shop/Templates/MBO/MBO.UserBox.html',
          {'CVS' => 'Changed',
           'OldMD5Digest' => '4c832c34a88de899dab3d00b7ccca632'
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could be New or Changed - string
  • OldMD5Digest - md5 hex digest of the old release of the file
    (only for files with CVS= 'Changed')
    - string

onPatchCopyPublicDirectory

Called by PatchImportHandler by Method onPatchCopyPublicDirectory Copies public directory to store directory. Backups file DE_EPAGES::Core::API::File::BackupFile( $Source, $Target, $Backup ). Copies file DE_EPAGES::Core::API::File::CopyFile( $Source, $Target, { create_directory => 1 } ). If CopyDirectory() creates a file "$BackupDir.inexistent", add it to EPAGES_BACKUP_DIR/Shared/WebRoot.inexistent.

Syntax
$Installer->onPatchCopyPublicDirectory($Directory, $hParams);
Example
$Installer->onPatchCopyPublicDirectory(
          'Data/Public/BO',
          {'CVS' => 'Changed'
          });
Input
$Directory (string)
relative cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could be New or Changed - string

onPatchCopyPublicFile

Called by PatchImportHandler by Method onPatchCopyPublicFile If DE_EPAGES::Core::API::File::CompareMD5File($Target,$hParams->{'OldMD5Digest'}) returns true: Copies public file to store directory. Else file will be ignored and GetLog->info( "'$Source' not copied. File '$Target' was not overwritten because the original target file has been modified." ) is called. If the file is new or not defined $hParams->{'OldMD5Digest'}: Backups file DE_EPAGES::Core::API::File::BackupFile( $Source, $Target, $Backup ). Copies file DE_EPAGES::Core::API::File::CopyFile( $Source, $Target, { create_directory => 1 } ).

Syntax
$Installer->onPatchCopyPublicFile($File, $hParams);
Example
$Installer->onPatchCopyPublicFile(
          'Data/Public/BO/icons/context_ico_s_helpbook.gif',
          {'CVS' => 'Changed',
           'OldMD5Digest' => '4c832c34a88de899dab3d00b7ccca632'
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could be New or Changed - string
  • OldMD5Digest - md5 hex digest of the old release of the file
    (only for files with CVS= 'Changed')
    - string

onPatchCopySchedulerFile

Reads sections from /Data/Scheduler/Scheduler.conf and writes them to EPAGES_CONFIG/Scheduler.conf (if section not exists)

Syntax
$Installer->onPatchCopySchedulerFile($File);
Example
$Installer->onPatchCopySchedulerFile('Data/Scheduler/Scheduler.conf');
Input
$File (string)
cartridgefilename without cartridge directory

onPatchCopyWebRootFile

Called by PatchImportHandler by Method onPatchCopyWebRootFile If DE_EPAGES::Core::API::File::CompareMD5File($Target,$hParams->{'OldMD5Digest'}) returns true: Copies WebRoot file to $ENV{'EPAGES_WEBROOT'} directory. Else file will be ignored and GetLog->info( "'$Source' not copied. File '$Target' was not overwritten because the original target file has been modified." ) is called. If the file is new or not defined $hParams->{'OldMD5Digest'}: Backups file DE_EPAGES::Core::API::File::BackupFile( $Source, $Target, $Backup ). Copies file DE_EPAGES::Core::API::File::CopyFile( $Source, $Target, { create_directory => 1 } ).

Syntax
$Installer->onPatchCopyWebRootFile($File, $hParams);
Example
$Installer->onPatchCopyWebRootFile(
          'Data/WebRoot/BO/icons/context_ico_s_helpbook.gif',
          {'CVS' => 'Changed',
           'OldMD5Digest' => '4c832c34a88de899dab3d00b7ccca632'
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could be New or Changed - string
  • OldMD5Digest - md5 hex digest of the old release of the file
    (only for files with CVS= 'Changed')
    - string

onPatchDeleteCartridgeDirectory

Called by PatchImportHandler by Method onPatchDeleteCartridgeDirectory. Deletes the cartridge directory $Directory.

Syntax
$Installer->onPatchDeleteCartridgeDirectory($Directory, $hParams);
Example
$Installer->onPatchDeleteCartridgeDirectory(
          'Data/Public/BO/icons',
          {'CVS' => 'Removed',
          });
Input
$Directory (string)
cartridgeDirectoryName without cartridge directory
$hParams (ref.hash.*)
patch Directory parameters, keys are
  • CVS - could only be Removed - string

onPatchDeleteCartridgeFile

Called by PatchImportHandler by Method onPatchDeleteCartridgeFile. Deletes the cartridge file $File.

Syntax
$Installer->onPatchDeleteCartridgeFile($File, $hParams);
Example
$Installer->onPatchDeleteCartridgeFile(
          'Data/Public/BO/icons/context_ico_s_helpbook.gif',
          {'CVS' => 'Removed',
           'OldMD5Digest' => '4c832c34a88de899dab3d00b7ccca632'
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could only be Removed - string
  • OldMD5Digest - md5 hex digest of the old release of the file
    - string

onPatchDeleteJavascriptFile

Called by PatchImportHandler by method onPatchDeleteJavascriptFile. If DE_EPAGES::Core::API::File::CompareMD5File($Target,$hParams->{'OldMD5Digest'}) returns true: Deletes Javascript file at $ENV{EPAGES_WEBROOT} directory, Moves BackupFile to TargetFile if BackupFile exists. Else file will be ignored and GetLog->info( "File '$Target' was not deleted because the original target file has been modified." ) is called.

Syntax
$Installer->onPatchDeleteJavascriptFile($File, $hParams);
Example
$Installer->onPatchDeleteJavascriptFile(
         'Data/javascript/widget/Mywidget.js',
          {'CVS' => 'Removed',
           'OldMD5Digest' => '4c832c34a88de899dab3d00b7ccca632'
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could only be Removed - string
  • OldMD5Digest - md5 hex digest of the old release of the file
    - string

onPatchDeletePrivateDirectory

Called by PatchImportHandler by method onPatchDeletePrivateDirectory Deletes Private Directory at store directory.

Syntax
$Installer->onPatchDeletePrivateDirectory($Directory, $hParams);
Example
$Installer->onPatchDeletePrivateDirectory(
         'Data/Private/Templates/DE_EPAGES/Shop/Templates/MBO/MBO.UserBox.html',
          {'CVS' => 'Removed',
          });
Input
$Directory (string)
cartridgeDirectoryname without cartridge directory
$hParams (ref.hash.*)
patch Directory parameters, keys are
  • CVS - could only be Removed - string

onPatchDeletePrivateFile

Called by PatchImportHandler by method onPatchDeletePrivateFile If DE_EPAGES::Core::API::File::CompareMD5File($Target,$hParams->{'OldMD5Digest'}) returns true: Deletes Private file at store directory, Moves BackupFile to TargetFile if BackupFile exists. Else file will be ignored and GetLog->info( "File '$Target' was not deleted because the original target file has been modified." ) is called.

Syntax
$Installer->onPatchDeletePrivateFile($File, $hParams);
Example
$Installer->onPatchDeletePrivateFile(
         'Data/Private/Templates/DE_EPAGES/Shop/Templates/MBO/MBO.UserBox.html',
          {'CVS' => 'Removed',
           'OldMD5Digest' => '4c832c34a88de899dab3d00b7ccca632'
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could only be Removed - string
  • OldMD5Digest - md5 hex digest of the old release of the file
    - string

onPatchDeletePublicDirectory

Called by PatchImportHandler by method onPatchDeletePublicDirectory. Deletes public Directory at store directory.

Syntax
$Installer->onPatchDeletePublicDirectory($Directory, $hParams);
Example
$Installer->onPatchDeletePublicDirectory(
         'Data/Public/BO/icons/context_ico_s_helpbook.gif',
          {'CVS' => 'Removed',
          });
Input
$Directory (string)
cartridgeDirectoryname without cartridge directory
$hParams (ref.hash.*)
patch Directory parameters, keys are
  • CVS - could only be Removed - string

onPatchDeletePublicFile

Called by PatchImportHandler by method onPatchDeletePublicFile. If DE_EPAGES::Core::API::File::CompareMD5File($Target,$hParams->{'OldMD5Digest'}) returns true: Deletes public file at store directory, Moves BackupFile to TargetFile if BackupFile exists. Else file will be ignored and GetLog->info( "File '$Target' was not deleted because the original target file has been modified." ) is called.

Syntax
$Installer->onPatchDeletePublicFile($File, $hParams);
Example
$Installer->onPatchDeletePublicFile(
         'Data/Public/BO/icons/context_ico_s_helpbook.gif',
          {'CVS' => 'Removed',
           'OldMD5Digest' => '4c832c34a88de899dab3d00b7ccca632'
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could only be Removed - string
  • OldMD5Digest - md5 hex digest of the old release of the file
    - string

onPatchDeleteSchedulerDirectory

Called by PatchImportHandler by method onPatchDeleteSchedulerDirectory Deletes Scheduler Directory at store directory.

Syntax
$Installer->onPatchDeleteSchedulerDirectory($Directory, $hParams);
Example
$Installer->onPatchDeleteSchedulerDirectory(
         'Data/Scheduler/Backup',
          {'CVS' => 'Removed',
          });
Input
$Directory (string)
cartridgeDirectoryname without cartridge directory
$hParams (ref.hash.*)
patch Directory parameters, keys are
  • CVS - could only be Removed - string

onPatchDeleteSchedulerFile

Called by PatchImportHandler by method onPatchDeleteSchedulerFile If DE_EPAGES::Core::API::File::CompareMD5File($Target,$hParams->{'OldMD5Digest'}) returns true: Deletes Scheduler file at store directory, Moves BackupFile to TargetFile if BackupFile exists. Else file will be ignored and GetLog->info( "File '$Target' was not deleted because the original target file has been modified." ) is called.

Syntax
$Installer->onPatchDeleteSchedulerFile($File, $hParams);
Example
$Installer->onPatchDeleteSchedulerFile(
         'Data/Scheduler/DoScheduler.sh',
          {'CVS' => 'Removed',
           'OldMD5Digest' => '4c832c34a88de899dab3d00b7ccca632'
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could only be Removed - string
  • OldMD5Digest - md5 hex digest of the old release of the file
    - string

onPatchDeleteWebRootDirectory

Deletes the directory $Directory in EPAGES_WEBROOT.

Syntax
$Installer->onPatchDeleteWebRootDirectory($Directory, $hParams);
Example
$Installer->onPatchDeleteWebRootDirectory(
          'Data/WebRoot/Doc/Help/de/ClickAndBuy',
          {'CVS' => 'Removed',
          });
Input
$Directory (string)
cartridgeDirectoryName without cartridge directory
$hParams (ref.hash.*)
patch Directory parameters, keys are
  • CVS - could only be Removed - string

onPatchDeleteWebRootFile

Called by PatchImportHandler by method onPatchDeleteWebRootFile. If DE_EPAGES::Core::API::File::CompareMD5File($Target,$hParams->{'OldMD5Digest'}) returns true: Deletes WebRoot file at $ENV{EPAGES_WEBROOT} directory, Moves BackupFile to TargetFile if BackupFile exists. Else file will be ignored and GetLog->info( "File '$Target' was not deleted because the original target file has been modified." ) is called.

Syntax
$Installer->onPatchDeleteWebRootFile($File, $hParams);
Example
$Installer->onPatchDeleteWebRootFile(
         'Data/WebRoot/BO/icons/context_ico_s_helpbook.gif',
          {'CVS' => 'Removed',
           'OldMD5Digest' => '4c832c34a88de899dab3d00b7ccca632'
          });
Input
$File (string)
cartridgefilename without cartridge directory
$hParams (ref.hash.*)
patch file parameters, keys are
  • CVS - could only be Removed - string
  • OldMD5Digest - md5 hex digest of the old release of the file
    - string

uninstall

Rebuilds directories EPAGES_STORES/STORE_NAME and EPAGES_WEBROOT/STORE_NAME from backup directories created by install. Directories will be rebuilt with DE_EPAGES::Core::API::File::RebuildDirectory.

Syntax
$Installer->uninstall;