Contentserv PHP API

CSCometConnector extends CSPlugin
in package

The base of all Comet Connector Plugins To be included, it must be placed in a plugins/comet subfolder with a file name ending with CometConnector.php.

Tags
since

CS12.1

Table of Contents

__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.
getAlternativePluginFolder()  : array<string|int, mixed>
getAttribute()  : mixed
getClassID()  : mixed
getCometNodes()  : array<string|int, CSCometNode>
getDocumentInfoString()  : mixed
getDocuments()  : mixed
getDocumentStatusString()  : mixed
getFields()  : array<string|int, mixed>
Gets the fields of an item
getImageAttribute()  : mixed
getImageAttributeReferences()  : array<string|int, mixed>
Returns all the image references of an item having attribute of type 'Reference to MAM file'.
getItem()  : mixed
getItems()  : mixed
getLanguageID()  : int
Returns the layer- and document-specific language ID.
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.
getLoadActionID()  : mixed
getMetaData()  : CSMetaData
Returns the CSMetaData of the current plugin.
getModule()  : CSModule
Returns the module, if the plugin is defined within a module.
getNode()  : mixed
getNodes()  : CSCometNode
getPlaceholders()  : mixed
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.
getRecordClass()  : mixed
getSharepoint()  : CSCometSharepoint
getSharepointDocumentFromFile()  : mixed
getStandardField()  : mixed
getStandardFieldID()  : mixed
getStandardFields()  : mixed
getStoreActionID()  : mixed
getSyncActionID()  : mixed
getTargetReferenceRecordClass()  : string
Returns the record class for the records the connector handles
getTextAttribute()  : mixed
isAvailable()  : bool
This method is called to check, whether the plugin is available.
onAddReferencesToList()  : void
Called before an item reference from this share was added to a reference list. It can be overwritten to execute some post operations.
onBeforeAddReferencesToList()  : mixed
Called before an item reference from this share is added to a reference list. It can be overwritten and canceld by returning a value not equal to true. In that case the adding is aborted but can be also performed sharepoint specific. The value returned by this method is also the one returned to the initial caller of the adding operation.
prepareEditor()  : mixed
resetLoadedPlugins()  : mixed
reset the internal plugins cache for loaded plugins
setAttribute()  : mixed
setLanguageID()  : mixed
setSharepoint()  : mixed
syncAttribute()  : mixed

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

getAlternativePluginFolder()

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

getAttribute()

public getAttribute(mixed $item, mixed $fieldID, mixed $ClassID, mixed $DocumentID, mixed $PageName, mixed $LayerName, mixed $ImageLinkType[, mixed $StringID = '' ][, mixed $Options = array() ]) : mixed
Parameters
$item : mixed
$fieldID : mixed
$ClassID : mixed
$DocumentID : mixed
$PageName : mixed
$LayerName : mixed
$ImageLinkType : mixed
$StringID : mixed = ''
$Options : mixed = array()
Tags
Return values
mixed

getCometNodes()

public getCometNodes(mixed $ParentID, mixed $ClassID, mixed $DocumentID, mixed $SearchFilter) : array<string|int, CSCometNode>
Parameters
$ParentID : mixed
$ClassID : mixed
$DocumentID : mixed
$SearchFilter : mixed
Tags
Return values
array<string|int, CSCometNode>

getDocumentInfoString()

public static getDocumentInfoString(mixed $oFile, mixed $iNumberOfVariants) : mixed
Parameters
$oFile : mixed
$iNumberOfVariants : mixed
Tags
Return values
mixed

getDocuments()

public getDocuments(mixed $ParentID) : mixed
Parameters
$ParentID : mixed
Tags
Return values
mixed

getDocumentStatusString()

public static getDocumentStatusString(mixed $file, mixed $numberOfVariants) : mixed
Parameters
$file : mixed
$numberOfVariants : mixed
Tags
Return values
mixed

getFields()

Gets the fields of an item

public getFields(int $ID, int $ClassID) : array<string|int, mixed>
Parameters
$ID : int

Id of the item

$ClassID : int

Record id @see COMET_CLASS_*

Tags
see

CSItemApiItem::getFields();

Return values
array<string|int, mixed>

getImageAttribute()

public getImageAttribute(mixed $item, mixed $fieldID, mixed $ClassID, mixed $DocumentID, mixed $PageName, mixed $LayerName, mixed $ImageLinkType[, mixed $Options = array() ]) : mixed
Parameters
$item : mixed
$fieldID : mixed
$ClassID : mixed
$DocumentID : mixed
$PageName : mixed
$LayerName : mixed
$ImageLinkType : mixed
$Options : mixed = array()
Tags
Return values
mixed

getImageAttributeReferences()

Returns all the image references of an item having attribute of type 'Reference to MAM file'.

public getImageAttributeReferences(object $item, int $fieldID, int $DocumentID, string $LayerName, int $ImageLinkType) : array<string|int, mixed>
Parameters
$item : object

Item who's image references are requested.

$fieldID : int

Id of an attribute of type 'Reference to MAM file'.

$DocumentID : int

MAMFileID of document.

$LayerName : string

Layer name.

$ImageLinkType : int

Type of an image link.

Tags
Return values
array<string|int, mixed>

$aImageReferences All image references of an attribute.

getItem()

public getItem(mixed $ID[, mixed $ClassID = null ]) : mixed
Parameters
$ID : mixed
$ClassID : mixed = null
Tags
Return values
mixed

getItems()

public getItems(mixed $ParentID, mixed $ClassID) : mixed
Parameters
$ParentID : mixed
$ClassID : mixed
Tags
Return values
mixed

getLanguageID()

Returns the layer- and document-specific language ID.

public getLanguageID(int $iDocumentId, string $sLayerName) : int

The language version is searched using the following cascade:

  • existing language (short name) by layer name
  • language version of the document
  • language as entered at login
  • language as defined by the default language
Parameters
$iDocumentId : int

The MAM file ID of the document in question.

$sLayerName : string

The layer name that should be used to determine the language.

Tags
Return values
int

The language ID to use for the given document and layer.

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

getLoadActionID()

public getLoadActionID(mixed $field, mixed $ClassID) : mixed
Parameters
$field : mixed
$ClassID : mixed
Tags
Return values
mixed

getMetaData()

Returns the CSMetaData of the current plugin.

public getMetaData() : CSMetaData
Tags
access

public

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

getNode()

public getNode(mixed $record) : mixed
Parameters
$record : mixed
Tags
Return values
mixed

getNodes()

public getNodes(mixed $ParentID, mixed $ClassID, mixed $DocumentID, mixed $SearchFilter[, array<string|int, mixed> $aAccessibleParentIds = array() ]) : CSCometNode
Parameters
$ParentID : mixed
$ClassID : mixed
$DocumentID : mixed
$SearchFilter : mixed
$aAccessibleParentIds : array<string|int, mixed> = array()
Tags
Return values
CSCometNode

getPlaceholders()

public getPlaceholders(mixed $ClassID[, mixed $sSearchString = '' ]) : mixed
Parameters
$ClassID : mixed
$sSearchString : mixed = ''
Tags
Return values
mixed

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

getRecordClass()

public getRecordClass() : mixed
Tags
Return values
mixed

getSharepoint()

public getSharepoint() : CSCometSharepoint
Tags
Return values
CSCometSharepoint

getSharepointDocumentFromFile()

public static getSharepointDocumentFromFile(mixed $file, mixed $sharepoint) : mixed
Parameters
$file : mixed
$sharepoint : mixed
Tags
Return values
mixed

getStandardField()

public getStandardField(mixed $FieldID, mixed $ClassID) : mixed
Parameters
$FieldID : mixed
$ClassID : mixed
Tags
Return values
mixed

getStandardFieldID()

public static getStandardFieldID(mixed $FieldName, mixed $ClassID) : mixed
Parameters
$FieldName : mixed
$ClassID : mixed
Tags
Return values
mixed

getStandardFields()

public static getStandardFields(mixed $ClassID) : mixed
Parameters
$ClassID : mixed
Tags
Return values
mixed

getStoreActionID()

public getStoreActionID(mixed $field, mixed $ClassID) : mixed
Parameters
$field : mixed
$ClassID : mixed
Tags
Return values
mixed

getSyncActionID()

public getSyncActionID(mixed $field, mixed $ClassID) : mixed
Parameters
$field : mixed
$ClassID : mixed
Tags
Return values
mixed

getTargetReferenceRecordClass()

Returns the record class for the records the connector handles

public getTargetReferenceRecordClass() : string
Tags
Return values
string

The class of the record

getTextAttribute()

public getTextAttribute(mixed $item, mixed $fieldID, mixed $ClassID, mixed $DocumentID, mixed $PageName, mixed $LayerName[, mixed $StringID = '' ][, mixed $sType = CSComet::PLACEHOLDER_TYPE_TEXT ][, mixed $Options = array() ]) : mixed
Parameters
$item : mixed
$fieldID : mixed
$ClassID : mixed
$DocumentID : mixed
$PageName : mixed
$LayerName : mixed
$StringID : mixed = ''
$sType : mixed = CSComet::PLACEHOLDER_TYPE_TEXT
$Options : mixed = array()
Tags
Return values
mixed

isAvailable()

This method is called to check, whether the plugin is available.

public isAvailable() : bool
Tags
inheritdoc
Return values
bool

whether the plugin is available for the given arguments

onAddReferencesToList()

Called before an item reference from this share was added to a reference list. It can be overwritten to execute some post operations.

public onAddReferencesToList(CSItemApiReferenceList $oReferenceList, array<string|int, mixed> $aIds, array<string|int, mixed> $aAttributes, int $iPosition[, string $sClassName = null ]) : void
Parameters
$oReferenceList : CSItemApiReferenceList

The reference list object where the reference should be added.

$aIds : array<string|int, mixed>

The record ids that should be added to the list.

$aAttributes : array<string|int, mixed>

The reference attributes that should be added to the reference entry.

$iPosition : int

The position in the list where the reference should be added.

$sClassName : string = null

The Class name of the records that were added

Tags
access

public

Return values
void

onBeforeAddReferencesToList()

Called before an item reference from this share is added to a reference list. It can be overwritten and canceld by returning a value not equal to true. In that case the adding is aborted but can be also performed sharepoint specific. The value returned by this method is also the one returned to the initial caller of the adding operation.

public onBeforeAddReferencesToList(CSItemApiReferenceList $oReferenceList, array<string|int, mixed> $aIds, array<string|int, mixed> $aAttributes, int $iPosition[, string $sClassName = null ]) : mixed
Parameters
$oReferenceList : CSItemApiReferenceList

The reference list object where the reference should be added.

$aIds : array<string|int, mixed>

The record ids that should be added to the list.

$aAttributes : array<string|int, mixed>

The reference attributes that should be added to the reference entry.

$iPosition : int

The position in the list where the reference should be added.

$sClassName : string = null

The classname of the recordIDs to be places

Tags
access

public

Return values
mixed

true, if the adding should take place, any other value to abort the operation.

prepareEditor()

public prepareEditor(mixed $editor) : mixed
Parameters
$editor : mixed
Tags
Return values
mixed

resetLoadedPlugins()

reset the internal plugins cache for loaded plugins

public static resetLoadedPlugins() : mixed
Tags
@return

void;

access

public

Return values
mixed

setAttribute()

public setAttribute(mixed $item, mixed $fieldID, mixed $ClassID, mixed $DocumentID, mixed $PageName, mixed $LayerName, mixed $value[, mixed $StringID = NULL ][, mixed $Options = array() ]) : mixed
Parameters
$item : mixed
$fieldID : mixed
$ClassID : mixed
$DocumentID : mixed
$PageName : mixed
$LayerName : mixed
$value : mixed
$StringID : mixed = NULL
$Options : mixed = array()
Tags
Return values
mixed

setLanguageID()

public setLanguageID(mixed $LanguageID) : mixed
Parameters
$LanguageID : mixed
Tags
Return values
mixed

setSharepoint()

public setSharepoint(mixed $sharepoint) : mixed
Parameters
$sharepoint : mixed
Tags
Return values
mixed

syncAttribute()

public syncAttribute(mixed $item, mixed $fieldID, mixed $ClassID, mixed $DocumentID, mixed $PageName, mixed $LayerName, mixed $value[, mixed $StringID = '' ][, mixed $Options = array() ]) : mixed
Parameters
$item : mixed
$fieldID : mixed
$ClassID : mixed
$DocumentID : mixed
$PageName : mixed
$LayerName : mixed
$value : mixed
$StringID : mixed = ''
$Options : mixed = array()
Tags
Return values
mixed

        

Search results