Contentserv PHP API

CSItemsSearchAreaPlugin extends CSOpenSearchAreaPlugin
in package

The base of all Search Area Plugins To be included, it must be placed in a plugins/opensearch subfolder with a file name ending with SearchArea.php.

Tags

Table of Contents

CLASS_ITEM_FILE  = 'Mamfile'
CLASS_ITEM_PRODUCT  = 'Pdmarticle'
CLASS_ITEM_PRODUCTVIEW  = 'Pdmarticlestructure'
DATA_FLOW_EXPORT_PLUGIN_NAME  = 'dataflowexportscript'
ITEM_TYPE_CHANNEL  = 'Pdmarticlestructure'
ITEM_TYPE_MAM  = 'Mamfile'
ITEM_TYPE_PIM  = 'Pdmarticle'
ITEM_TYPE_USER  = 'User'
__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.
addActionFieldsToEditor()  : mixed
This method adds the action fields into the editor like view, edit and download.
addAlternativePluginFolder()  : void
A path to a specific folder in which should be search for plugins.
addItems()  : void
Adds the Items to the Response objects
addSelectModeItems()  : void
Adds Items to the response object
executeMassActionForMailSend()  : CSOpenSearchFormResponse|mixed
Executes Send E-Mail mass action.
getAlternativePluginFolder()  : array<string|int, mixed>
getAvailableSelectedImageDownloadFormats()  : array<string|int, mixed>
Returns available preset Ids for the current User.
getContextRecordType()  : string
Gets the record type of current context
getCSSLink()  : string
The Plugins may return here an relative or absolute link to a CSS file if they wish This link will be added to the Search GUI. Use CS::getLinkToResource(url, format) with the format param absolute or relative to generate a link that can be used within any REST url
getEmailComponent()  : CSOpenSearchEmailComponent|null
Returns a CSOpenSearchEmailComponent object.
getFallbackSortOrder()  : string
Returns the fallback sort order field.
getItemSearchFilter()  : CSItemSearchFilter
Returns ItemSearchFilter for searching in OpenSearch
getItemTypes()  : array<string|int, mixed>
returns the available item types for this plugin.
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.
getLinkNames()  : array<string|int, mixed>
Tells the framework which link names are supported For each Link name automatically a right is added to the area editor
getMetaData()  : CSMetaData
Returns the CSMetaData of the current plugin.
getModule()  : CSModule
Returns the module, if the plugin is defined within a module.
getPaneSortOrder()  : int
Returns the default sort oder for the area panes.
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.
getPreviewHtml()  : string
Allows the Plugin to provide some html that should be displayed as preview of an item
getPreviewView()  : array<string|int, mixed>
Returns the preview data for the given item id to display in the detail view of the search list item.
getReferenceItemList()  : array<string|int, mixed>
This method returns the reference item list for the given items.
getRootIds()  : string
Returns the configured root IDs of the search area
getSearchArea()  : CSOpenSearchArea
Returns the search area.
getSelectedReferenceItemList()  : array<string|int, mixed>
This method returns the selected reference item list for the given items.
isAvailable()  : bool
The plugin is available only when gives record type and plugin type is of same type
isAvailableForSearchAreaType()  : mixed
isEmailComponentAvailableByViewType()  : bool
Returns a flag if EMail component is available or not.
isEmailComponentEnabled()  : bool
Tells if the available EMail component is currently on the Search Area enabled or not.
isPreviewFieldAvailable()  : bool
Preview Images field Available
mayDeleteItemsFromShare()  : bool
This method can be overwritten by the plugin to enable the functionality to delete the item from the share
prepareEditor()  : void
This method prepare the editor for the items plugin.
prepareWindow()  : void
This method can be overwritten by the plugin to add fields to the area window
resetLoadedPlugins()  : mixed
reset the internal plugins cache for loaded plugins
resolveConfigurationName()  : string
Modifies the field name by appending the current record type if available
resolvePluginForRecord()  : CSPlugin
Resolves plugin for the given record. We have overridden this method here because setting context type in child class was leading to set context to particular type.
search()  : void
Return Search result for the multiple item type supported search area.
setContextRecordType()  : mixed
Sets the record type of current context
setFieldValue()  : void
sets the field values of the area.
setSearchArea()  : void
Sets the search area

Constants

DATA_FLOW_EXPORT_PLUGIN_NAME

public mixed DATA_FLOW_EXPORT_PLUGIN_NAME = 'dataflowexportscript'
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

addActionFieldsToEditor()

This method adds the action fields into the editor like view, edit and download.

public addActionFieldsToEditor(object $oEditor, string $sItemType, string $sPaneName) : mixed
Parameters
$oEditor : object

the editor object in which field gets added.

$sItemType : string

the item type for which editor field gets added. like "Pdmarticle", "Mamfile"

$sPaneName : string

the pane title which is displayed for the editor field.

Tags
Return values
mixed

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>

getAvailableSelectedImageDownloadFormats()

Returns available preset Ids for the current User.

public getAvailableSelectedImageDownloadFormats([CSMamFile $oMamFile = null ]) : array<string|int, mixed>
Parameters
$oMamFile : CSMamFile = null

The Mamfile to be used as a context for right checks

Tags
Return values
array<string|int, mixed>

getContextRecordType()

Gets the record type of current context

public getContextRecordType() : string
Tags
Return values
string

record type of current context

The Plugins may return here an relative or absolute link to a CSS file if they wish This link will be added to the Search GUI. Use CS::getLinkToResource(url, format) with the format param absolute or relative to generate a link that can be used within any REST url

public getCSSLink() : string
Tags
access

public

Return values
string

the link with an absolute or relative url

getFallbackSortOrder()

Returns the fallback sort order field.

public getFallbackSortOrder() : string

Note: The fallback sort order is used only for MySQL based searches. i.e. when Elastic Search is not available.

Tags
Return values
string

with the fallback sort order field.

getItemTypes()

returns the available item types for this plugin.

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

are the item types.

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

getLinkNames()

Tells the framework which link names are supported For each Link name automatically a right is added to the area editor

public getLinkNames(int $iLangId) : array<string|int, mixed>
Parameters
$iLangId : int

the LanguageID

Tags
Return values
array<string|int, mixed>

with link name as key and link label as value

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

getPaneSortOrder()

Returns the default sort oder for the area panes.

public getPaneSortOrder() : int

Overwrite this method to manipulate the sorting.

Tags
Return values
int

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

getPreviewHtml()

Allows the Plugin to provide some html that should be displayed as preview of an item

public getPreviewHtml(int $iId, CSOpenSearchRequest $oRequest) : string
Parameters
$iId : int

the ID that was provided with the addItem Method in the @see search method

$oRequest : CSOpenSearchRequest
Tags
access

public

Return values
string

html code that can be embedded via Ajax call in the search window

getPreviewView()

Returns the preview data for the given item id to display in the detail view of the search list item.

public getPreviewView(CSOpenSearchRequest $oRequest, int $iId[, string $sItemClass = '' ]) : array<string|int, mixed>
Parameters
$oRequest : CSOpenSearchRequest

the open search request.

$iId : int

the search item id for which preview data is requested.

$sItemClass : string = ''

the item class name like "Pdmarticle"

Tags
Return values
array<string|int, mixed>

is the preview data for given item id.

getReferenceItemList()

This method returns the reference item list for the given items.

public getReferenceItemList(string $sItemClass, int $iItemID[, int|null $iLanguageID = null ]) : array<string|int, mixed>
Parameters
$sItemClass : string

the item class name like "Pdmarticle"

$iItemID : int

the item ID.

$iLanguageID : int|null = null

the language ID

Tags
Return values
array<string|int, mixed>

contain reference list data.

getRootIds()

Returns the configured root IDs of the search area

public getRootIds() : string
Tags
access

public

Return values
string

A comma separated string of IDs

getSelectedReferenceItemList()

This method returns the selected reference item list for the given items.

public getSelectedReferenceItemList(string $sItemClass, int $iItemID, int $iLanguageID) : array<string|int, mixed>
Parameters
$sItemClass : string

the item class name like "Pdmarticle"

$iItemID : int

the item ID.

$iLanguageID : int

the language ID

Tags
Return values
array<string|int, mixed>

contain selected reference list data.

isAvailable()

The plugin is available only when gives record type and plugin type is of same type

public isAvailable([null $oRecord = null ]) : bool
Parameters
$oRecord : null = null

the record object like "Pdmarticle"

Tags
Return values
bool

returns true if plugin available.

isAvailableForSearchAreaType()

public final isAvailableForSearchAreaType([mixed $iSearchAreaType = CSOpenSearchArea::TYPE_OPEN_SEARCH_AREA ]) : mixed
Parameters
$iSearchAreaType : mixed = CSOpenSearchArea::TYPE_OPEN_SEARCH_AREA
Tags
Return values
mixed

isEmailComponentAvailableByViewType()

Returns a flag if EMail component is available or not.

public isEmailComponentAvailableByViewType([int $iViewType = CSOpenSearchArea::VIEW_TYPE_ALWAYS ]) : bool

At the moment EMal Component is not available for all Item Plugins.

Parameters
$iViewType : int = CSOpenSearchArea::VIEW_TYPE_ALWAYS

One of the following View Types CSOpenSearchArea::VIEW_TYPE_*

Tags
Return values
bool

isEmailComponentEnabled()

Tells if the available EMail component is currently on the Search Area enabled or not.

public isEmailComponentEnabled() : bool
Tags
Return values
bool

isPreviewFieldAvailable()

Preview Images field Available

public isPreviewFieldAvailable() : bool
  • @return bool
Tags
Return values
bool

mayDeleteItemsFromShare()

This method can be overwritten by the plugin to enable the functionality to delete the item from the share

public mayDeleteItemsFromShare() : bool

To enable this functionality, the overwritten method must return boolean TRUE.

Tags
Return values
bool

TRUE if the items from the share can be deleted by the User FALSE, otherwise

prepareWindow()

This method can be overwritten by the plugin to add fields to the area window

public prepareWindow(CSOpenSearchWindow $oWindow) : void
Parameters
$oWindow : CSOpenSearchWindow

The Open Search window object

Tags
Return values
void

resetLoadedPlugins()

reset the internal plugins cache for loaded plugins

public static resetLoadedPlugins() : mixed
Tags
@return

void;

access

public

Return values
mixed

resolveConfigurationName()

Modifies the field name by appending the current record type if available

public resolveConfigurationName(mixed $sName) : string
Parameters
$sName : mixed

string field name

Tags
Return values
string

new field name with current record type appended

resolvePluginForRecord()

Resolves plugin for the given record. We have overridden this method here because setting context type in child class was leading to set context to particular type.

public resolvePluginForRecord(Record $oRecord) : CSPlugin
Parameters
$oRecord : Record

is the record object.

Tags
Return values
CSPlugin

available plugin for the given record.

setContextRecordType()

Sets the record type of current context

public setContextRecordType(string $sRecordType) : mixed
Parameters
$sRecordType : string

record type

Tags
Return values
mixed

setFieldValue()

sets the field values of the area.

public setFieldValue(string $sFieldName, string $sFieldValue) : void
Parameters
$sFieldName : string

Field Name

$sFieldValue : string

Field Value

Tags
@return

void.

Return values
void

        

Search results