Contentserv PHP API

CSActiveScript
in package

Tags

Table of Contents

ACTIVE_SCRIPT_LOG_LEVEL_ALL  = 1
ACTIVE_SCRIPT_LOG_LEVEL_NO_DEBUG  = 0
ACTIVE_SCRIPT_STATUS_DEBUG  = 10
ACTIVE_SCRIPT_STATUS_ERROR  = 7
ACTIVE_SCRIPT_STATUS_IGNORED  = 12
ACTIVE_SCRIPT_STATUS_INTERRUPTED  = 9
ACTIVE_SCRIPT_STATUS_INTERRUPTION_REQUESTED  = 8
ACTIVE_SCRIPT_STATUS_NOT_YET_STARTED  = 1
ACTIVE_SCRIPT_STATUS_OK  = 5
ACTIVE_SCRIPT_STATUS_PAUSE_REQUESTED  = 3
ACTIVE_SCRIPT_STATUS_PAUSED  = 4
ACTIVE_SCRIPT_STATUS_READY_TO_START  = 13
ACTIVE_SCRIPT_STATUS_RESULT  = 11
ACTIVE_SCRIPT_STATUS_RUNNING  = 2
ACTIVE_SCRIPT_STATUS_STARTING  = self::ACTIVE_SCRIPT_STATUS_READY_TO_START
ACTIVE_SCRIPT_STATUS_TYPE_ALL  = 255
The different types of the active script status
ACTIVE_SCRIPT_STATUS_TYPE_ERROR  = 8
ACTIVE_SCRIPT_STATUS_TYPE_FINISHED  = 4
ACTIVE_SCRIPT_STATUS_TYPE_ONGOING  = 1
ACTIVE_SCRIPT_STATUS_TYPE_REQUESTED  = 2
ACTIVE_SCRIPT_STATUS_UNDEFINED  = 0
ACTIVE_SCRIPT_STATUS_WAITING  = 14
ACTIVE_SCRIPT_STATUS_WARNING  = 6
ACTIVE_SCRIPT_VISIBILITY_ALL  = 0
ACTIVE_SCRIPT_VISIBILITY_DEBUG  = 8
ACTIVE_SCRIPT_VISIBILITY_ERRORS  = 2
ACTIVE_SCRIPT_VISIBILITY_PROBLEMS  = 4
ACTIVE_SCRIPT_VISIBILITY_RESULTS  = 16
AUTOMATION_CUSTOM  = 10
AUTOMATION_EVERY_FIVE_MINUTES  = 2
AUTOMATION_EVERY_HOUR  = 4
AUTOMATION_EVERY_MINUTE  = 1
AUTOMATION_EVERY_MONTH  = 9
AUTOMATION_EVERY_MORNING  = 5
AUTOMATION_EVERY_NIGHT  = 6
AUTOMATION_EVERY_TEN_MINUTES  = 3
AUTOMATION_EVERY_WEEK  = 8
AUTOMATION_EVERY_WORKING_DAY  = 7
AUTOMATION_MANUAL  = 0
CATEGORY_CARA  = 'Cara'
CATEGORY_SYSTEM  = 'System'
__call()  : mixed
Diverts the call to the AciveScript record for methods that are defined on the record level
__construct()  : CSActiveScript
The Constructor
checkRunningProcesses()  : void
Checks jobs with ongoing status if those processes are still running. In case they are not the error status is applied.
createActiveScript()  : CSActiveScript
Creates a new ActiveScript Database Object
createActiveScriptJob()  : CSActiveScriptJob
Creates an ActiveScriptJob without starting it
createActiveScriptJobInputData()  : CSActiveScriptJobInputData
Creates a new ActiveScript Input Data object that can be passed to the job
createActiveScriptJobOutputData()  : CSActiveScriptJobOutputData
Creates a new ActiveScript Output Data object that can be passed to the next job
createContext()  : CSActiveScriptContext
createDefaultScripts()  : void
Utility method that creates recommended default scripts typically called at update data model
createScriptPlugin()  : array<string|int, string>
Creates and pre configures a new script
delete()  : void
Deletes the script and all attached jobs and logs.
deleteStepsOfEndedJobs()  : void
Cleans up the step list table by deleting steps of finished jobs
disableActiveScriptJobExecution()  : bool
Disables the active script job execution.
enableActiveScriptJobExecution()  : bool
Enables the active script execution.
getActiveScript()  : CSActiveScript
Retrieves a Active Script object
getActiveScriptJob()  : CSActiveScriptJob
Retrieves a Active Script Job object
getActiveScriptJobs()  : array<string|int, CSActiveScriptJob>
Returns a list of ActiveScriptJobs
getActiveScriptJobsForFilter()  : array<string|int, CSActiveScriptJob>
Returns a list of all Active Script Jobs for specified ActiveScriptIDs/StatusIDs/TimePeriods/SortOrder if provided, otherwise returns a list of all Active Script Jobs.
getActiveScriptJobsForScriptWithID()  : array<string|int, CSActiveScriptJob>
Returns a list of ActiveScriptJobs for a specified script
getActiveScriptJobsForStatus()  : array<string|int, CSActiveScriptJob>
Returns a list of ActiveScriptJobs for a specified Status and Script
getActiveScriptJobsWithOngoingStatus()  : array<string|int, CSActiveScriptJob>
Returns a list of ActiveScriptJobs for status which are still on going.
getActiveScriptLog()  : CSActiveScriptLog
Retrieves a Active Script Log object
getActiveScriptLogsAfterLog()  : array<string|int, CSActiveScriptLog>
Returns all logs after the given log id for the same job
getActiveScriptLogsForJobWithID()  : array<string|int, CSActiveScriptLog>
Returns a list of ActiveScriptLogs for a specified job
getActiveScriptNames()  : array<string|int, string>
Returns a list of configured active script names
getActiveScriptNamesForPluginWithName()  : array<string|int, string>
Returns a list of configured active script names with a specified script plugin
getActiveScriptPlugin()  : CSActiveScriptPlugin
Returns the assigned active script plugin
getActiveScriptPluginNames()  : array<string|int, CSActiveScriptPlugin>
Collects all available ActiveScript Plugins
getActiveScriptPlugins()  : array<string|int, CSActiveScriptPlugin>
Collects all available ActiveScript Plugins
getActiveScriptResultLogLinksForJobWithID()  : array<string|int, CSActiveScriptLogLink>
Returns a list of ActiveScript Result Log Links for a specified job
getActiveScriptResultLogsForJobWithID()  : array<string|int, CSActiveScriptLog>
Returns a list of ActiveScript Result Logs for a specified job
getActiveScripts()  : array<string|int, CSActiveScript>
Returns a list of configured active scripts
getActiveScriptsForPluginWithName()  : array<string|int, CSActiveScript>
Returns a list of configured active scripts with a specified script plugin
getActiveScriptsWithAutomation()  : array<string|int, CSActiveScript>
Returns a list of configured active scripts with an automation type
getAutomationActionPluginNames()  : array<string|int, CSAutomationActionPlugin>
Collects all available AutomationAction Plugins
getAutomationActionPlugins()  : array<string|int, CSAutomationActionPLugin>
Collects all available old AutomationAction Plugins
getAutomationCronString()  : string
Returns the compiled cron string as it would be understood by a real cron job.
getAutomationDay()  : string
Returns the Day String of the Automation Cron Schedule
getAutomationHour()  : string
Returns the Hour String of the Automation Cron Schedule
getAutomationIsDue()  : bool
Tells if at the given minute the automation is due
getAutomationMinute()  : string
Returns the Minute String of the Automation Cron Schedule
getAutomationMonth()  : string
Returns the Month String of the Automation Cron Schedule
getAutomationNextRunDate()  : string
Calculates the next automation run date and returns a formatted date.
getAutomationType()  : int
Returns the selected automation type as one of the self::AUTOMATION_* constants
getAutomationTypeLabel()  : string
Gets the localized label for an automation type
getAutomationTypeLabels()  : array<string|int, mixed>
Fetches the list of labels of the automation types
getAutomationWeekday()  : string
Returns the Weekday String of the Automation Cron Schedule
getAutomationYear()  : string
Returns the Year String of the Automation Cron Schedule
getAvailableActiveScriptNamesForContext()  : array<string|int, mixed>
Returns the possible ActiveScript names for a given context
getAvailableActiveScriptsForContext()  : array<string|int, CSActiveScript>
Returns the possible ActiveScripts as array
getAvatarID()  : CSUser
Returns the user this script should run as
getCategories()  : mixed
Returns all available Categories
getCategory()  : string
getDescription()  : string
Returns the Description of the script
getEditorUrl()  : string
Creates a URL to the Editor
getIcon()  : string
getID()  : int
Retrieves the ID
getLabel()  : string
Retrieves the label as it is displayed in the search GUI
getLastRun()  : string
getLastTick()  : int
Retrieves the last tick that was received by an external signal
getLimitForParallelJobs()  : int
Returns the limit of parallel jobs for the active script.
getLimitForParallelScripts()  : int
Returns the limit for parallel script executions with the same plugin.
getLogDisplayCountsForUi()  : array<string|int, string>
Tells which display counts should be used to filter the visible log messages in a user interface
getLogLevel()  : int
Returns the log level of the script
getLogLevelsForUi()  : array<string|int, mixed>
Delivers the available log levels
getMemoryLimit()  : int
Returns the max number of MB main memory the script can run with.
getModuleBaseDirectory()  : string
Returns the base path of the module.
getNextScript()  : CSActiveScript
getOutputKeys()  : array<string|int, string>
Queries the allowed keys for asking output values of a script
getRecord()  : ActiveScript|Record
Returns the internal active script record
getReportUrl()  : string
Get the REST URL for Reporting (CSReport), optional you can pass an ActiveScriptID
getRunJobUrl()  : string
Prepares the URL to run the active script job - url is relative to admin directory.
getSchedulerUserId()  : int
Returns the scheduler user id.
getSleepAfterEachStep()  : int
Returns a number of milliseconds that the script has to sleep after each step
getStatusByType()  : array<string|int, mixed>
Returns an array with the on going status of an active script.
getStatusColor()  : string
Returns a Hex Color including the # for a given script status
getStatusIcon()  : string
Returns an icon path relative to the admin for a given script status
getStatusLabel()  : string
Returns an localized label for a given script status
getStatusName()  : string
Returns an non localized label for a given script status
getStatusNames()  : array<string|int, string>
Returns all available ActiveScript Status Names
getStatusVisibilities()  : array<string|int, mixed>
Delivers the available status visibility filters
getTimeLimit()  : int
Returns the max number of seconds the script should run.
getValue()  : string
Generic method to read a named database value
hasAvailableJobSlot()  : bool
Returns whether an active script job slot is available.
hasAvailableScriptSlot()  : bool
Returns whether a script execution slot is available. It checks active scripts with the same plugin.
isActiveScriptJobExecutionDisabled()  : bool
Checks if the active script job execution is disabled so that no scripts can be executed by tick.
isActiveScriptJobManualExecutionDisabled()  : bool
Checks if the active script job manual execution is disabled so that no scripts can be executed manually.
isAvailableForCurrentUser()  : mixed
Tells if the current script is available for the current user
isInstalled()  : bool
Checks if the ActiveScript Tables are available, otherwise an update data model is required
isVisibleStatus()  : bool
Tells if a given status is visible for a specific visibility setting
setActiveScriptPluginName()  : void
Sets the assigned active script plugin
setAutomationType()  : void
Sets the Automation Type
setCategory()  : mixed
setDescription()  : void
Sets the Description of the script
setLabel()  : mixed
Sets the label
setLastRun()  : mixed
Sets the last run
setLastTick()  : void
Stores the last tick that was received by an external signal
setLimitForParallelJobs()  : void
Sets the limit for parallel jobs of the active script.
setLogLevel()  : void
Sets the log level of the script
setMemoryLimit()  : void
Sets the max number of MB main memory the script can run with.
setSleepAfterEachStep()  : void
Sets the number of milliseconds that the script has to sleep after each step
setTimeLimit()  : void
Sets the max number of seconds the script should run.
setValue()  : void
Sets a value
store()  : void
Stores the active script
tick()  : string
Sends a time signal to the ActiveScript engine to trigger the execution of schedules ActiveJobs

Constants

ACTIVE_SCRIPT_LOG_LEVEL_ALL

public mixed ACTIVE_SCRIPT_LOG_LEVEL_ALL = 1
Tags

ACTIVE_SCRIPT_LOG_LEVEL_NO_DEBUG

public mixed ACTIVE_SCRIPT_LOG_LEVEL_NO_DEBUG = 0
Tags

ACTIVE_SCRIPT_STATUS_DEBUG

public mixed ACTIVE_SCRIPT_STATUS_DEBUG = 10
Tags

ACTIVE_SCRIPT_STATUS_ERROR

public mixed ACTIVE_SCRIPT_STATUS_ERROR = 7
Tags

ACTIVE_SCRIPT_STATUS_IGNORED

public mixed ACTIVE_SCRIPT_STATUS_IGNORED = 12
Tags

ACTIVE_SCRIPT_STATUS_INTERRUPTED

public mixed ACTIVE_SCRIPT_STATUS_INTERRUPTED = 9
Tags

ACTIVE_SCRIPT_STATUS_INTERRUPTION_REQUESTED

public mixed ACTIVE_SCRIPT_STATUS_INTERRUPTION_REQUESTED = 8
Tags

ACTIVE_SCRIPT_STATUS_NOT_YET_STARTED

public mixed ACTIVE_SCRIPT_STATUS_NOT_YET_STARTED = 1
Tags

ACTIVE_SCRIPT_STATUS_OK

public mixed ACTIVE_SCRIPT_STATUS_OK = 5
Tags

ACTIVE_SCRIPT_STATUS_PAUSE_REQUESTED

public mixed ACTIVE_SCRIPT_STATUS_PAUSE_REQUESTED = 3
Tags

ACTIVE_SCRIPT_STATUS_PAUSED

public mixed ACTIVE_SCRIPT_STATUS_PAUSED = 4
Tags

ACTIVE_SCRIPT_STATUS_READY_TO_START

public mixed ACTIVE_SCRIPT_STATUS_READY_TO_START = 13
Tags

ACTIVE_SCRIPT_STATUS_RESULT

public mixed ACTIVE_SCRIPT_STATUS_RESULT = 11
Tags

ACTIVE_SCRIPT_STATUS_RUNNING

public mixed ACTIVE_SCRIPT_STATUS_RUNNING = 2
Tags

ACTIVE_SCRIPT_STATUS_STARTING

public mixed ACTIVE_SCRIPT_STATUS_STARTING = self::ACTIVE_SCRIPT_STATUS_READY_TO_START
Tags
deprecated

Please use the constant "ACTIVE_SCRIPT_STATUS_READY_TO_START"

ACTIVE_SCRIPT_STATUS_TYPE_ALL

The different types of the active script status

public mixed ACTIVE_SCRIPT_STATUS_TYPE_ALL = 255
Tags

ACTIVE_SCRIPT_STATUS_TYPE_ERROR

public mixed ACTIVE_SCRIPT_STATUS_TYPE_ERROR = 8
Tags

ACTIVE_SCRIPT_STATUS_TYPE_FINISHED

public mixed ACTIVE_SCRIPT_STATUS_TYPE_FINISHED = 4
Tags

ACTIVE_SCRIPT_STATUS_TYPE_ONGOING

public mixed ACTIVE_SCRIPT_STATUS_TYPE_ONGOING = 1
Tags

ACTIVE_SCRIPT_STATUS_TYPE_REQUESTED

public mixed ACTIVE_SCRIPT_STATUS_TYPE_REQUESTED = 2
Tags

ACTIVE_SCRIPT_STATUS_UNDEFINED

public mixed ACTIVE_SCRIPT_STATUS_UNDEFINED = 0
Tags

ACTIVE_SCRIPT_STATUS_WAITING

public mixed ACTIVE_SCRIPT_STATUS_WAITING = 14
Tags

ACTIVE_SCRIPT_STATUS_WARNING

public mixed ACTIVE_SCRIPT_STATUS_WARNING = 6
Tags

ACTIVE_SCRIPT_VISIBILITY_ALL

public mixed ACTIVE_SCRIPT_VISIBILITY_ALL = 0
Tags

ACTIVE_SCRIPT_VISIBILITY_DEBUG

public mixed ACTIVE_SCRIPT_VISIBILITY_DEBUG = 8
Tags

ACTIVE_SCRIPT_VISIBILITY_ERRORS

public mixed ACTIVE_SCRIPT_VISIBILITY_ERRORS = 2
Tags

ACTIVE_SCRIPT_VISIBILITY_PROBLEMS

public mixed ACTIVE_SCRIPT_VISIBILITY_PROBLEMS = 4
Tags

ACTIVE_SCRIPT_VISIBILITY_RESULTS

public mixed ACTIVE_SCRIPT_VISIBILITY_RESULTS = 16
Tags

AUTOMATION_EVERY_FIVE_MINUTES

public mixed AUTOMATION_EVERY_FIVE_MINUTES = 2
Tags

AUTOMATION_EVERY_HOUR

public mixed AUTOMATION_EVERY_HOUR = 4
Tags

AUTOMATION_EVERY_MINUTE

public mixed AUTOMATION_EVERY_MINUTE = 1
Tags

AUTOMATION_EVERY_MONTH

public mixed AUTOMATION_EVERY_MONTH = 9
Tags

AUTOMATION_EVERY_MORNING

public mixed AUTOMATION_EVERY_MORNING = 5
Tags

AUTOMATION_EVERY_NIGHT

public mixed AUTOMATION_EVERY_NIGHT = 6
Tags

AUTOMATION_EVERY_TEN_MINUTES

public mixed AUTOMATION_EVERY_TEN_MINUTES = 3
Tags

AUTOMATION_EVERY_WEEK

public mixed AUTOMATION_EVERY_WEEK = 8
Tags

AUTOMATION_EVERY_WORKING_DAY

public mixed AUTOMATION_EVERY_WORKING_DAY = 7
Tags

Methods

__call()

Diverts the call to the AciveScript record for methods that are defined on the record level

public __call(string $sMethodName, unknown $aParameters) : mixed
Parameters
$sMethodName : string

The method name not directly availble in CSActiveScript

$aParameters : unknown

The list of parameters that are recieved for the method call

Tags
Return values
mixed

The response to method as received from the Record

__construct()

The Constructor

public __construct([mixed $mActiveScriptID = null ]) : CSActiveScript
Parameters
$mActiveScriptID : mixed = null

The ID of the active script

Tags
access

public

Return values
CSActiveScript

checkRunningProcesses()

Checks jobs with ongoing status if those processes are still running. In case they are not the error status is applied.

public static checkRunningProcesses() : void
Tags
access

public

Return values
void

createActiveScript()

Creates a new ActiveScript Database Object

public static createActiveScript(mixed $sLabel, mixed $sCategory, mixed $sPluginBaseName) : CSActiveScript
Parameters
$sLabel : mixed
$sCategory : mixed
$sPluginBaseName : mixed
Tags
sLabel

string the name of the script

sCategory

string the category of the script

sPluginBaseName

string the plugin assigned

Return values
CSActiveScript

createActiveScriptJobInputData()

Creates a new ActiveScript Input Data object that can be passed to the job

public static createActiveScriptJobInputData([array<string|int, string> $aData = array() ]) : CSActiveScriptJobInputData
Parameters
$aData : array<string|int, string> = array()

the input key and values

Tags
Return values
CSActiveScriptJobInputData

createDefaultScripts()

Utility method that creates recommended default scripts typically called at update data model

public static createDefaultScripts() : void
Tags
Return values
void

createScriptPlugin()

Creates and pre configures a new script

public static createScriptPlugin(string $prefix) : array<string|int, string>
Parameters
$prefix : string

the script plugin name without the Script.php at the end

Tags
throws
CSException
Return values
array<string|int, string>

array with at least the ActiveScriptID

delete()

Deletes the script and all attached jobs and logs.

public delete() : void
Tags
access

public

Return values
void

deleteStepsOfEndedJobs()

Cleans up the step list table by deleting steps of finished jobs

public static deleteStepsOfEndedJobs() : void
Tags
access

public

Return values
void

disableActiveScriptJobExecution()

Disables the active script job execution.

public static disableActiveScriptJobExecution() : bool
Tags
Return values
bool

whether the option could be set or not.

enableActiveScriptJobExecution()

Enables the active script execution.

public static enableActiveScriptJobExecution() : bool
Tags
Return values
bool

whether the option could be set or not.

getActiveScript()

Retrieves a Active Script object

public static getActiveScript([int|string|Rule $mIdentifier = null ]) : CSActiveScript
Parameters
$mIdentifier : int|string|Rule = null

ID or ActiveScript

Tags
access

public

Return values
CSActiveScript

getActiveScriptJobsForFilter()

Returns a list of all Active Script Jobs for specified ActiveScriptIDs/StatusIDs/TimePeriods/SortOrder if provided, otherwise returns a list of all Active Script Jobs.

public static getActiveScriptJobsForFilter([array<string|int, mixed> $aActiveScriptIds = array() ][, array<string|int, mixed> $aStatusIDs = array() ][, string $sFromDate = null ][, string $sToDate = null ][, string $sSortOrder = '' ][, int $iLimit = null ]) : array<string|int, CSActiveScriptJob>
Parameters
$aActiveScriptIds : array<string|int, mixed> = array()

List of ActiveScript Ids.

$aStatusIDs : array<string|int, mixed> = array()

List of ActiveScriptJob Status Ids.

$sFromDate : string = null

From date to filter Active Script Jobs beyond this date .

$sToDate : string = null

TO date to filter Active Script Jobs up to this date.

$sSortOrder : string = ''

Sort order in which jobs to be collected i.e 'FIELD_NAME [ASC/DESC]'.

$iLimit : int = null
Tags
Return values
array<string|int, CSActiveScriptJob>

Array with ActiveScriptJobs against ActiveScriptJobID.

getActiveScriptJobsForScriptWithID()

Returns a list of ActiveScriptJobs for a specified script

public static getActiveScriptJobsForScriptWithID(int $iActiveScriptID) : array<string|int, CSActiveScriptJob>
Parameters
$iActiveScriptID : int

the ID of the Script

Tags
Return values
array<string|int, CSActiveScriptJob>

array with ActiveScriptJobs

getActiveScriptJobsForStatus()

Returns a list of ActiveScriptJobs for a specified Status and Script

public static getActiveScriptJobsForStatus(array<string|int, mixed> $aStatusIDs[, int $iActiveScriptID = null ]) : array<string|int, CSActiveScriptJob>
Parameters
$aStatusIDs : array<string|int, mixed>

the filter for the ActiveScriptJob Status

$iActiveScriptID : int = null

optional ActiveScriptID

Tags
Return values
array<string|int, CSActiveScriptJob>

array with ActiveScriptJobs

getActiveScriptJobsWithOngoingStatus()

Returns a list of ActiveScriptJobs for status which are still on going.

public static getActiveScriptJobsWithOngoingStatus(int $iActiveScriptID) : array<string|int, CSActiveScriptJob>
Parameters
$iActiveScriptID : int

The ID of the active script.

Tags
Return values
array<string|int, CSActiveScriptJob>

a list of ActiveScriptJobs for status which are still on going.

getActiveScriptLog()

Retrieves a Active Script Log object

public static getActiveScriptLog(int|string|Rule $mIdentifier) : CSActiveScriptLog
Parameters
$mIdentifier : int|string|Rule

ID or ActiveScriptLog

Tags
access

public

Return values
CSActiveScriptLog

getActiveScriptLogsAfterLog()

Returns all logs after the given log id for the same job

public static getActiveScriptLogsAfterLog(int $iActiveScriptLogID[, bool|true $bIncludeFirst = true ]) : array<string|int, CSActiveScriptLog>
Parameters
$iActiveScriptLogID : int

The id of the start log

$bIncludeFirst : bool|true = true

If true the start log is also included

Tags
Return values
array<string|int, CSActiveScriptLog>

getActiveScriptLogsForJobWithID()

Returns a list of ActiveScriptLogs for a specified job

public static getActiveScriptLogsForJobWithID(int $iActiveScriptJobID[, int $iSortOrder = CS_SORT_NUMERICAL_ASC ], int $iLimit, int $iStartLogID) : array<string|int, CSActiveScriptLog>
Parameters
$iActiveScriptJobID : int

The ID of the job

$iSortOrder : int = CS_SORT_NUMERICAL_ASC

Either CS_SORT_NUMERICAL_ASC or CS_SORT_NUMERICAL_DESC

$iLimit : int

If greater than 0 the results will be limited to this amount of logs

$iStartLogID : int

If greater than 0 the results will start from this LogID

Tags
Return values
array<string|int, CSActiveScriptLog>

array with ActiveScriptLogs

getActiveScriptNames()

Returns a list of configured active script names

public static getActiveScriptNames() : array<string|int, string>
Tags
Return values
array<string|int, string>

array with ActiveScriptIDs as key and ActiveScript Name as value

getActiveScriptNamesForPluginWithName()

Returns a list of configured active script names with a specified script plugin

public static getActiveScriptNamesForPluginWithName(string $sPluginName) : array<string|int, string>
Parameters
$sPluginName : string

the name of the plugin without the postfix Script.php

Tags
Return values
array<string|int, string>

array with ActiveScriptIDs as key and ActiveScript Name as value

getActiveScriptPluginNames()

Collects all available ActiveScript Plugins

public static getActiveScriptPluginNames([bool $bSelectableOnly = false ]) : array<string|int, CSActiveScriptPlugin>
Parameters
$bSelectableOnly : bool = false

if true then only plugins will be returned that are selectable

Tags
access

public

Return values
array<string|int, CSActiveScriptPlugin>

The plugins

getActiveScriptPlugins()

Collects all available ActiveScript Plugins

public static getActiveScriptPlugins([bool $bSelectableOnly = false ]) : array<string|int, CSActiveScriptPlugin>
Parameters
$bSelectableOnly : bool = false

if true then only plugins will be returned that are selectable

Tags
access

public

Return values
array<string|int, CSActiveScriptPlugin>

The plugins

getActiveScriptResultLogLinksForJobWithID()

Returns a list of ActiveScript Result Log Links for a specified job

public static getActiveScriptResultLogLinksForJobWithID(int $iActiveScriptJobID) : array<string|int, CSActiveScriptLogLink>
Parameters
$iActiveScriptJobID : int

the ID of the job

Tags
Return values
array<string|int, CSActiveScriptLogLink>

array with ActiveScriptLogLinks of type Result

getActiveScriptResultLogsForJobWithID()

Returns a list of ActiveScript Result Logs for a specified job

public static getActiveScriptResultLogsForJobWithID(int $iActiveScriptJobID) : array<string|int, CSActiveScriptLog>
Parameters
$iActiveScriptJobID : int

the ID of the job

Tags
Return values
array<string|int, CSActiveScriptLog>

array with ActiveScriptLogs of type Result

getActiveScripts()

Returns a list of configured active scripts

public static getActiveScripts() : array<string|int, CSActiveScript>
Tags
Return values
array<string|int, CSActiveScript>

array with ActiveScripts

getActiveScriptsForPluginWithName()

Returns a list of configured active scripts with a specified script plugin

public static getActiveScriptsForPluginWithName(string $sPluginName) : array<string|int, CSActiveScript>
Parameters
$sPluginName : string

the name of the plugin without the postfix Script.php

Tags
Return values
array<string|int, CSActiveScript>

array with ActiveScripts

getActiveScriptsWithAutomation()

Returns a list of configured active scripts with an automation type

public static getActiveScriptsWithAutomation() : array<string|int, CSActiveScript>
Tags
Return values
array<string|int, CSActiveScript>

array with ActiveScripts

getAutomationActionPluginNames()

Collects all available AutomationAction Plugins

public static getAutomationActionPluginNames() : array<string|int, CSAutomationActionPlugin>
Tags
access

public

Return values
array<string|int, CSAutomationActionPlugin>

The plugins

getAutomationActionPlugins()

Collects all available old AutomationAction Plugins

public static getAutomationActionPlugins() : array<string|int, CSAutomationActionPLugin>
Tags
access

public

Return values
array<string|int, CSAutomationActionPLugin>

The plugins

getAutomationCronString()

Returns the compiled cron string as it would be understood by a real cron job.

public getAutomationCronString() : string
Tags
Return values
string

getAutomationDay()

Returns the Day String of the Automation Cron Schedule

public getAutomationDay() : string
Tags
Return values
string

the day string

getAutomationHour()

Returns the Hour String of the Automation Cron Schedule

public getAutomationHour() : string
Tags
Return values
string

the hour string

getAutomationIsDue()

Tells if at the given minute the automation is due

public getAutomationIsDue() : bool
Tags
throws
CSException
Return values
bool

getAutomationMinute()

Returns the Minute String of the Automation Cron Schedule

public getAutomationMinute() : string
Tags
Return values
string

the minute string

getAutomationMonth()

Returns the Month String of the Automation Cron Schedule

public getAutomationMonth() : string
Tags
Return values
string

the month string

getAutomationNextRunDate()

Calculates the next automation run date and returns a formatted date.

public getAutomationNextRunDate([mixed $mCurrentTime = null ][, int|string $mLanguage = '' ]) : string
Parameters
$mCurrentTime : mixed = null

The time which should be used for the calculation.

$mLanguage : int|string = ''

The language id or short name to get the correct language date format.

Tags
throws
CSException
Return values
string

with the calculated next automaiton run date.

getAutomationType()

Returns the selected automation type as one of the self::AUTOMATION_* constants

public getAutomationType() : int
Tags
Return values
int

the automation type

getAutomationTypeLabel()

Gets the localized label for an automation type

public static getAutomationTypeLabel(int $iAutomationType) : string
Parameters
$iAutomationType : int

on of the self::AUTOMATION_* constants

Tags
Return values
string

getAutomationTypeLabels()

Fetches the list of labels of the automation types

public static getAutomationTypeLabels() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

getAutomationWeekday()

Returns the Weekday String of the Automation Cron Schedule

public getAutomationWeekday() : string
Tags
Return values
string

the weekday string

getAutomationYear()

Returns the Year String of the Automation Cron Schedule

public getAutomationYear() : string
Tags
Return values
string

the year string

getAvailableActiveScriptNamesForContext()

Returns the possible ActiveScript names for a given context

public static getAvailableActiveScriptNamesForContext([CSActiveScriptContext $oContext = null ][, mixed $bIgnoreAccessFilter = true ]) : array<string|int, mixed>
Parameters
$oContext : CSActiveScriptContext = null

the context

$bIgnoreAccessFilter : mixed = true
Tags
Return values
array<string|int, mixed>

with ActiveScript names as values and ActiveScriptIDs as keys

getAvailableActiveScriptsForContext()

Returns the possible ActiveScripts as array

public static getAvailableActiveScriptsForContext([CSActiveScriptContext $oContext = null ]) : array<string|int, CSActiveScript>
Parameters
$oContext : CSActiveScriptContext = null

the context may be any kind of object that a user of an ActiveScript might pass with the expectation, that only matching scripts should be returned.

Tags
Return values
array<string|int, CSActiveScript>

array with CSActiveScriptIDs as keys and CSActiveScript as values

getCategories()

Returns all available Categories

public static getCategories() : mixed
Tags
Return values
mixed

getCategory()

public getCategory() : string
Tags
Return values
string

the category

getDescription()

Returns the Description of the script

public getDescription() : string
Tags
Return values
string

getEditorUrl()

Creates a URL to the Editor

public getEditorUrl() : string
Tags
Return values
string

the URL

getIcon()

public getIcon() : string
Tags
Return values
string

the icon representation of the script as relative URL

getID()

Retrieves the ID

public getID() : int
Tags
access

public

Return values
int

The ID

getLabel()

Retrieves the label as it is displayed in the search GUI

public getLabel() : string
Tags
access

public

Return values
string

The label

getLastRun()

public getLastRun() : string
Tags
Return values
string

the formatted time

getLastTick()

Retrieves the last tick that was received by an external signal

public static getLastTick() : int
Tags
Return values
int

the seconds since 1970

getLimitForParallelJobs()

Returns the limit of parallel jobs for the active script.

public getLimitForParallelJobs() : int
Tags
Return values
int

with the limit of parallel jobs for the active script.

getLimitForParallelScripts()

Returns the limit for parallel script executions with the same plugin.

public getLimitForParallelScripts() : int
Tags
Return values
int

getLogDisplayCountsForUi()

Tells which display counts should be used to filter the visible log messages in a user interface

public static getLogDisplayCountsForUi() : array<string|int, string>
Tags
Return values
array<string|int, string>

array with the amount as key and the translation as value

getLogLevel()

Returns the log level of the script

public getLogLevel() : int
Tags
Return values
int

the log level as one of the CSActiveScript::ACTIVE_SCRIPT_LOG_LEVEL_* constants

getLogLevelsForUi()

Delivers the available log levels

public static getLogLevelsForUi() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

with the log levels as key and the interface name as value

getMemoryLimit()

Returns the max number of MB main memory the script can run with.

public getMemoryLimit() : int
Tags
Return values
int

the memory limit in MB

getModuleBaseDirectory()

Returns the base path of the module.

public static getModuleBaseDirectory([string $sBaseType = null ]) : string
Parameters
$sBaseType : string = null

The type of link that shall be returned, see for details.

Tags
access

public

Return values
string

The location of the module in relation to the specified location base type.

getOutputKeys()

Queries the allowed keys for asking output values of a script

public getOutputKeys() : array<string|int, string>
Tags
Return values
array<string|int, string>

array with the keys

getRecord()

Returns the internal active script record

public getRecord() : ActiveScript|Record
Tags
Return values
ActiveScript|Record

getReportUrl()

Get the REST URL for Reporting (CSReport), optional you can pass an ActiveScriptID

public static getReportUrl([int $iActiveScriptID = null ]) : string
Parameters
$iActiveScriptID : int = null

if provided only data for this ActiveScript is provided

Tags
Return values
string

the URL

getRunJobUrl()

Prepares the URL to run the active script job - url is relative to admin directory.

public static getRunJobUrl(int $iActiveScriptId, string $sContextClass[, array<string|int, mixed> $aContextIds = array() ]) : string
Parameters
$iActiveScriptId : int

The ID of the active script

$sContextClass : string

The context class

$aContextIds : array<string|int, mixed> = array()

The list of context ids

Tags
Return values
string

The URL relative to admin for running the active script job

getSchedulerUserId()

Returns the scheduler user id.

public static getSchedulerUserId() : int

If the user does not exist the user will be created!

Tags
Return values
int

with the scheduler user id.

getSleepAfterEachStep()

Returns a number of milliseconds that the script has to sleep after each step

public getSleepAfterEachStep() : int
Tags
Return values
int

the number of milliseconds

getStatusByType()

Returns an array with the on going status of an active script.

public static getStatusByType([int $iStatusType = self::ACTIVE_SCRIPT_STATUS_TYPE_ALL ]) : array<string|int, mixed>
Parameters
$iStatusType : int = self::ACTIVE_SCRIPT_STATUS_TYPE_ALL

The requested type for the active script status. Please use the constants CSActiveScript::ACTIVE_SCRIPT_STATUS_TYPE_*

Tags
Return values
array<string|int, mixed>

with the on going status of an active script.

getStatusColor()

Returns a Hex Color including the # for a given script status

public static getStatusColor(int $status) : string
Parameters
$status : int

on of the CSActiveScript::ACTIVESCRIPT_STATUS_* constants

Tags
Return values
string

the color like #00FF00

getStatusIcon()

Returns an icon path relative to the admin for a given script status

public static getStatusIcon(int $status) : string
Parameters
$status : int

on of the CSActiveScript::ACTIVESCRIPT_STATUS_* constants

Tags
Return values
string

the icon path

getStatusLabel()

Returns an localized label for a given script status

public static getStatusLabel(int $status[, string $language = null ]) : string
Parameters
$status : int

on of the CSActiveScript::ACTIVESCRIPT_STATUS_* constants

$language : string = null

the language short name, if null the default lang will be used

Tags
Return values
string

the localized label

getStatusName()

Returns an non localized label for a given script status

public static getStatusName(int $status) : string
Parameters
$status : int

on of the CSActiveScript::ACTIVESCRIPT_STATUS_* constants

Tags
Return values
string

the non localized label

getStatusNames()

Returns all available ActiveScript Status Names

public static getStatusNames() : array<string|int, string>
Tags
Return values
array<string|int, string>

array with status id as key and name as value

getStatusVisibilities()

Delivers the available status visibility filters

public static getStatusVisibilities() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

with the visibility keyword as key and the interface name as value

getTimeLimit()

Returns the max number of seconds the script should run.

public getTimeLimit() : int

If this value is 0 the script can run unlimited.

Tags
Return values
int

the time limit

getValue()

Generic method to read a named database value

public getValue(string $name) : string
Parameters
$name : string

The name of the value

Tags
access

public

Return values
string

The value

hasAvailableJobSlot()

Returns whether an active script job slot is available.

public hasAvailableJobSlot() : bool
Tags
Return values
bool

whether an active script job slot is available.

hasAvailableScriptSlot()

Returns whether a script execution slot is available. It checks active scripts with the same plugin.

public hasAvailableScriptSlot() : bool
Tags
Return values
bool

isActiveScriptJobExecutionDisabled()

Checks if the active script job execution is disabled so that no scripts can be executed by tick.

public static isActiveScriptJobExecutionDisabled() : bool
Tags
Return values
bool

if the active script job execution is disabled so that no scripts can be executed by tick.

isActiveScriptJobManualExecutionDisabled()

Checks if the active script job manual execution is disabled so that no scripts can be executed manually.

public static isActiveScriptJobManualExecutionDisabled() : bool
Tags
Return values
bool

if the active script job execution is disabled so that no scripts can be executed manually.

isAvailableForCurrentUser()

Tells if the current script is available for the current user

public isAvailableForCurrentUser() : mixed
Tags
Return values
mixed

isInstalled()

Checks if the ActiveScript Tables are available, otherwise an update data model is required

public static isInstalled() : bool
Tags
Return values
bool

true if available

isVisibleStatus()

Tells if a given status is visible for a specific visibility setting

public static isVisibleStatus(int $iStatus, string $sStatusVisibility) : bool
Parameters
$iStatus : int

the status to be checked

$sStatusVisibility : string

the visibility setting

Tags
Return values
bool

true if visible

setActiveScriptPluginName()

Sets the assigned active script plugin

public setActiveScriptPluginName(string $sPluginName) : void
Parameters
$sPluginName : string

ActiveScriptPlugin Name

Tags
Return values
void

setAutomationType()

Sets the Automation Type

public setAutomationType(int $iType) : void
Parameters
$iType : int

the type as one of the self::AUTOMATION_* constants

Tags
Return values
void

setCategory()

public setCategory(string $sCategory) : mixed
Parameters
$sCategory : string

the category

Tags
Return values
mixed

setDescription()

Sets the Description of the script

public setDescription(string $sDescription) : void
Parameters
$sDescription : string

The description string to be set

Tags
Return values
void

setLabel()

Sets the label

public setLabel(string $sLabel) : mixed
Parameters
$sLabel : string

The label

Tags
access

public

Return values
mixed

setLastRun()

Sets the last run

public setLastRun([mixed $time = null ]) : mixed
Parameters
$time : mixed = null

the formatted time including seconds

Tags
Return values
mixed

setLastTick()

Stores the last tick that was received by an external signal

public static setLastTick(int $time) : void
Parameters
$time : int

seconds since 1970

Tags
Return values
void

setLimitForParallelJobs()

Sets the limit for parallel jobs of the active script.

public setLimitForParallelJobs(int $iParallelJobs) : void
Parameters
$iParallelJobs : int

The limit for available parallel jobs.

Tags
Return values
void

setLogLevel()

Sets the log level of the script

public setLogLevel(int $iLogLevel) : void
Parameters
$iLogLevel : int

the log level as one of the CSActiveScript::ACTIVE_SCRIPT_LOG_LEVEL_* constants

Tags
Return values
void

setMemoryLimit()

Sets the max number of MB main memory the script can run with.

public setMemoryLimit(int $iMB) : void
Parameters
$iMB : int

the memory limit in MB (Mega Byte)

Tags
Return values
void

setSleepAfterEachStep()

Sets the number of milliseconds that the script has to sleep after each step

public setSleepAfterEachStep(mixed $iMilliseconds) : void
Parameters
$iMilliseconds : mixed
Tags
Return values
void

setTimeLimit()

Sets the max number of seconds the script should run.

public setTimeLimit(int $iSeconds) : void

If this value is 0 the script can run unlimited.

Parameters
$iSeconds : int

the time limit

Tags
Return values
void

setValue()

Sets a value

public setValue(string $name, string $value) : void
Parameters
$name : string
$value : string
Tags
Return values
void

store()

Stores the active script

public store() : void
Tags
Return values
void

tick()

Sends a time signal to the ActiveScript engine to trigger the execution of schedules ActiveJobs

public static tick() : string

By default this method is automatically executed when ever the ActiveScript Restservice method admin/tick is called up as GET request.

In a properly installed environment this URL would be called up by a cron job once a minute. This method however can also be called by other processes, e.g. the Contentserv Scheduler.

Tags
throws
CSException
throws
Exception
Return values
string

        

Search results