ePages 7.25.0 - DE_EPAGES/Installer/API/EpagesJ.pm

Package DE_EPAGES::Installer::API::EpagesJ

Functions for handling epagesj

@EXPORT_OK
GetEpagesJBuild
GetEpagesJVersion
GetEpagesJZipUrl
GetEpagesJEtcUrl
UpdateEpagesJEtc
UpdateEpagesJ
UnpackEpagesJ
AddEpagesJService
AddMongoDBService

Functions

AddEpagesJService
AddMongoDBService
GetEpagesJBuild
GetEpagesJEtcUrl
GetEpagesJVersion
GetEpagesJZipUrl
UnpackEpagesJ
UpdateEpagesJ
UpdateEpagesJEtc

AddEpagesJService

Adds windows epagesj services (does nothing under Linux)

Syntax
AddEpagesJService();

AddMongoDBService

Adds windows mongodb service (does nothing under Linux)

Syntax
AddMongoDBService($MongoBinDir, $MongoDataDir, $hFlags);
Input
$MongoBinDir (string)
directory that contains the mongodb executables
$MongoDataDir (string)
directory that contains the mongodb data
$hFlags (ref.hash)
flags
  • remove - uninstall service
  • reinstall - uninstall service and install again

GetEpagesJBuild

Get build nubmer as defd. in $JDir/webapps/epagesj.version Returns 0 unless exists.

Syntax
$Build = GetEpagesJBuild($JDir);
Input
$JDir (string)
path to j/ (default: $ENV{EPAGESJ})
Return
$Build (string)
version of installed epagesj

GetEpagesJEtcUrl

Returns URL for epagesj start/stop scripts (Linux) on the download site.

Syntax
$DownloadUrl = GetEpagesJEtcUrl($Version);
Input
$Version (string)
version is either empty, then get the URL for the latest
version, or epages version string as 6.15.0, or snapshot
version as 6.15.0-SNAPSHOT (only epages internal use)
Return
$DownloadUrl (string)
download URL

GetEpagesJVersion

Get version as defd. in $JDir/webapps/epagesj.version Returns 0 unless exists.

Syntax
$Version = GetEpagesJVersion($JDir);
Input
$JDir (string)
path to j/ (default: $ENV{EPAGESJ})
Return
$Version (string)
version of installed epagesj

GetEpagesJZipUrl

Returns URL for epagesj.zip on the download site.

Syntax
$DownloadUrl = GetEpagesJZipUrl($Version);
Input
$Version (string)
version is either empty, then get the URL for the latest
version, or epages version string as 6.15.0, or snapshot
version as 6.15.0-SNAPSHOT (only epages internal use)
Return
$DownloadUrl (string)
download URL

UnpackEpagesJ

Updates $ENV{EPAGESJ} with package $Package.

Syntax
UnpackEpagesJ($Package, $OldVersion, $NewVersion, $hFlags);
Input
$Package (string)
path to epagesj zip file or j/ directory
$OldVersion (string)
installed epagesj version
$NewVersion (string)
epagesj version to be installed
$hFlags (ref.hash)
flags
  • dont_move - if set to 1, old j/ is not overwritten by new version

UpdateEpagesJ

If $Version is set, upgrades/downgrades/installs epagesj. If $Version is unset, installs epagesj unless installed. Does nothing if installed and new version are same. Returns error if upgrade/downgrade/install fails.

Syntax
$Update = UpdateEpagesJ($Version, $Source, $hFlags);
Example
UpdateEpagesJ('6.14.6', 'Data/j', { start => 1 });
UpdateEpagesJ('6.14.6', 'Data/epagesj.zip');
UpdateEpagesJ('6.14.6');
UpdateEpagesJ();
Input
$Version (string)
version is one of:
- empty : update epagesj to the latest version
- epages version (6.15.0) : upgrade/downgrade to specific
version if exists, else use snapshot version (6.15.0-SNAPSHOT)
- snapshot version (6.15.0-SNAPSHOT) : upgrade/downgrade to
specific snapshot version (only epages internal use)
$Source (string)
download epagesj from source (dir/zip/URL)
$hFlags (ref.hash)
flags
  • start - 1: start epagesj after update (default); 0 - not

Return
$Update (boolean)
true if epagesj was updated, else false

UpdateEpagesJEtc

Updates epagesj start/stop scripts (Linux).

Syntax
UpdateEpagesJEtc($OldVersion, $NewVersion, $Source);
Example
UpdateEpagesJEtc('6.14.4', '6.14.6', 'Data/j/etc');
UpdateEpagesJEtc(undef, '6.14.6');
UpdateEpagesJEtc()
Input
$OldVersion (string)
installed epagesj version
$NewVersion (string)
epagesj version to be installed
$Source (string)
etc/ directory that contains init.d/epagesj etc. (opt)