CSDataFlowXmlImportExtraction
extends CSDataFlowImportExtractionPlugin
in package
This class represents the parent class of all plugin apis and offers some utilitiy methods which should be available in every plugin.
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.
- _getCacheKey() : string
- addAlternativePluginFolder() : void
- A path to a specific folder in which should be search for plugins.
- addConfigField() : mixed
- Allows the plugin to add custom configuration fields to the editor it is opened with
- addConfigFields() : mixed
- Overwrite this method and add your configuration fields with {@see addConfigField()}
- addExtractionField() : CSDataFlowExtractionField
- Adds another extraction field
- addExtractionFields() : mixed
- {@inheritdoc}
- current() : mixed
- Return the current element.
- getActiveJob() : CSActiveScriptJob
- getActiveJobID() : int
- getActiveScript() : CSActiveScript
- getActiveScriptID() : int
- Internal method that can be used to retrieve the script ID this plugin is connected with
- getAlternativePluginFolder() : array<string|int, mixed>
- getCacheKey() : mixed
- Allows external data retrievers to understand when the content is really changing
- getConfigValue() : string
- getExtractionFieldNames() : array<string|int, mixed>
- getExtractionFields() : array<string|int, CSDataFlowExtractionField>
- 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.
- getNumberOfRecords() : int
- 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.
- getRecord() : mixed
- getRecordIDs() : array<string|int, int>
- getRecords() : array<string|int, mixed>
- getRunDialogFieldNames() : array<string|int, mixed>
- getSampleData() : array<string|int, mixed>
- getTitle() : string
- isAvailable() : bool
- This method is called to check, whether the plugin is available.
- key() : mixed
- Return the key of the current element.
- next() : void
- Move forward to next element.
- removeConfigField() : mixed
- Removes a field from the editor
- resetLoadedPlugins() : mixed
- reset the internal plugins cache for loaded plugins
- rewind() : void
- Rewind the Iterator to the first element.
- setActiveJobID() : mixed
- Internal method that sets the job ID executing
- setActiveScriptID() : mixed
- Internal method that sets the script ID for this plugin
- setEditor() : mixed
- Internal method used to connect the plugin to an editor
- valid() : bool
- Checks if current position is valid.
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 —_getCacheKey()
public
_getCacheKey(mixed $sType) : string
Parameters
- $sType : mixed
Tags
Return values
string —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 —addConfigField()
Allows the plugin to add custom configuration fields to the editor it is opened with
public
addConfigField(string $sName, string $sLabel, mixed $mType[, string $sDefault = '' ][, array<string|int, string> $aOptions = array() ]) : mixed
Parameters
- $sName : string
-
the name of the option
- $sLabel : string
-
the visual label of the option
- $mType : mixed
-
the type of the option, see CSGuiEditor for more examples
- $sDefault : string = ''
-
the default value the option should have
- $aOptions : array<string|int, string> = array()
-
further options, see CSGuiEditor for more examples
Tags
Return values
mixed —addConfigFields()
Overwrite this method and add your configuration fields with {@see addConfigField()}
public
addConfigFields() : mixed
Tags
Return values
mixed —addExtractionField()
Adds another extraction field
public
addExtractionField(mixed $sID, mixed $sName) : CSDataFlowExtractionField
Parameters
- $sID : mixed
- $sName : mixed
Tags
Return values
CSDataFlowExtractionField —addExtractionFields()
{@inheritdoc}
public
addExtractionFields() : mixed
Tags
Return values
mixed —current()
Return the current element.
public
current() : mixed
Note: Return type will change to mixed.
Tags
Return values
mixed —Can return any type.
getActiveJob()
public
getActiveJob() : CSActiveScriptJob
Tags
Return values
CSActiveScriptJob —the job running this extraction
getActiveJobID()
public
getActiveJobID() : int
Tags
Return values
int —the ID of the job executing
getActiveScript()
public
getActiveScript() : CSActiveScript
Tags
Return values
CSActiveScript —the active script connected
getActiveScriptID()
Internal method that can be used to retrieve the script ID this plugin is connected with
public
getActiveScriptID() : int
Tags
Return values
int —the ActiveScriptID
getAlternativePluginFolder()
public
static getAlternativePluginFolder() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getCacheKey()
Allows external data retrievers to understand when the content is really changing
public
getCacheKey() : mixed
Tags
Return values
mixed —getConfigValue()
public
getConfigValue(string $sName[, string $sDefault = '' ]) : string
Parameters
- $sName : string
- $sDefault : string = ''
Tags
Return values
string —the value of the configuration
getExtractionFieldNames()
public
getExtractionFieldNames([bool $bIncludeSample = true ][, int $iCacheSeconds = 300 ]) : array<string|int, mixed>
Parameters
- $bIncludeSample : bool = true
-
if sample data should be included
- $iCacheSeconds : int = 300
-
how long the sample data can be cached
Tags
Return values
array<string|int, mixed> —the names of the extracted fields
getExtractionFields()
public
getExtractionFields() : array<string|int, CSDataFlowExtractionField>
Tags
Return values
array<string|int, CSDataFlowExtractionField> —array with the extraction fields
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
getNumberOfRecords()
public
getNumberOfRecords() : int
Tags
Return values
int —the number of records
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
getRecord()
public
getRecord(mixed $sKey) : mixed
Parameters
- $sKey : mixed
Tags
Return values
mixed —getRecordIDs()
public
getRecordIDs() : array<string|int, int>
Tags
Return values
array<string|int, int> —the record ids
getRecords()
public
getRecords([mixed $iCount = null ]) : array<string|int, mixed>
Parameters
- $iCount : mixed = null
Tags
Return values
array<string|int, mixed> —with records that should be exported
getRunDialogFieldNames()
public
getRunDialogFieldNames() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —names of the fields that should be shown in the Studio Execute ... Dialog
getSampleData()
public
getSampleData([bool $bShortened = true ]) : array<string|int, mixed>
Parameters
- $bShortened : bool = true
-
if the sample data should be only hinted
Tags
Return values
array<string|int, mixed> —the sample data
getTitle()
public
getTitle() : string
Tags
Return values
string —the title of the plugin
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
key()
Return the key of the current element.
public
key() : mixed
Note: Return type will change to mixed.
Tags
Return values
mixed —scalar on success, or null on failure.
next()
Move forward to next element.
public
next() : void
Note: Return type will change to void.
Tags
Return values
void —Any returned value is ignored.
removeConfigField()
Removes a field from the editor
public
removeConfigField(mixed $sName) : mixed
Parameters
- $sName : mixed
-
the name of the field
Tags
Return values
mixed —resetLoadedPlugins()
reset the internal plugins cache for loaded plugins
public
static resetLoadedPlugins() : mixed
Tags
Return values
mixed —rewind()
Rewind the Iterator to the first element.
public
rewind() : void
Note: Return type will change to void.
Tags
Return values
void —Any returned value is ignored.
setActiveJobID()
Internal method that sets the job ID executing
public
setActiveJobID(mixed $iActiveJobID) : mixed
Parameters
- $iActiveJobID : mixed
Tags
Return values
mixed —setActiveScriptID()
Internal method that sets the script ID for this plugin
public
setActiveScriptID(int $iActiveScriptID) : mixed
Parameters
- $iActiveScriptID : int
Tags
Return values
mixed —setEditor()
Internal method used to connect the plugin to an editor
public
setEditor(CSGuiEditor $oEditor) : mixed
Parameters
- $oEditor : CSGuiEditor
Tags
Return values
mixed —valid()
Checks if current position is valid.
public
valid() : bool
Note: Return type will change to bool.
Tags
Return values
bool —The return value will be cast to boolean and then evaluated. Returns true on success or false on failure.
