CSLicensePlugin
extends CSPlugin
in package
This plugin adds some license option to the CONTENTSERV license and is called to prove the license.
To be included, it must be placed in a core subfolder with a file name ending with License.php.
Tags
Table of Contents
- GROUP_BPM = '20|BPM Products'
- GROUP_CMS_STUDIO = '12|CMS Studio'
- GROUP_CORE = '00|CORE Basis Framework'
- GROUP_CREATIVE_PUBLISHING = '28|Creative Publishing'
- GROUP_DYNAMIC_PUBLISHING = '26|Dynamic Publishing'
- GROUP_EMM_BRANDKEEPER = '10|EMM BrandKeeper'
- GROUP_EMM_CAMPAIGNMANAGER = '08|EMM Campaign Manager'
- GROUP_EMM_STUDIO = '06|EMM Studio'
- GROUP_ESA = '22|ESA'
- GROUP_MAM_CONNECTOR = '04b|MAM Connector'
- GROUP_MAM_STUDIO = '04a|MAM Studio'
- GROUP_PIM_CONNECTOR = '02b|PIM Connector'
- GROUP_PIM_STUDIO = '02a|PIM Studio'
- GROUP_PPM_INDESIGN = '14|PPM InDesign Editor'
- GROUP_PPM_PUBLICATION = '16|PPM Publication Manager'
- GROUP_PROJECTBASED = '24|Projectbased modules'
- GROUP_SCM = '18|SCM Manager Framework'
- __call() : mixed|string
- All method calls which are not defined within the plugin are forwarded to the module Therefore it is possible to get, e.g. the label by calling the getSuiteName() method.
- _construct() : void
- The construct method may be used to initialize custom plugin properties it is called immediately after instantiating the plugin all arguments passed to the getPlugins method are also available in this method.
- addAlternativePluginFolder() : void
- A path to a specific folder in which should be search for plugins.
- addLicenseFields() : mixed
- This method will be called by the install Dialog to add all necessary license input fields.
- checkLicense() : string
- This method will be called sometimes by the LicenseCheck to check if the state of the project matches the license settings for this module.
- getAlternativePluginFolder() : array<string|int, mixed>
- getCurrentLicenseCount() : int
- This method will be called sometimes by the default checkLicense method to get the current value for a numeric licenseField, which must be checked, e.g. with a Database query.
- getLevel() : int
- The getLevel method may be overwritten in the plugins and defines the order, the plugins are called, where the highest level is called first.
- getMetaData() : CSMetaData
- Returns the CSMetaData of the current plugin.
- getModule() : CSModule
- Returns the module, if the plugin is defined within a module.
- getPlugin() : CSPlugin|null
- Returns a CSPlugin for the given plugin type and plugin class name.
- getPluginChooser() : array<string|int, mixed>
- Returns an array all defined CSPlugins for the current plugin type
- getPluginData() : mixed
- getPluginDefinitionFile() : string
- Returns the path to the file, the plugin is defined.
- getPluginName() : mixed
- getPlugins() : array<string|int, CSPlugin>
- Returns all defined CSPlugins for the current plugin type It should be used to get all matching plugins for a given plugin api.
- getPluginsInModule() : array<string|int, mixed>
- Returns all CSPlugins for the current plugin type which are defined within the given module It should be used to get all matching plugins for a given plugin api.
- getUserCount() : int
- Counts the number of users with given rights
- isAvailable() : bool
- This method is called to check, whether the plugin is available.
- resetLoadedPlugins() : mixed
- reset the internal plugins cache for loaded plugins
- shouldCheckLicenseForServerType() : bool
- This method allows a license plugin to define if the licensing should be limiting a particular server type. If for example the license should be considered only for productive systems, this method can return false for all other server types.
Constants
GROUP_BPM
public
mixed
GROUP_BPM
= '20|BPM Products'
Tags
GROUP_CMS_STUDIO
public
mixed
GROUP_CMS_STUDIO
= '12|CMS Studio'
Tags
GROUP_CORE
public
mixed
GROUP_CORE
= '00|CORE Basis Framework'
Tags
GROUP_CREATIVE_PUBLISHING
public
mixed
GROUP_CREATIVE_PUBLISHING
= '28|Creative Publishing'
Tags
GROUP_DYNAMIC_PUBLISHING
public
mixed
GROUP_DYNAMIC_PUBLISHING
= '26|Dynamic Publishing'
Tags
GROUP_EMM_BRANDKEEPER
public
mixed
GROUP_EMM_BRANDKEEPER
= '10|EMM BrandKeeper'
Tags
GROUP_EMM_CAMPAIGNMANAGER
public
mixed
GROUP_EMM_CAMPAIGNMANAGER
= '08|EMM Campaign Manager'
Tags
GROUP_EMM_STUDIO
public
mixed
GROUP_EMM_STUDIO
= '06|EMM Studio'
Tags
GROUP_ESA
public
mixed
GROUP_ESA
= '22|ESA'
Tags
GROUP_MAM_CONNECTOR
public
mixed
GROUP_MAM_CONNECTOR
= '04b|MAM Connector'
Tags
GROUP_MAM_STUDIO
public
mixed
GROUP_MAM_STUDIO
= '04a|MAM Studio'
Tags
GROUP_PIM_CONNECTOR
public
mixed
GROUP_PIM_CONNECTOR
= '02b|PIM Connector'
Tags
GROUP_PIM_STUDIO
public
mixed
GROUP_PIM_STUDIO
= '02a|PIM Studio'
Tags
GROUP_PPM_INDESIGN
public
mixed
GROUP_PPM_INDESIGN
= '14|PPM InDesign Editor'
Tags
GROUP_PPM_PUBLICATION
public
mixed
GROUP_PPM_PUBLICATION
= '16|PPM Publication Manager'
Tags
GROUP_PROJECTBASED
public
mixed
GROUP_PROJECTBASED
= '24|Projectbased modules'
Tags
GROUP_SCM
public
mixed
GROUP_SCM
= '18|SCM Manager Framework'
Tags
Methods
__call()
All method calls which are not defined within the plugin are forwarded to the module Therefore it is possible to get, e.g. the label by calling the getSuiteName() method.
public
__call(mixed $methodName, mixed $methodArguments) : mixed|string
Parameters
- $methodName : mixed
- $methodArguments : mixed
Tags
Return values
mixed|string —_construct()
The construct method may be used to initialize custom plugin properties it is called immediately after instantiating the plugin all arguments passed to the getPlugins method are also available in this method.
public
_construct() : void
Tags
Return values
void —addAlternativePluginFolder()
A path to a specific folder in which should be search for plugins.
public
static addAlternativePluginFolder(mixed $sPluginFolder) : void
Parameters
- $sPluginFolder : mixed
Tags
Return values
void —addLicenseFields()
This method will be called by the install Dialog to add all necessary license input fields.
public
addLicenseFields(CSLicense $csLicense) : mixed
It it is not overwritten, there is only one checkbox for activating and deactivating the module
Parameters
- $csLicense : CSLicense
-
the current object where fields can be added using the addLicenseField method
Tags
Return values
mixed —checkLicense()
This method will be called sometimes by the LicenseCheck to check if the state of the project matches the license settings for this module.
public
checkLicense() : string
As default behaviour it checks all numeric values with the getCurrentLicenseCount method.
An error message which is later displayed, should be returned, if it doesn't match.
Tags
Return values
string —an error message which should be displayed as alert warning
getAlternativePluginFolder()
public
static getAlternativePluginFolder() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getCurrentLicenseCount()
This method will be called sometimes by the default checkLicense method to get the current value for a numeric licenseField, which must be checked, e.g. with a Database query.
public
getCurrentLicenseCount(string $fieldName) : int
Parameters
- $fieldName : string
-
the name of the license field which should be checked in the form [MODULE]:[NAME].
Tags
Return values
int —the current count or null, if the $fieldName is not countable
getLevel()
The getLevel method may be overwritten in the plugins and defines the order, the plugins are called, where the highest level is called first.
public
getLevel() : int
The method can also be set for all plugins within a module by overwriting the modules getLevel method.
Tags
Return values
int —the level of the plugin where it is called
getMetaData()
Returns the CSMetaData of the current plugin.
public
getMetaData() : CSMetaData
Tags
Return values
CSMetaData —getModule()
Returns the module, if the plugin is defined within a module.
public
getModule() : CSModule
This method can be used in the plugin api and the plugin wherever access to the defining module is required. If it is used in the Api, it should be noticed that this method may return null, if the plugin is directly defined in the projects or admin.local plugins directory.
Tags
Return values
CSModule —the module object, if the plugin defined in a module or null otherwise
getPlugin()
Returns a CSPlugin for the given plugin type and plugin class name.
public
static getPlugin(string $pluginApiPath, string $className[, mixed $arguments = NULL ]) : CSPlugin|null
As standard behaviour the module subfolder is guessed from the forward URL parameter. If a plugin should point to something in a special module subfolder, this scope can be added by adding the module name in squared bracket at the end of the $pluginApiPath, e.g. 'core/api/plugins/CSRecordPlugin.php[pms]' to get all CSRecordPlugins defined for pms records.
Parameters
- $pluginApiPath : string
-
The relative path in filesystem for the requested plugin api (optional: ending with the module subfolder).
- $className : string
-
The target plugin class name, which should be loaded.
- $arguments : mixed = NULL
-
one or multiple arguments which should be passed to the isAvailable method.
Tags
Return values
CSPlugin|null —Returns the requested plugin for the given parameter.
getPluginChooser()
Returns an array all defined CSPlugins for the current plugin type
public
static getPluginChooser(string $pluginApiPath[, mixed $arguments = NULL ]) : array<string|int, mixed>
Parameters
- $pluginApiPath : string
-
the relative path in filesystem for the requested plugin api (optional: ending with the module subfolder).
- $arguments : mixed = NULL
-
one ore multiple arguments which should be passed to the isAvailable method.
Tags
Return values
array<string|int, mixed> —of CSPlugins in the form [CLASSNAME => LABEL] where the CLASSNAME may be used in the CSPlugin::getPlugin method
getPluginData()
public
getPluginData() : mixed
Tags
Return values
mixed —getPluginDefinitionFile()
Returns the path to the file, the plugin is defined.
public
getPluginDefinitionFile() : string
Tags
Return values
string —the path to the plugin
getPluginName()
public
getPluginName() : mixed
Tags
Return values
mixed —getPlugins()
Returns all defined CSPlugins for the current plugin type It should be used to get all matching plugins for a given plugin api.
public
static getPlugins(string $pluginApiPath[, mixed $arguments = NULL ]) : array<string|int, CSPlugin>
As standard behaviour the module subfolder is guessed from the forward URL parameter. If a plugin should point to something in a special module subfolder, this scope can be added by adding the module name in squared bracket at the end of the $pluginApiPath, e.g. 'core/api/plugins/CSRecordPlugin.php[pms]' to get all CSRecordPlugins defined for pms records.
Parameters
- $pluginApiPath : string
-
the relative path in filesystem for the requested plugin api (optional: ending with the module subfolder).
- $arguments : mixed = NULL
-
one ore multiple arguments which should be passed to the isAvailable method.
Tags
Return values
array<string|int, CSPlugin> —array of CSPlugin objects matching the defined plugin criteria
getPluginsInModule()
Returns all CSPlugins for the current plugin type which are defined within the given module It should be used to get all matching plugins for a given plugin api.
public
static getPluginsInModule(string $moduleName, string $pluginApiPath[, mixed $sFileNamePattern = '' ][, mixed $arguments = NULL ]) : array<string|int, mixed>
Parameters
- $moduleName : string
-
the module which should be searched for plugins
- $pluginApiPath : string
-
the relative path in filesystem for the requested plugin api.
- $sFileNamePattern : mixed = ''
- $arguments : mixed = NULL
-
one ore multiple arguments which should be passed to the isAvailable method.
Tags
Return values
array<string|int, mixed> —of CSPlugin objects matching the defined plugin criterias
getUserCount()
Counts the number of users with given rights
public
static getUserCount(string $module[, string $right = '' ][, bool $withLoginRights = true ][, bool $concurrentUsers = false ]) : int
Parameters
- $module : string
-
the name of the module to check users for.
- $right : string = ''
-
the right on the module the users must have.
- $withLoginRights : bool = true
-
whether only users with login rights are counted.
- $concurrentUsers : bool = false
-
whether only concurrent users are counted.
Tags
Return values
int —the amount of users with the given rights
isAvailable()
This method is called to check, whether the plugin is available.
public
isAvailable() : bool
If further arguments are added to the CSPlugin::getPlugins call, they are added as arguments to this method.
For simpler usage of the plugin concept: This method should be overwritten with the correct signature for a plugin call, if arguments are passed.
Tags
Return values
bool —whether the plugin is available for the given arguments
resetLoadedPlugins()
reset the internal plugins cache for loaded plugins
public
static resetLoadedPlugins() : mixed
Tags
Return values
mixed —shouldCheckLicenseForServerType()
This method allows a license plugin to define if the licensing should be limiting a particular server type. If for example the license should be considered only for productive systems, this method can return false for all other server types.
public
shouldCheckLicenseForServerType(string $sServerType) : bool
Parameters
- $sServerType : string
-
The server type as one of the CSLicense::SERVER_TYPE_*-constants.
Tags
Return values
bool —True if the license limits the given server type, otherwise false.
