CSItemExportPlugin
extends CSPlugin
in package
This Plugin defines the export for CONTENTSERV items.
To be included, it must be placed in any plugins/core folder with a file name ending with Export.php
Tags
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.
- dereference() : bool
- Overwrites the default behaviour whether a reference should be dereferenced or not
- export() : mixed
- Finishes the export and create the plugin specific export format (e.g. XML, ...)
- getAlternativePluginFolder() : array<string|int, mixed>
- getDefaultFileType() : string
- If the export creates a file the filetype is used as default, if no other is given.
- getFieldsForRecord() : array<string|int, mixed>
- This method can be used to manipulate the fields which should be loaded for a specific record.
- 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.
- getSelectionFieldsForView() : array<string|int, mixed>
- This method can be used to select special fields for the items belonging to a special view. As default behaviour the Views SelectionFields are used
- isAvailable() : bool
- Checks whether this plugin is available for the current export
- prepareEditor() : void
- Extends the Export Settings Editor.
- prepareExport() : void
- Modifies the current CSItemExport before starting to export
- resetLoadedPlugins() : mixed
- reset the internal plugins cache for loaded plugins
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 —dereference()
Overwrites the default behaviour whether a reference should be dereferenced or not
public
dereference(CSItemExportAPI $csItemExportAPI, string $srcClass, string $srcID, string $targetClass, string $targetID, int $fieldID, mixed $languageId, string $defaultBehaviour) : bool
Parameters
- $csItemExportAPI : CSItemExportAPI
-
the current CSItemExportAPI. Note: As it is just build it contains not the complete data at that moment.
- $srcClass : string
-
the class of the reference source
- $srcID : string
-
the ID of the reference source
- $targetClass : string
-
the class of the reference target
- $targetID : string
-
the ID of the reference target
- $fieldID : int
-
the ID of the field in the reference source
- $languageId : mixed
- $defaultBehaviour : string
-
whether the reference would be dereferenced as default behaviour
Tags
Return values
bool —whether the reference should be dereferenced
export()
Finishes the export and create the plugin specific export format (e.g. XML, ...)
public
export(CSItemExportAPI $csItemExportAPI, Record $exportRecord[, array<string|int, mixed> $additionalOptions = array() ]) : mixed
Parameters
- $csItemExportAPI : CSItemExportAPI
-
the CSItemExportAPI which had been generated by the export
- $exportRecord : Record
-
the object containing the Export Settings (e.g. Pdmexport)
- $additionalOptions : array<string|int, mixed> = array()
-
additional export options
Tags
Return values
mixed —the return value, the export should have
getAlternativePluginFolder()
public
static getAlternativePluginFolder() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getDefaultFileType()
If the export creates a file the filetype is used as default, if no other is given.
public
getDefaultFileType() : string
Tags
Return values
string —the default filetype of the plugin
getFieldsForRecord()
This method can be used to manipulate the fields which should be loaded for a specific record.
public
getFieldsForRecord(CSItemExportAPI $csItemExportAPI, string $recordClass, array<string|int, mixed> $recordIDs, array<string|int, mixed> $additionalFields, array<string|int, mixed> $defaultFields) : array<string|int, mixed>
Parameters
- $csItemExportAPI : CSItemExportAPI
-
the current CSItemExportAPI. Note: As it is just build it contains not the complete data at that moment.
- $recordClass : string
-
the class of the Record for which the fields should be loaded.
- $recordIDs : array<string|int, mixed>
-
the IDs of the Record which should be loaded
- $additionalFields : array<string|int, mixed>
-
the additionalFields which are selected e.g. by the parent view.
- $defaultFields : array<string|int, mixed>
-
the fields which are loaded as default behaviour
Tags
Return values
array<string|int, mixed> —the fields which should be loaded for this record
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
getSelectionFieldsForView()
This method can be used to select special fields for the items belonging to a special view. As default behaviour the Views SelectionFields are used
public
getSelectionFieldsForView(CSItemExportAPI $csItemExportAPI, string $viewClass, string $viewID, array<string|int, mixed> $viewDatas, array<string|int, mixed> $defaultFields) : array<string|int, mixed>
Parameters
- $csItemExportAPI : CSItemExportAPI
-
the current CSItemExportAPI. Note: As it is just build it contains not the complete data at that moment.
- $viewClass : string
-
the class of the item view
- $viewID : string
-
the ID of the item view
- $viewDatas : array<string|int, mixed>
-
the datas of the view in the form $key => $value
- $defaultFields : array<string|int, mixed>
-
the fields which are selected as default behaviour
Tags
Return values
array<string|int, mixed> —the fields which should be selected for items in the view
isAvailable()
Checks whether this plugin is available for the current export
public
isAvailable([string $module = null ]) : bool
Parameters
- $module : string = null
-
the module which is the start point for the export
Tags
Return values
bool —whether this plugin is available
prepareEditor()
Extends the Export Settings Editor.
public
prepareEditor(CSGuiEditorDialog $csGuiEditorDialog) : void
Fields, Sections and Panes can be added / removed using the CSGuiEditorDialogs API methods
Parameters
- $csGuiEditorDialog : CSGuiEditorDialog
-
the settings dialog
Tags
Return values
void —prepareExport()
Modifies the current CSItemExport before starting to export
public
prepareExport(CSItemExport $oExport) : void
Parameters
- $oExport : CSItemExport
Tags
Return values
void —resetLoadedPlugins()
reset the internal plugins cache for loaded plugins
public
static resetLoadedPlugins() : mixed
