CSMam
extends CSItemApi
in package
Tags
Table of Contents
- CONTEXT_VOLUME = 'Context'
- TEMPLATES_VOLUME = 'Templates'
- UNZIP_DETAIL_PARAM_CREATED_DIR = 'dircreated'
- UNZIP_DETAIL_PARAM_CREATED_FILE = 'filecreated'
- UNZIP_DETAIL_PARAM_DUPLICATE_FILE = 'fileduplicate'
- UNZIP_DETAIL_PARAM_EXISTS_DIR = 'direxists'
- UNZIP_DETAIL_PARAM_EXISTS_FILE = 'fileexists'
- UNZIP_DETAIL_PARAM_NOTALLOWED_FILE = 'filenotallowed'
- UNZIP_DETAIL_PARAM_OVERWRITE_FILE = 'fileoverwrite'
- $ENUM_SORTALGOS_FORMATTED : mixed
- $ENUM_SORTTYPES_DESC : mixed
- $tableApiClass : string
- $tableRowApiClass : string
- __construct() : mixed
- createField() : CSMamField
- Creates a new CSMamField at the targeted position
- createFile() : CSMamFile
- Creates a new file with given content
- createFolder() : CSMamFile
- Creates a new folder
- createVolume() : CSMamVolume
- Creates a new CSMamVolume
- delayImageOperations() : mixed
- Sets whether image operation like getting image proportions and preview creation should be delayed and therefor executed later in a synchronisation thread.
- getApiFieldForExternalKey() : CSItemApiField
- Returns a specific field of an item or an empty Api Field when the key is null, empty or invalid
- getAvailableExportPreset() : CSMamExportPreset|null
- Returns available (for current user) export preset or null.
- getAvailableExportPresetNames() : array<string|int, CSMamExportPreset>
- Returns available (for current user) export preset names for given filter
- getAvailableExportPresets() : array<string|int, CSMamExportPreset>
- Returns only the available (for Current User) presets
- getAvailableExportPresetsForFile() : array<string|int, mixed>
- getCacheFolder() : string
- Returns the path of the folder where mam should write its cache (e.g. downloads to zip) files
- getComparator() : CSItemComparator
- Creates a comparator object that can be used with the CSGuiItemComparatorTable
- getContextFolder() : string
- Returns the mam path of a context folder (object folder) for a given class with a given id
- getDownloadURL() : string
- Returns the URL of the link, where the user can download the file.
- getDuplicateIdsByMD5() : array<string|int, mixed>
- Returns all duplicate MAM file ids for a given MD5 hash key.
- getDuplicateIdsForIds() : array<string|int, mixed>
- Checks and returns duplicates MAM file ids for the given MAM file ids.
- getDuplicateIdsInIds() : array<string|int, mixed>
- Checks and returns duplicates MAM file ids IN the given MAM file ids.
- getDuplicates() : array<string|int, mixed>
- Checks and returns all available duplicates MAM file objects.
- getDuplicatesByMD5() : array<string|int, mixed>
- Returns all duplicate MAM file objects for a given MD5 hash key.
- getDuplicatesForIds() : array<string|int, mixed>
- Checks and returns duplicates MAM file objects for the given MAM file ids.
- getDuplicatesIds() : array<string|int, mixed>
- Checks and returns all available duplicates MAM file object ids.
- getDuplicatesInIds() : array<string|int, mixed>
- Checks and returns duplicates MAM file objects IN the given MAM file ids.
- getExistingFileTypes() : array<string|int, mixed>
- Returns all existing file extensions in the mam module
- getExportPreset() : CSMamExportPreset
- Returns the matching preset for the given identifier (id or name)
- getExportPresetLabels() : array<string|int, CSMamExportPreset>
- Returns all export preset labels for the given filter.
- getExportPresetNames() : array<string|int, CSMamExportPreset>
- Returns all export preset names for the given filter.
- getExportPresets() : array<string|int, CSMamExportPreset>
- Returns all export presets for the given filter.
- getField() : CSMamField
- Loads an existing field for a given ID
- getFieldForExternalKey() : CSMamField
- Loads an existing CSMamField.
- getFields() : mixed
- Returns an array with CSMamFields matching the SQL filter condition in the given sort order and limit
- getFile() : CSMamFile
- Loads an existing CSMamFile.
- getFileForExternalKey() : CSMamFile
- Loads an existing CSMamFile.
- getFiles() : mixed
- Returns an array with CSMamFiles matching the SQL filter condition in the given sort order and limit.
- getImageServerID() : mixed
- Returns a securityID for a given MamFile which must be passed as ID to an ImageServer URL
- getImageServerURL() : string
- Returns the URL of the ImageServer, which displays this file.
- getImageServerURLForPreset() : string
- Returns the URL of the ImageServer, which displays this file, based on the passed preset.
- getInstance() : mixed
- getPreviewGeometries() : array<string|int, mixed>
- Returns an array of all default and configured preview geometries.
- getSearchableApiFields() : mixed
- Returns an array with CSItemApiField matching the searchable condition in the given sort order and limit If $returnSimpleSearchables and $returnExtendedSearchables are set to false all fields are returned which are not searchable Otherwise the fields are returned matching at least one of the set criterias.
- getSearchableFields() : mixed
- Returns an array with CSMamFields matching the searchable condition in the given sort order and limit If $returnSimpleSearchables and $returnExtendedSearchables are set to false all fields are returned which are not searchable Otherwise the fields are returned matching at least one of the set criterias.
- getSyncStates() : array<string|int, mixed>
- Returns all Sync states in the MAM module.
- getUnzipDetailInformationKeys() : array<string|int, mixed>
- Returns all possible detail information states returned by unzip-method (unzipFiles) As key the key and translation as value.
- getUploadDialogUrl() : string
- Returns the URL to the Upload Dialog
- getValueGetter() : CSItemValueGetter
- Returns a new CSItemValueGetter object
- getValueSetter() : CSItemValueSetter
- Returns a new CSItemValueSetter object
- getValuesGetter() : CSItemValuesGetter
- Returns a new CSItemValuesGetter object
- getValuesSetter() : CSItemValuesSetter
- Returns a new CSItemValuesSetter object
- getVolume() : CSMamVolume
- Loads an existing volume for a given ID
- getVolumes() : CSMamVolume|array<string|int, CSMamVolume>
- Returns an array with CSMamVolume matching the SQL filter condition in the given sort order and limit.
- limitAllowedHtmlTags() : mixed
- Limits all tags which are allowed in the formatted value result of any item This can e.g. be used for media neutral exports where not all html tags are supported
- searchFiles() : array<string|int, CSMamFile>
- Searches all files matching a given search criteria
- validateMamExportLimit() : void
- Checks if the total size of the files to be exported exceeds the maximum allowed and throws an exception when it does
- zipFiles() : mixed
- Creates one archive containing all given Mamfiles
Constants
CONTEXT_VOLUME
public
mixed
CONTEXT_VOLUME
= 'Context'
Tags
TEMPLATES_VOLUME
public
mixed
TEMPLATES_VOLUME
= 'Templates'
Tags
UNZIP_DETAIL_PARAM_CREATED_DIR
public
mixed
UNZIP_DETAIL_PARAM_CREATED_DIR
= 'dircreated'
Tags
UNZIP_DETAIL_PARAM_CREATED_FILE
public
mixed
UNZIP_DETAIL_PARAM_CREATED_FILE
= 'filecreated'
Tags
UNZIP_DETAIL_PARAM_DUPLICATE_FILE
public
mixed
UNZIP_DETAIL_PARAM_DUPLICATE_FILE
= 'fileduplicate'
Tags
UNZIP_DETAIL_PARAM_EXISTS_DIR
public
mixed
UNZIP_DETAIL_PARAM_EXISTS_DIR
= 'direxists'
Tags
UNZIP_DETAIL_PARAM_EXISTS_FILE
public
mixed
UNZIP_DETAIL_PARAM_EXISTS_FILE
= 'fileexists'
Tags
UNZIP_DETAIL_PARAM_NOTALLOWED_FILE
public
mixed
UNZIP_DETAIL_PARAM_NOTALLOWED_FILE
= 'filenotallowed'
Tags
UNZIP_DETAIL_PARAM_OVERWRITE_FILE
public
mixed
UNZIP_DETAIL_PARAM_OVERWRITE_FILE
= 'fileoverwrite'
Tags
Properties
$ENUM_SORTALGOS_FORMATTED
public
static mixed
$ENUM_SORTALGOS_FORMATTED
= array(\CS_SORT_FORMATTED_ASC => 'GUI_EDIT_SORT_FORMATTED_ASC', \CS_SORT_FORMATTED_DESC => 'GUI_EDIT_SORT_FORMATTED_DESC')
Tags
$ENUM_SORTTYPES_DESC
public
static mixed
$ENUM_SORTTYPES_DESC
= array(\CS_SORT_NUMERICAL_DESC => 'GUI_EDIT_SORT_NUMERICAL_DESC', \CS_SORT_CASE_STRING_DESC => 'GUI_EDIT_SORT_CASE_STRING_DES', \CS_SORT_FORMATTED_DESC => 'GUI_EDIT_SORT_FORMATTED_DESC', \CS_SORT_STRING_DESC => 'GUI_EDIT_SORT_STRING_DESC', \CS_SORT_DATE_DESC => 'GUI_EDIT_SORT_DATE_DESC', \CS_SORT_DEFAULT_DESC => 'GUI_EDIT_SORT_DEFAULT_DESC')
Tags
$tableApiClass
public
string
$tableApiClass
Tags
$tableRowApiClass
public
string
$tableRowApiClass
Tags
Methods
__construct()
public
__construct([mixed $itemClass = null ]) : mixed
Parameters
- $itemClass : mixed = null
Tags
Return values
mixed —createField()
Creates a new CSMamField at the targeted position
public
static createField(string $label[, int $targetID = null ][, int $position = CSITEM_POSITION_CHILD ][, string $type = 'caption' ][, string $typemodule = 'core' ][, bool $loadTypeFromProject = false ]) : CSMamField
Parameters
- $label : string
-
the label of the new field
- $targetID : int = null
-
ID of the targeted field
- $position : int = CSITEM_POSITION_CHILD
-
position relative to the target field
- $type : string = 'caption'
-
the type of the field
- $typemodule : string = 'core'
-
name of the module the type is defined in
- $loadTypeFromProject : bool = false
-
set this flag if the type is defined in the project
Tags
Return values
CSMamField —createFile()
Creates a new file with given content
public
static createFile(string $sMamPath[, string $sContent = '' ][, string $sLocFile = '' ], int $iBaseFieldID) : CSMamFile
Parameters
- $sMamPath : string
-
the complete path of the file including the filename which should be created
- $sContent : string = ''
-
the optional content of the new file
- $sLocFile : string = ''
-
the optional path of a local file which is used as template
- $iBaseFieldID : int
-
the id of the root field of the MamFile
Tags
Return values
CSMamFile —a CSMamFile object which contains the new file or is empty if the request failed.
createFolder()
Creates a new folder
public
static createFolder(string $sMamPath, int $iBaseFieldID) : CSMamFile
Parameters
- $sMamPath : string
-
the path of the folder which should be created
- $iBaseFieldID : int
-
the id of the root field of the MamFile
Tags
Return values
CSMamFile —a CSMamFile object which contains the new file or is empty if the request failed.
createVolume()
Creates a new CSMamVolume
public
static createVolume(string $sVolumeName, string $sPath[, string $sDriverType = self::VOLUME_DRIVER_TYPE_FILESYSTEM ][, int $iSyncFrequency = 60 ][, bool $bIsWritable = true ]) : CSMamVolume
Parameters
- $sVolumeName : string
-
the unique name of the new volume
- $sPath : string
-
the internal path of the volume
- $sDriverType : string = self::VOLUME_DRIVER_TYPE_FILESYSTEM
-
the driver type of the volume
- $iSyncFrequency : int = 60
-
the frequency in minutes the volume is synchronized within an automation.
- $bIsWritable : bool = true
-
whether one can modify files within this volume
Tags
Return values
CSMamVolume —delayImageOperations()
Sets whether image operation like getting image proportions and preview creation should be delayed and therefor executed later in a synchronisation thread.
public
static delayImageOperations([bool $delay = true ][, bool $executeAtShutdown = true ]) : mixed
This can be used to create quicker copies of files where previews and other meta datas are not required directly to view the result.
Parameters
- $delay : bool = true
-
whether image operations should be delayed
- $executeAtShutdown : bool = true
-
whether delayed operations should be executed directly after finished the current request (true) or in a separate sceduler (false)
Tags
Return values
mixed —getApiFieldForExternalKey()
Returns a specific field of an item or an empty Api Field when the key is null, empty or invalid
public
getApiFieldForExternalKey(string $sExternalKey) : CSItemApiField
If you pass the ExternalKey of the field as identifier be aware that labels are not unique and the first field with that label will be returned.
Parameters
- $sExternalKey : string
-
External key of the Item (or Field)
Tags
Return values
CSItemApiField —Returns an instance of the CSItemApiField object
getAvailableExportPreset()
Returns available (for current user) export preset or null.
public
static getAvailableExportPreset(mixed $mIdentifier) : CSMamExportPreset|null
If the preset is not valid anymore (wrong identifier) and the current user has no rights to use the preset returning NULL.
Parameters
- $mIdentifier : mixed
Tags
Return values
CSMamExportPreset|null —A valid CSMamExportPreset object or NULL if not valid and not usable
getAvailableExportPresetNames()
Returns available (for current user) export preset names for given filter
public
static getAvailableExportPresetNames([null|string $sFilter = null ]) : array<string|int, CSMamExportPreset>
Parameters
- $sFilter : null|string = null
Tags
Return values
array<string|int, CSMamExportPreset> —getAvailableExportPresets()
Returns only the available (for Current User) presets
public
static getAvailableExportPresets([null|string $sFilter = null ]) : array<string|int, CSMamExportPreset>
Parameters
- $sFilter : null|string = null
-
Can be null or a SQL Filter.
Tags
Return values
array<string|int, CSMamExportPreset> —getAvailableExportPresetsForFile()
public
static getAvailableExportPresetsForFile(CSMamFile $oFile[, string $sFilter = '1=1' ][, bool $bReturnOnlyIds = false ]) : array<string|int, mixed>
Parameters
- $oFile : CSMamFile
-
Mamfile object used as a context to determine matching Presets
- $sFilter : string = '1=1'
-
SQL Filter for further restrictions
- $bReturnOnlyIds : bool = false
-
Whether only Ids or the whole preset object should be returned
Tags
Return values
array<string|int, mixed> —An array containing all Preset objects for a given file
getCacheFolder()
Returns the path of the folder where mam should write its cache (e.g. downloads to zip) files
public
static getCacheFolder() : string
Tags
Return values
string —the path to the cache folder in the FileSystem
getComparator()
Creates a comparator object that can be used with the CSGuiItemComparatorTable
public
getComparator(CSItemComparatorData $oComparatorData) : CSItemComparator
Parameters
- $oComparatorData : CSItemComparatorData
-
CSItemComparatorData object with already setted data.
Tags
Return values
CSItemComparator —the newly created CSItemComparator-object that can be used for further configuration.
getContextFolder()
Returns the mam path of a context folder (object folder) for a given class with a given id
public
static getContextFolder(string $class, string $id) : string
Parameters
- $class : string
-
the class for which the context folder is requested. If set the MamPath to the context folder ist returned. Otherwise only the id subfolder is returned
- $id : string
-
the id of the object for which the context folder is requested
Tags
Return values
string —the path of the requested context folder
getDownloadURL()
Returns the URL of the link, where the user can download the file.
public
static getDownloadURL(mixed $mMamFile[, bool $bDownloadAsZip = false ][, string $sBase = 'relative' ][, string $sDownloadFileName = null ][, bool $bDownloadAsMacBinary = false ][, string $sDownloadContext = '' ]) : string
Parameters
- $mMamFile : mixed
-
Either the Mamfile, the MamfileID or a Mam JSON-String representing the file
- $bDownloadAsZip : bool = false
-
whether the download should be zipped
- $sBase : string = 'relative'
-
base of the link can be one of the following values: relative (default), external, internal
- $sDownloadFileName : string = null
-
the name the downloaded file should have
- $bDownloadAsMacBinary : bool = false
-
@deprecated whether the file should have the mac binary format (only available on MAC Servers)
- $sDownloadContext : string = ''
-
The context of the download call
Tags
Return values
string —the URL where the user may download the file
getDuplicateIdsByMD5()
Returns all duplicate MAM file ids for a given MD5 hash key.
public
static getDuplicateIdsByMD5(string $sMD5) : array<string|int, mixed>
Parameters
- $sMD5 : string
-
MD5 hash key of a Mam file
Tags
Return values
array<string|int, mixed> —getDuplicateIdsForIds()
Checks and returns duplicates MAM file ids for the given MAM file ids.
public
static getDuplicateIdsForIds(int|array<string|int, mixed> $mIds[, bool $bAddFolderChildren = true ]) : array<string|int, mixed>
Parameters
- $mIds : int|array<string|int, mixed>
-
MAM file id or an array of MAM file ids.
- $bAddFolderChildren : bool = true
-
If also the children should be checked for duplicates.
Tags
Return values
array<string|int, mixed> —getDuplicateIdsInIds()
Checks and returns duplicates MAM file ids IN the given MAM file ids.
public
static getDuplicateIdsInIds(int|array<string|int, mixed> $mIds[, bool $bAddFolderChildren = true ]) : array<string|int, mixed>
Parameters
- $mIds : int|array<string|int, mixed>
-
MAM file id or an array of MAM file ids.
- $bAddFolderChildren : bool = true
-
If also the children should be checked for duplicates.
Tags
Return values
array<string|int, mixed> —getDuplicates()
Checks and returns all available duplicates MAM file objects.
public
static getDuplicates([string $sFilter = '1=1' ]) : array<string|int, mixed>
Parameters
- $sFilter : string = '1=1'
Tags
Return values
array<string|int, mixed> —getDuplicatesByMD5()
Returns all duplicate MAM file objects for a given MD5 hash key.
public
static getDuplicatesByMD5(string $sMD5) : array<string|int, mixed>
Parameters
- $sMD5 : string
-
MD5 hash key of a Mam file
Tags
Return values
array<string|int, mixed> —getDuplicatesForIds()
Checks and returns duplicates MAM file objects for the given MAM file ids.
public
static getDuplicatesForIds(int|array<string|int, mixed> $mIds[, bool $bAddFolderChildren = true ]) : array<string|int, mixed>
Parameters
- $mIds : int|array<string|int, mixed>
-
MAM file id or an array of MAM file ids.
- $bAddFolderChildren : bool = true
-
If also the children should be checked for duplicates.
Tags
Return values
array<string|int, mixed> —getDuplicatesIds()
Checks and returns all available duplicates MAM file object ids.
public
static getDuplicatesIds([string $sFilter = '1=1' ]) : array<string|int, mixed>
Parameters
- $sFilter : string = '1=1'
Tags
Return values
array<string|int, mixed> —getDuplicatesInIds()
Checks and returns duplicates MAM file objects IN the given MAM file ids.
public
static getDuplicatesInIds(int|array<string|int, mixed> $mIds[, bool $bAddFolderChildren = true ]) : array<string|int, mixed>
Parameters
- $mIds : int|array<string|int, mixed>
-
MAM file id or an array of MAM file ids.
- $bAddFolderChildren : bool = true
-
If also the children should be checked for duplicates.
Tags
Return values
array<string|int, mixed> —getExistingFileTypes()
Returns all existing file extensions in the mam module
public
static getExistingFileTypes([int $iLanguageId = null ]) : array<string|int, mixed>
Parameters
- $iLanguageId : int = null
-
The language id which should be used to get the filetype translations in the specific language.
Tags
Return values
array<string|int, mixed> —of existing file extensions in the format {FILETYPE}=>{FILETYPE TRANSLATION}
getExportPreset()
Returns the matching preset for the given identifier (id or name)
public
static getExportPreset(mixed $identifier) : CSMamExportPreset
Parameters
- $identifier : mixed
-
id or name of the searched preset
Tags
Return values
CSMamExportPreset —the matching preset
getExportPresetLabels()
Returns all export preset labels for the given filter.
public
static getExportPresetLabels([string $sFilter = '1=1' ]) : array<string|int, CSMamExportPreset>
Format: {PresetID => Preset label}
Parameters
- $sFilter : string = '1=1'
Tags
Return values
array<string|int, CSMamExportPreset> —getExportPresetNames()
Returns all export preset names for the given filter.
public
static getExportPresetNames([string $sFilter = '1=1' ]) : array<string|int, CSMamExportPreset>
Format: {PresetID => Preset name}
Parameters
- $sFilter : string = '1=1'
Tags
Return values
array<string|int, CSMamExportPreset> —getExportPresets()
Returns all export presets for the given filter.
public
static getExportPresets([string $filter = '1=1' ]) : array<string|int, CSMamExportPreset>
Parameters
- $filter : string = '1=1'
-
the filter that should be applied
Tags
Return values
array<string|int, CSMamExportPreset> —a list of CSMamExportPreset-objects
getField()
Loads an existing field for a given ID
public
static getField([int $ID = null ]) : CSMamField
Parameters
- $ID : int = null
-
of the field
Tags
Return values
CSMamField —a CSMamField object for the given ID
getFieldForExternalKey()
Loads an existing CSMamField.
public
static getFieldForExternalKey(string $sExternalKey) : CSMamField
Parameters
- $sExternalKey : string
-
the external key of the field
Tags
Return values
CSMamField —getFields()
Returns an array with CSMamFields matching the SQL filter condition in the given sort order and limit
public
static getFields([string $filter = '1=1' ][, string $sortorder = '' ][, mixed $limit = '' ]) : mixed
Parameters
- $filter : string = '1=1'
-
SQL Filter condition
- $sortorder : string = ''
-
SQL Sort Order
- $limit : mixed = ''
-
either a string which is a SQL limit condition or the integer 1, if only the first matching CSMamField should be returned
Tags
Return values
mixed —either an array with the CSMamFields or the first CSMamField, if limit is set to 1
getFile()
Loads an existing CSMamFile.
public
static getFile([mixed $ID = null ]) : CSMamFile
Note:
Since 5.3 this method will return filetype specific extensions of the CSMamFile if available. When calling the getFile() method for an Adobe InDesign File for example a will be returned.
This is a synonym for the getItem method.
Parameters
- $ID : mixed = null
-
either the ID or the path of the file
Tags
Return values
CSMamFile —or CSMamInddFile or other filetype specific extensions if available
getFileForExternalKey()
Loads an existing CSMamFile.
public
static getFileForExternalKey(string $externalKey) : CSMamFile
Parameters
- $externalKey : string
-
the external key of the file
Tags
Return values
CSMamFile —getFiles()
Returns an array with CSMamFiles matching the SQL filter condition in the given sort order and limit.
public
static getFiles([string $filter = '1=1' ][, string $sortorder = '' ][, mixed $limit = '' ][, bool $ignoreRights = false ]) : mixed
This is a synonym for the getItems method and therefore all special syntax described there can be used.
Parameters
- $filter : string = '1=1'
-
SQL Filter condition
- $sortorder : string = ''
-
SQL Sort Order
- $limit : mixed = ''
-
either a string which is a SQL limit condition or the integer 1, if only the first matching CSMamFile should be returned
- $ignoreRights : bool = false
-
whether the user rights should be ignored. If not only those views are returned the user may view.
Tags
Return values
mixed —either an array with the CSMamFiles or the first CSMamFile, if limit is set to 1
getImageServerID()
Returns a securityID for a given MamFile which must be passed as ID to an ImageServer URL
public
static getImageServerID(int $MamfileID) : mixed
Parameters
- $MamfileID : int
-
the ID of the requested Mamfile return string the URL parameter which must be added as ID to the imageServer link
Tags
Return values
mixed —getImageServerURL()
Returns the URL of the ImageServer, which displays this file.
public
static getImageServerURL(mixed $mamFile[, int $width = null ][, int $height = null ][, string $base = 'relative' ][, int $format = null ][, int $colorspace = null ][, int $resolution = null ][, bool $force = false ][, bool $useMaster = true ]) : string
Parameters
- $mamFile : mixed
-
either the Mamfile, the MamfileID or a Mam JSON-String representing the file
- $width : int = null
-
target image width
- $height : int = null
-
target image height
- $base : string = 'relative'
-
base of the link can be one of the following values: relative (default), external, internal
- $format : int = null
-
target image format (jpg, gif, ...)
- $colorspace : int = null
-
target image colorspace (rgb, cmyk)
- $resolution : int = null
-
resolution in dpi of the target image
- $force : bool = false
-
whether missing images should be forced to be created on the fly
- $useMaster : bool = true
-
whether the master image or the original image should be used for transformation
Tags
Return values
string —the URL of the CSMamFile in the ImageServer
getImageServerURLForPreset()
Returns the URL of the ImageServer, which displays this file, based on the passed preset.
public
getImageServerURLForPreset(CSMamFile $mamFile, mixed $preset[, string $base = 'relative' ]) : string
Parameters
- $mamFile : CSMamFile
-
the mam file for which to retrieve the url
- $preset : mixed
-
the preset to use (name, id or a CSMamExportPreset)
- $base : string = 'relative'
-
base of the link can be one of the following values: relative (default), external, internal
Tags
Return values
string —the URL of the CSMamFile in the ImageServer
getInstance()
public
static getInstance(mixed $apiName[, mixed $itemClass = null ]) : mixed
Parameters
- $apiName : mixed
- $itemClass : mixed = null
Tags
Return values
mixed —getPreviewGeometries()
Returns an array of all default and configured preview geometries.
public
static getPreviewGeometries() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getSearchableApiFields()
Returns an array with CSItemApiField matching the searchable condition in the given sort order and limit If $returnSimpleSearchables and $returnExtendedSearchables are set to false all fields are returned which are not searchable Otherwise the fields are returned matching at least one of the set criterias.
public
getSearchableApiFields([bool $returnSimpleSearchables = true ][, bool $returnExtendedSearchables = true ][, string $sortorder = '' ][, mixed $limit = '' ]) : mixed
Parameters
- $returnSimpleSearchables : bool = true
-
whether simple searchable fields are returned
- $returnExtendedSearchables : bool = true
-
whether extended searchable fields are returned
- $sortorder : string = ''
-
SQL Sort Order
- $limit : mixed = ''
-
either a string which is a SQL limit condition or the integer 1, if only the first matching CSItemApiField should be returned
Tags
Return values
mixed —either an array with the CSItemApiFields or the first CSItemApiField, if limit is set to 1
getSearchableFields()
Returns an array with CSMamFields matching the searchable condition in the given sort order and limit If $returnSimpleSearchables and $returnExtendedSearchables are set to false all fields are returned which are not searchable Otherwise the fields are returned matching at least one of the set criterias.
public
getSearchableFields([bool $returnSimpleSearchables = true ][, bool $returnExtendedSearchables = true ][, string $sortorder = '' ][, mixed $limit = '' ]) : mixed
Parameters
- $returnSimpleSearchables : bool = true
-
whether simple searchable fields are returned
- $returnExtendedSearchables : bool = true
-
whether extended searchable fields are returned
- $sortorder : string = ''
-
SQL Sort Order
- $limit : mixed = ''
-
either a string which is a SQL limit condition or the integer 1, if only the first matching CSItemApiField should be returned
Tags
Return values
mixed —either an array with the CSItemApiFields or the first CSItemApiField, if limit is set to 1
getSyncStates()
Returns all Sync states in the MAM module.
public
static getSyncStates() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —of Sync states in the format {KEY}=>{SYNCSTATE TRANSLATION}
getUnzipDetailInformationKeys()
Returns all possible detail information states returned by unzip-method (unzipFiles) As key the key and translation as value.
public
static getUnzipDetailInformationKeys() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —An array in format {CSMAM::UNZIP_DETAIL_PARAM_*} => {TRANSLATION}
getUploadDialogUrl()
Returns the URL to the Upload Dialog
public
static getUploadDialogUrl([array<string|int, mixed> $params = array() ]) : string
Parameters
- $params : array<string|int, mixed> = array()
-
URL parameters which should be passed to the UploadDialog
Tags
Return values
string —the UploadDialog URL
getValueGetter()
Returns a new CSItemValueGetter object
public
static getValueGetter(mixed $mName) : CSItemValueGetter
Parameters
- $mName : mixed
-
The name of the attribute to retrieve
Tags
Return values
CSItemValueGetter —getValueSetter()
Returns a new CSItemValueSetter object
public
static getValueSetter(mixed $mName, mixed $mValue) : CSItemValueSetter
Parameters
- $mName : mixed
-
The name of the attribute to retrieve
- $mValue : mixed
Tags
Return values
CSItemValueSetter —getValuesGetter()
Returns a new CSItemValuesGetter object
public
static getValuesGetter(array<string|int, mixed> $aNames) : CSItemValuesGetter
Parameters
- $aNames : array<string|int, mixed>
-
List of attributes to be retrieved.
Tags
Return values
CSItemValuesGetter —getValuesSetter()
Returns a new CSItemValuesSetter object
public
static getValuesSetter() : CSItemValuesSetter
Tags
Return values
CSItemValuesSetter —getVolume()
Loads an existing volume for a given ID
public
static getVolume([int $ID = null ]) : CSMamVolume
Parameters
- $ID : int = null
-
of the volume
Tags
Return values
CSMamVolume —a CSMamVolume object for the given ID
getVolumes()
Returns an array with CSMamVolume matching the SQL filter condition in the given sort order and limit.
public
static getVolumes([string $filter = '1=1' ][, string $sortOrder = 'Name' ][, mixed $limit = '' ]) : CSMamVolume|array<string|int, CSMamVolume>
Parameters
- $filter : string = '1=1'
-
SQL Filter condition.
- $sortOrder : string = 'Name'
-
SQL Sort Order
- $limit : mixed = ''
-
either a string which is a SQL limit condition or the integer 1, if only the first matching CSMamVolume should be returned
Tags
Return values
CSMamVolume|array<string|int, CSMamVolume> —either an array with the CSMamVolumes or the first CSMamVolume, if limit is set to 1
limitAllowedHtmlTags()
Limits all tags which are allowed in the formatted value result of any item This can e.g. be used for media neutral exports where not all html tags are supported
public
static limitAllowedHtmlTags([array<string|int, mixed> $htmlTags = array() ]) : mixed
Parameters
- $htmlTags : array<string|int, mixed> = array()
-
an array containing all allowed HTML Tags. If it is an empty array, no html tags are allowed
Tags
Return values
mixed —searchFiles()
Searches all files matching a given search criteria
public
static searchFiles(string $find[, mixed $attrIDs = null ][, mixed $rootIDs = null ][, mixed $depth = true ][, bool $checkInheritage = true ][, int $searchMode = CS_SEARCH_WITH_AND ][, array<string|int, mixed> $sortFields = array() ][, string $limit = '' ][, string $itemFilter = '' ], int $cacheTime) : array<string|int, CSMamFile>
Parameters
- $find : string
-
the content which must be found. If it is set to '*' everything matching the other criterias (rootIDs, SqlFilter ...) is returned.
- $attrIDs : mixed = null
-
either null to search all fields or an array containing direct values of the item like 'ExternalKey', the value 'Label' or FieldIDs. The value 'Keywords' is also allowed searching the keywords. This attribute limits the fields which should be searched.
- $rootIDs : mixed = null
-
either an integer or an array of integers describing the folders which should be searched. If set to NULL the ID of the current item is used.
- $depth : mixed = true
-
the depth of searching children. Eighter an integer or true to get the values of all children
- $checkInheritage : bool = true
-
whether inherited fields should be included into the search result or not
- $searchMode : int = CS_SEARCH_WITH_AND
-
a CS_SEARCH_ constant (CS_SEARCH_WITH_AND, CS_SEARCH_WITH_OR, CS_SEARCH_EXACT_PHRASE)
- $sortFields : array<string|int, mixed> = array()
-
the fields the result should be sorted by, with the field name as key and a CS_SORT constant as value (e.g. CS_SORT_STRING_ASC or CS_SORT_NUMERICAL_DESC)
- $limit : string = ''
-
SQL limit condition in the form [Amount] or [Start],[Amount] as integers where [Start] is beginning with the index 0.
- $itemFilter : string = ''
-
an additional sqlfilter which should be applied to the database queries, where all fields must have the alias item, e.g. 'item.IsFolder=1', 'item.CheckoutUser=0', 'item.FileSize >200 AND item.FileSize<300', 'item.ImageResolution>=300'
- $cacheTime : int
-
the time in minutes a search result may be cached to increase performance
Tags
Return values
array<string|int, CSMamFile> —An array of CSMamFiles matching the search with the given criteria.
validateMamExportLimit()
Checks if the total size of the files to be exported exceeds the maximum allowed and throws an exception when it does
public
static validateMamExportLimit(array<string|int, mixed> $aAllIds) : void
Parameters
- $aAllIds : array<string|int, mixed>
-
Array of IDs to be checked
Tags
Return values
void —zipFiles()
Creates one archive containing all given Mamfiles
public
static zipFiles(array<string|int, mixed> $aMamFileIDs[, string $sZipFileName = null ][, mixed $mTargetFolder = null ][, bool $bDownloadDirectly = false ][, array<string|int, mixed> $aAdditionalAttributes = array() ][, string $sContext = '' ]) : mixed
Parameters
- $aMamFileIDs : array<string|int, mixed>
-
The IDs of the files which should be zipped together. It can have the following form: simple array [ID1, ID2, ID3] or with imageserver parameters like {'[FILENAMESUFFIX]:[IMAGESERVERPARAMS]' : [ID1, ID2, ID3], ...}
- $sZipFileName : string = null
-
The optional name of the archive
- $mTargetFolder : mixed = null
-
The ID or the Mamfile object the zip should be stored to in CSMam
- $bDownloadDirectly : bool = false
-
Whether the zip should be automatically offered as download
- $aAdditionalAttributes : array<string|int, mixed> = array()
-
An array containing additional attributes for the packageCSV
- $sContext : string = ''
-
The context of the download call.
Tags
Return values
mixed —if a $targetFolder is given the new CSMamFile object is returned otherwise the path of the zip in the file system
