Contentserv PHP API

CSMamIdmlFile extends CSMamWhiteboardDocumentFile
in package

Defines an abstract document API, which combines document settings.

This will be extended by CSWhiteboard-compatible document file types like the or . This type of CSMamFile is automatically returned by the API methods, if the file extensions of a file is "indd". It supports all methods of the normal and extends it by document specific methods like .

Example:

CS::loadApi('CSMam');
$file = CSMam::getFile(381);
if ($file->getFileType() == 'pdf'){
  foreach($file->getPageThumbs() as $name => $link){
    echo "<br />Page " . $name . "<br /><img src='" .$link . "' />";
  }

 foreach($file->getImageLinks() as $link){
    echo "<br />Page " . $link->getFileName() . "<br /><img src='" . $link->getImageServerUrl(120) . "' />";
  }
}
Tags

Table of Contents

JBO_NS_PDF  = 'com.cs.pdf'
JBO_NS_PDF_BO  = 'com.cs.pdf.bo'
PDF_EXPORTOPT_FIRSTPAGE  = 'MAM_GUI_EDIT_EXPORTOPT_FIRSTPAGE'
PDF_EXPORTOPT_LASTPAGE  = 'MAM_GUI_EDIT_EXPORTOPT_LASTPAGE'
PDF_EXPORTOPT_PRINTASSPREADVIEW  = 'MAM_GUI_EDIT_EXPORTOPT_PRINTASSPREADVIEW'
PDF_EXPORTOPT_PRINTPAGENOTES  = 'MAM_GUI_EDIT_EXPORTOPT_PRINTPAGENOTES'
PDF_EXPORTOPT_PRINTQUALITY  = 'MAM_GUI_EDIT_EXPORTOPT_PRINTQUALITY'
PDF_EXPORTOPT_PRINTSKETCHNOTES  = 'MAM_GUI_EDIT_EXPORTOPT_PRINTSKETCHNOTES'
PDF_EXPORTOPT_SHOWBACKGROUND  = 'MAM_GUI_EDIT_EXPORTOPT_SHOWBACKGROUND'
PDF_EXPORTOPT_SHOWPAGEGRID  = 'MAM_GUI_EDIT_EXPORTOPT_SHOWPAGEGRID'
PDF_EXPORTOPT_SHOWPAGENOTES  = 'MAM_GUI_EDIT_EXPORTOPT_SHOWPAGENOTES'
PDF_EXPORTOPT_SHOWSKETCHES  = 'MAM_GUI_EDIT_EXPORTOPT_SHOWSKETCHES'
PDF_EXPORTOPT_SHOWSKETCHNOTES  = 'MAM_GUI_EDIT_EXPORTOPT_SHOWSKETCHNOTES'
PDF_EXPORTOPT_USETEMPLATETHUMBS  = 'MAM_GUI_EDIT_EXPORTOPT_USETEMPLATETHUMBS'
$ENUM_PDF_EXPORTOPTS  : mixed
__call()  : mixed
Call functions that are not defined in this class, but in the MamFile.
__destruct()  : mixed
addActionHistory()  : void
Add an action to the items history information. History entries have at least to be defined by an action name and an action description (max. 255 letters).
addConfigurationClassIds()  : mixed
Adds / Extends the configuration class ids to the current item.
addImage()  : bool
Registers an image or document to a given attribute in the product.
addPreviewMaster()  : void
Add a web-based image file as a master preview file which will be used for the creation of all preview files used in CONTENTSERV
addReference()  : CSItemApiReference|null
Adds one or more references for an attribute
addReferencedItem()  : CSCometItemApiReference
Adds a PDM product/view to the list of products that are referenced in the current document.
addReferencedItemToPlacedList()  : CSCometItemApiReference
Adds a PDM product/view to the list of products that are referenced in the current document.
addReferencedItemToPlannedList()  : CSCometItemApiReference
Adds a PDM product/view to the list of products that are referenced in the current document.
archive()  : bool
Returns whether the file is archived
checkDocumentSyncState()  : mixed
/CS/PD/*: Explanation needed
checkin()  : bool
Checks the item in
checkout()  : bool
Checks the item out
compareFormattedValueTo()  : mixed
Compares the formatted content whether it is marked as changed to an old value
copy()  : CSItemApiItem
Copies an existing item
createLink()  : CSMamFile
Creates a link to the MamFile in a given directory
createPageThumbsAsHtml()  : string
Returns the Thumb representation of all pages from this file
delete()  : void
Deletes an item
deleteKeyword()  : mixed
Deletes a keyword from the current item
deleteKeywords()  : mixed
Deletes all keywords for the current item
deletePreviewFiles()  : void
Deletes the cache files for the CSMamFile and its children and marks the previews as missing
disableRightCheck()  : bool
This method can be used to disable the standard right checks for this object.
enableRightCheck()  : bool
This method can be used to enable the standard right checks for this object.
executeWorkflowAction()  : bool
executes a workflow action on the current record
exists()  : bool
Is the current file instance existing.
exportExcel()  : string
Exports the Items to a Excel file (like in the Excel list export)
getAccessLevels()  : array<string|int, mixed>
Returns an array containing all accesslevels for this item
getActionHistory()  : CSItemApiHistory
Retrieve item action history api
getAggregatedValue()  : float
Aggregates the values for a given field
getAllFields()  : array<string|int, CSItemApiField>
Return all known fields including the default api fields objects (like for Label, ExternalKey, ..) and the user defined fields (including system api fields with negative ID)
getAttachmentFolder()  : string
Returns the MAM path where attachments are stored
getAvailableWorkflowActions()  : array<string|int, Action>
Returns the available Workflow Actions for the current item
getBackReferences()  : array<string|int, mixed>
Returns all backreferences for an item
getChangedAt()  : string
Return last change date of the item
getChildren()  : array<string|int, CSItemApiItem>
Returns an array with the children of an item
getChildrenIDs()  : array<string|int, mixed>
Returns an array with the ids of the children of an item
getCometTemplateForPageID()  : mixed
Returns id of the comet page template for a given pageID
getCometTemplates()  : array<string|int, mixed>
Returns all selected comet page templates for this document
getCometTemplatesForWhiteboarding()  : array<string|int, mixed>
Returns visible templates for all pages in document
getConfigurationClassId()  : int
Returns the root configuration class of the item
getConfigurationClassIds()  : array<string|int, mixed>
Returns the configuration class ids of the item.
getConfigurationField()  : CSItemApiField
Returns the CSItemApiField object for the current items configuration (Base Field)
getContextFolder()  : string
Returns the mam path of a context folder (object folder) for the current item (@see CSMam::getContextFolder())
getCreatedAt()  : string
Return creation date of the item
getCrossReferencedViews()  : array<string|int, mixed>
Returns all CSItemApiViews referencing this item
getCSImage()  : string
Returns a item image as a cs:image CSTag
getCTime()  : string
Return the creation date for the current file.
getDataCTime()  : string
Return creation date of CONTENTSERV data entry for current file
getDataMTime()  : string
Return modification date of CONTENTSERV data entry for current file
getDefaultLanguageID()  : int
Returns the ID of the default language from the current session.
getDefaultPageTemplateForPageSide()  : CSCometPageTemplate
returns the default page template for the passed page side
getDefaultTemplateID()  : int
Returns the default comet page template id set in the item editor
getDocumentHeight()  : float
Returns the height of the InDesign document in centimeters.
getDocumentLanguage()  : object
returns the document language for the current document
getDocumentLanguageID()  : int
Returns the id of the currently set document language
getDocumentLink()  : string
Returns a HTML Link to a document of the product
getDocumentSize()  : string
Returns the size name of the InDesign document (like "DIN A4").
getDocumentTypeAreaHeight()  : float
Returns the type area height of the InDesign document in centimeters.
getDocumentTypeAreaWidth()  : float
Returns the type area width of the InDesign document in centimeters.
getDocumentWidth()  : float
Returns the width of the InDesign document in centimeters.
getDownloadLink()  : string
Returns the URL of the link, where the user can download the file.
getDriverFile()  : CSMamDriverFile
Returns the MAM driver file API object of the file.
getDuplicatesByMD5()  : array<string|int, mixed>
Returns the duplicate files with the same MD5 hash of the current file.
getEditorURL()  : string
Returns the URL to the backend editor for this Item
getEXIF()  : mixed
Retrieve EXIF informations for this file
getExternalKey()  : string
Returns the external key of the item
getField()  : CSItemApiField
Returns a specific field of an item
getFieldByIdentifier()  : CSItemApiField
getFieldIDs()  : array<string|int, mixed>
Returns all the FieldsID of the item without the base field
getFields()  : array<string|int, CSItemApiField>
Returns all the fields of the item without the base field
getFieldStateID()  : int
Gets the Workflow State for a given field
getFileBaseName()  : string
Obtain filename without the file suffix
getFileContent()  : string
Returns the file content of the MamFile.
getFileName()  : string
Obtain the FileName without directories
getFilePath()  : string
Returns the Path of the file
getFiles()  : array<string|int, CSMamFile>
Obtain list of CSMamFile objects contained in current folder
getFileSize()  : string
Retrieve formatted file size information. Returns "0" for folders.
getFileType()  : string
Obtain file type suffix, e.g. "jpg"
getFolder()  : CSMamFile
Returns the folder of the CSMamFile
getFonts()  : array<string|int, mixed>
Returns the name of the fonts in the InDesign document.
getFormattedValue()  : mixed
Gets a formatted value of an item.
getFormattedValues()  : array<string|int, mixed>
Loads some values directly from the database and formats them automatically.
getGrid()  : CSGrid
Returns an value from an appropriate field as CSGrid object
getIcon()  : string
Retrieve image URL of an icon representing the current file
getID()  : int
Returns the ID of the item
getImage()  : string
Returns the path of the image in the ImageServer.
getImageColorspace()  : string
Returns the colorspace of the file, if it is an image.
getImageFile()  : CSFileStream|null
Returns the file stream of the image in the ImageServer.
getImageHeight()  : int
Returns the height of the file in pixel, if it is an image.
getImageLinks()  : array<string|int, mixed>
Returns the file links to images used in the indesign document as array with relative file links for each image in the InDesign document
getImageResolution()  : int
Returns the resolution of the file in dpi, if it is an image.
getImageServerID()  : string
Returns the ID which must be passed to the ImageServer URL
getImageServerURL()  : string
Returns the URL of the ImageServer, which displays this item (or preview image of this item).
getImageServerURLForPreset()  : string
Returns the URL of the ImageServer, which displays this file, based on the passed preset.
getImageWidth()  : int
Returns the width of the file in pixel, if it is an image.
getIPTC()  : mixed
Retrieve IPTC informations for this file
getItem()  : Item
Returns the Item Record which corresponds to the CSItemApiItem object
getItemOwner()  : int
Returns the UserID of the owner of the item
getItemTemplatesByPageID()  : array<string|int, CSCometItemTemplate>
Returns array of CSCometTemplate for a given pageID
getItemTemplatesBySpreadID()  : array<string|int, mixed>
Returns a merged array of CSCometTemplate for a given spreadID
getKeywords()  : array<string|int, mixed>
Returns the keywords defined for the current file
getLabel()  : string
Returns the label of the item
getLabelPath()  : array<string|int, string>
Returns an array with the labels of an item.
getLayers()  : array<string|int, mixed>
Returns the name of the layers in the InDesign document.
getLinkedFile()  : CSMamFile
Returns the file a MamFile is linked to
getLocalFilesystemPath()  : string
Returns the path of the file in the local filesystem where the file can be read from or should be written to If the path for reading is requested and the original file is not accessible through the local filesystem a copy is downloaded and its path is returned
getLockUser()  : CSUser
returns the user object for the user id the file has been locked for
getMamPath()  : string
Returns the MamPath of the file
getMasterDimensions()  : array<string|int, mixed>
Returns the pixel dimensions of the master image of a given MAM image file.
getMasterPreviewCacheFile()  : CSMamVolumeCacheFile
Returns the master preview cache file to create / embed previews from / in webpages or other applications.
getMasterPreviewPath()  : string
Returns the path of the master preview in the local filesystem, to create / embed previews from / in webpages or other applications.
getMergeList()  : CSWhiteboardMergedItemList
Returns a Merged List
getMetaData()  : CSFileMetadata
Returns object of CSFileMetadata.
getMetaDataClass()  : CSFileMetaData
Returns the metadata class for the MamFile class.
getMetaDataTypes()  : array<string|int, mixed>
Returns the supported meta types for the current class.
getMTime()  : string
Return the date of last change on the current file.
getNewInstance()  : CSItemApiItem
Returns a new instance of the current object for a new ID
getOwner()  : int
Returns the UserID of the owner of the item, if it is checked out.
getPageCount()  : int
Returns the number of pages in the InDesign document.
getPageIdByIndex()  : int
Returns the INDD ID of a page using its page index.
getPageIds()  : array<string|int, mixed>
Returns an array of all page IDs, sorted by their page index, which have been obtained from the INDD master template.
getPageIndexById()  : int
Returns the index of a page using its INDD page ID.
getPageItemsMapping()  : array<string|int, mixed>
Returns a list of planned products for the whiteboard file, grouped by the INDD page ID on which the items reside.
getPageNames()  : array<string|int, mixed>
Returns the page names (also known as paginas or folios) of all pages in the InDesign document.
getPageThumb()  : string
Provides an imageserver URL for a 72dpi full-size thumbnail of a single page in the InDesign document.
getPageThumbAsImageServerUrl()  : string
Provides a single thumbnail as ImageServer URL for a given page name and offers resizing and reshaping.
getPageThumbs()  : array<string|int, mixed>
Returns an array of page thumbnails with imageserver URLs for each page in the InDesign document.
getPageThumbsAsImageServerUrls()  : array<string|int, mixed>
Provides all page thumbnails as ImageServer URLs and offers resizing and reshaping.
getPageThumbsMapping()  : array<string|int, mixed>
Returns a list of page thumb imageserver URLs for the whiteboard file, grouped by the INDD page ID.
getParent()  : CSItemApiItem
Returns the parent of an CSItemApiItem
getPath()  : array<string|int, mixed>
Returns an array with the ancestors of an item
getPDF()  : string
Generates a PDF document from the whiteboard document's sketch information.
getPDFFile()  : CSMamVolumeCacheFile|null
Generates the PDF file of the current document file.
getPlacedList()  : CSCometItemApiReferenceList
Returns a Placed List
getPlacedListForDTP()  : mixed
Returns a DTP Placed List
getPlannedList()  : CSCometItemApiReferenceList
Returns a Planned List
getPlannedListForDTP()  : mixed
Returns a DTP Planned List
getPlannedPageNames()  : array<string|int, mixed>
Returns the planned page names (for example in the publication manager) of all pages in the document.
getPredecessor()  : CSItemApiItem
Returns the Predecessor of an CSItemApiItem
getPreviewFields()  : array<string|int, CSItemApiField>
Returns fields that were marked as preview fields
getPreviewImage()  : string
Returns the path of the preview image in the ImageServer.
getPreviewImageURL()  : string
Returns the path of the preview image in the ImageServer.
getRating()  : object
Retrieve item rating api
getReferenceConfigurations()  : array<string|int, mixed>
Returns all fields of the configuration (a.k.a. class) associated with the references for an attribute of an item.
getReferencedItem()  : CSItemApiItem
Returns the first referenced item for a reference CSType Attribute
getReferencedItemList()  : CSItemApiReferenceList
Returns an array of all item objects that are referenced in the current document.
getReferencedItemsValues()  : array<string|int, mixed>
Returns the attribute values that are associated with the current document's item references.
getReferenceList()  : CSItemApiReferenceList
Returns the reference list for an attribute of the item
getReferences()  : array<string|int, mixed>
Returns the references for an attribute of the item It is recommended to use CSItemApiReferenceList API instead of this method. (getReferenceList method)
getReferencesValues()  : array<string|int, mixed>
Returns the additional values that are associated with the references for an attribute of an item.
getReferenceValue()  : string
Returns a specific additional value that is associated with a specific reference for an attribute of an item.
getReferenceValues()  : array<string|int, mixed>
Returns the additional values that are associated with a specific reference for an attribute of an item.
getRoles()  : array<string|int, mixed>
Returns all roles the current user has for this item
getSimpleSearchableFieldIds()  : array<string|int, mixed>
Fetches the list of simple searchable field IDs
getSketchItemImage()  : CSMamFile
Retrieve the image for a sketch of a given item using a fallback mechanism.
getSketchItemImageUrl()  : string
Retrieve the image URL for a sketch of a given item using a fallback mechanism.
getSketchProductImageUrl()  : mixed
getSpreadCount()  : int
Returns the number of spreads in the InDesign document.
getSpreadReferences()  : array<string|int, mixed>
Returns an array with the references of spreads in the InDesign document.
getSpreads()  : mixed
getStandardFields()  : array<string|int, CSItemApiField>
Returns all the standard fields of the item and their API representation Note: As the CSItemFields are just wrappers not to be designed to display standard fields not all available methods will work for them
getTable()  : CSItemApiTable
Gets a TableAPI-Object for a given Field ID
getTableRow()  : CSItemApiTableRow
Returns the CSItemApiTableRow object for a given TableRowID
getTextFrames()  : mixed
getUploadLink()  : string
Returns the html code for a link where one can upload a new file to the current file.
getValue()  : mixed
Gets a value of an item
getValueAsImageURL()  : mixed
Returns the URL of the ImageServer, which displays this file.
getValueForConfig()  : mixed
Queries the value defined by the getter object
getValues()  : array<string|int, mixed>
Loads some values directly from the database and do not format them automatically.
getValuesForConfig()  : array<string|int, mixed>
Loads all values matching the getter definition.
getVolume()  : CSMamVolume
Returns the CSMamVolume of the CSMamFile
getWebDavJSCode()  : string
generates javascript code to open the current file in a webdav client
getWhiteboardSketchNotes()  : array<string|int, mixed>
Returns all sketch notes for a whiteboard document.
getWrapperItem()  : CSItemApiWrapperItem
Returns the cluster item of the current item API item.
getXMP()  : mixed
Retrieve XMP headers for this file
hasPreviewMaster()  : bool
Check for a preview master file
hasVersionFile()  : mixed
importExcel()  : string
Imports on Excel or CSV file in the format of the {@link CSItemApiItem::exportExcel} format.
isArchived()  : bool
Returns whether the file is archived
isCheckedOut()  : bool
Check if the current item is checked out by the current user
isEditable()  : bool
Chechs whether the current user has the right to edit the item
isFolder()  : bool
Check if the file instance is a folder.
isForeignCheckedOut()  : bool
Check if the current item is checked out by a user who is not the current user (a/k/a "foreign check-out")
isImage()  : bool
Returns true if the file is an image
isLink()  : bool
Returns true if the file is a link
isLocked()  : bool
returns whether the current file is locked
isLockedForOtherUser()  : bool
returns whether the current file is locked by another user as the current user
isMetaDataLicenseActivated()  : mixed
Returns a boolean value whether the license for meta data is activated or not.
isMetaDataSupportActivated()  : bool
Returns a boolean whether the meta data support is activated or not.
isPrintfile()  : bool
Defines if file is valid printfile
isRegistered()  : bool
Check if the current file instance is contained in a CSMamVolume of the MAM-Suite
isVideo()  : bool
Returns true if the file is a video
isViewable()  : bool
Checks whether the current user has the right to view the item
isWritable()  : bool
Check for writing access on the current file instance. Not necessarily based on physical write ability of current user
loadVersion()  : void
Loads a specific version with a given versionNr of the current item
lock()  : int
locks a file to prevent file system perations by another users
move()  : bool
Moves the item near to the target item
readDocumentAlphaData()  : mixed
Reads the document alpha data of the current document file.
recalculateGroupLeftPosition()  : int
Converts an absolute (spread-based) position (in millimeters) of a Comet group into a relative (page-based) position (in millimeters).
removeImage()  : void
Removes all image or document from an attribute in the product with a given url.
removeReference()  : bool
Removes the references for an attribute
restore()  : bool
Returns whether the file is archived
restoreFromPreviewMaster()  : bool
Restore the live master from the uploaded preview master This will not start the sync
searchContent()  : CSItemSearchResult|array<string|int, int>
Searches all items matching a given search criteria
searchContentExtended()  : CSItemSearchResult
This method handles searchSimpleContent method result paginated way.
searchSimpleContent()  : CSItemSearchResult|array<string|int, int>
Searches all items matching a given search criteria
setAccessLevels()  : void
Sets the access levels for this item
setConfiguration()  : void
Sets the configuration id for the current item
setConfigurationClassIds()  : void
Sets the configuration class ids
setDefaultLanguageID()  : mixed
Changes the default language to the given language for the current session and therefore for all items.
setExternalKey()  : void
Sets the external key of the item
setFieldStateID()  : int
Sets the Workflow State for a given field
setFileContent()  : bool
Sets a new file content to the MamFile.
setFileName()  : mixed
Renames the CSMamFile
setFormattedValue()  : void
Sets a formatted value of an item
setGrid()  : void
Allows to set a CSGridItem as value to a field
setKeyword()  : mixed
Adds a keyword to the current item
setKeywords()  : mixed
Sets the keywords for the current item
setLabel()  : void
Sets the label of the item
setOmittingVersionFile()  : bool
this method allows it to temporary disable the version file creation.
setPlannedPageNames()  : void
Allows to set the planned page names (for example in the publication manager) of all pages in the document.
setReferences()  : void
Sets the references for an attribute
setReferencesValues()  : bool
Associates multiple additional values with the references for an attribute of an item.
setReferenceValue()  : bool
Associates a single value with a specific reference for an attribute of an item.
setReferenceValues()  : bool
Associates multiple additional values with a specific reference for an attribute of an item.
setValue()  : void
Sets a value of an item
setValueForConfig()  : void
Sets a value on the item matching the setter definition.
setValues()  : bool
This method is designed to update multiple values for multiple Items.
setValuesForConfig()  : void
Sets values on the item matching the setter definition.
store()  : int
Stores an item to the database and returns the ID of the item
synchronize()  : array<string|int, mixed>
Synchronizes all files within the current folder Sometimes a extended synchronisation is required, e.g. when the local version files have been deleted, e.g. by installing a backup on a other system. For this reason the $forceCompleteCheck flag has been added.
toXml()  : array<string|int, mixed>
Returns an xml content with the item and it's children
undoCheckout()  : bool
Do an undo checkout to the current item
unlink()  : bool
Replaces a link with a copy of the original file
unlock()  : int
unlocks a file previously locked by the lock-method
unzip()  : array<string|int, CSMamFile>
Extracts files from the Mamfile, if it is a zip.
unzipFiles()  : array<string|int, CSMamFile>
Extracts only files (without folder structure) from the MamFile, if it is a zip.

Constants

PDF_EXPORTOPT_PRINTASSPREADVIEW

public mixed PDF_EXPORTOPT_PRINTASSPREADVIEW = 'MAM_GUI_EDIT_EXPORTOPT_PRINTASSPREADVIEW'
Tags

PDF_EXPORTOPT_PRINTPAGENOTES

public mixed PDF_EXPORTOPT_PRINTPAGENOTES = 'MAM_GUI_EDIT_EXPORTOPT_PRINTPAGENOTES'
Tags

PDF_EXPORTOPT_PRINTSKETCHNOTES

public mixed PDF_EXPORTOPT_PRINTSKETCHNOTES = 'MAM_GUI_EDIT_EXPORTOPT_PRINTSKETCHNOTES'
Tags

PDF_EXPORTOPT_SHOWBACKGROUND

public mixed PDF_EXPORTOPT_SHOWBACKGROUND = 'MAM_GUI_EDIT_EXPORTOPT_SHOWBACKGROUND'
Tags

PDF_EXPORTOPT_SHOWSKETCHNOTES

public mixed PDF_EXPORTOPT_SHOWSKETCHNOTES = 'MAM_GUI_EDIT_EXPORTOPT_SHOWSKETCHNOTES'
Tags

PDF_EXPORTOPT_USETEMPLATETHUMBS

public mixed PDF_EXPORTOPT_USETEMPLATETHUMBS = 'MAM_GUI_EDIT_EXPORTOPT_USETEMPLATETHUMBS'
Tags

Properties

$ENUM_PDF_EXPORTOPTS

public static mixed $ENUM_PDF_EXPORTOPTS = array(self::PDF_EXPORTOPT_FIRSTPAGE => \NULL, self::PDF_EXPORTOPT_LASTPAGE => \NULL, self::PDF_EXPORTOPT_SHOWBACKGROUND => \FALSE, self::PDF_EXPORTOPT_SHOWSKETCHES => \TRUE, self::PDF_EXPORTOPT_SHOWPAGEGRID => \FALSE, self::PDF_EXPORTOPT_SHOWPAGENOTES => \TRUE, self::PDF_EXPORTOPT_SHOWSKETCHNOTES => \TRUE, self::PDF_EXPORTOPT_USETEMPLATETHUMBS => \FALSE, self::PDF_EXPORTOPT_PRINTPAGENOTES => 0, self::PDF_EXPORTOPT_PRINTSKETCHNOTES => 0, self::PDF_EXPORTOPT_PRINTASSPREADVIEW => \FALSE, self::PDF_EXPORTOPT_PRINTQUALITY => 0)
Tags

Methods

__call()

Call functions that are not defined in this class, but in the MamFile.

public __call(string $name, array<string|int, mixed> $params) : mixed
Parameters
$name : string

Name of the function called, e.g. 'clearCache'

$params : array<string|int, mixed>

Parameters that have been supplied to the function call

Tags
Return values
mixed

false if function doesn't exist in driver or else the return value of the function from the driver implementation

__destruct()

public __destruct() : mixed
Tags
Return values
mixed

addActionHistory()

Add an action to the items history information. History entries have at least to be defined by an action name and an action description (max. 255 letters).

public addActionHistory(string $action, mixed $short[, mixed $long = '' ][, string $objType = '' ], int $objID[, string $stateBefore = '' ][, string $stateAfter = '' ]) : void

Additionally, and to allow for versioning subelements of items, an object type and an object identifier can be given. E.g. if the item is an indesign document, it might contain sublementary text containers that can be versionized by setting the object type to the container class and by specifying the id of the instance of this class.

To save the states of an item by change and not by checkin, the $stateBefore and $stateAfter attributes can be included in the call of this function. It is possible to supply an XML snippet that describes the state an item had before the operation and after. These may not be binaries of any form. File changes can be versionized by giving file paths to the historic and the changed file version.

Parameters
$action : string

a short text that stands for the type of action that describes the action type, e.g. "checkout" or "rename"

$short : mixed
$long : mixed = ''
$objType : string = ''

name of a sublementary item object, e.g. "page" or "exif"

$objID : int

identification number of the items sub-object

$stateBefore : string = ''

reference or xml snippet to allow for recreation of the state before an action took place

$stateAfter : string = ''

reference or xml snippet that allows to recreate an item state after an action took place

Tags
access

public

Return values
void

addConfigurationClassIds()

Adds / Extends the configuration class ids to the current item.

public addConfigurationClassIds(array<string|int, mixed> $aClassIds) : mixed
Parameters
$aClassIds : array<string|int, mixed>

An array with configuration class or folder ids.

Tags
Return values
mixed

addImage()

Registers an image or document to a given attribute in the product.

public addImage(int $attrID, string $url[, string $tooltip = null ][, string $link = null ][, bool $doStore = false ][, array<string|int, mixed> $additionalParams = array() ]) : bool
Parameters
$attrID : int

the id of the attribute which contains the image

$url : string

the path to the image either as path or as MamfileID

$tooltip : string = null

the tooltip of the image

$link : string = null

the link of the image

$doStore : bool = false

store the product for a persistent change

$additionalParams : array<string|int, mixed> = array()

additional values in the form key=>value which might be the standard keys like 'Type' or userdefined values

Tags
access

public

Return values
bool

success indicator

addPreviewMaster()

Add a web-based image file as a master preview file which will be used for the creation of all preview files used in CONTENTSERV

public addPreviewMaster(string $filePath[, bool $delExisting = true ][, bool $startCreation = true ]) : void

The preview file given should have the same width and height as the original file. A default preview master is usually the same size or at least 1024 Pixels wide and 768 Pixels high.

The preview fiel is copied to the thumbs folder as the master as well as to the asset folder where it is retrieved from when image previews are deleted

The replacement is available as soon this method finishes processing. Therefore, all existing preview files are removed and the creation of the previews is started while using the new preview file.

Parameters
$filePath : string

location of temporary preview file

$delExisting : bool = true

default: true, false if existing previews should not be removed

$startCreation : bool = true

default: true, false if thumbs should be deleted but creation should not be started

Tags
throws
CSMamException
access

public

Return values
void

addReference()

Adds one or more references for an attribute

public addReference(int $iAttrID[, int|Record|array<string|int, int>|array<string|int, Record$amRefIDs = array() ][, int $iLanguageID = null ][, array<string|int, mixed> $aAdditionalParams = array() ][, bool $bInsertAtEnd = true ][, string $sClassName = null ], mixed $iContextId) : CSItemApiReference|null
Parameters
$iAttrID : int

The id of the attribute which contains the references

$amRefIDs : int|Record|array<string|int, int>|array<string|int, Record> = array()

Eighter a single id|Record or an array containing the ids|Records of the new references

$iLanguageID : int = null

The optional languageID

$aAdditionalParams : array<string|int, mixed> = array()

additional values in the form key=>value which might be the keys like 'Type', 'SortOrder' or user defined values

$bInsertAtEnd : bool = true

Whether the reference should be added after (true) or before (false) all others.

$sClassName : string = null

The class name for the Records to be added. $refIDs is only containing ids this param will be used to add the correct record. If no class name is given the first configured record from CSType will be used by default

$iContextId : mixed
Tags
access

public

Return values
CSItemApiReference|null

The created reference or null if something went wrong or no ids are given

addReferencedItem()

Adds a PDM product/view to the list of products that are referenced in the current document.

public addReferencedItem(int|array<string|int, Item$iReferenceItemId[, array<string|int, mixed> $asAdditionalParams = array() ]) : CSCometItemApiReference
Parameters
$iReferenceItemId : int|array<string|int, Item>

The ID of the item that should be added to the reference list.

$asAdditionalParams : array<string|int, mixed> = array()

additional values in the form key=>value which might be the keys like 'Type', 'SortOrder' or userdefined values

Tags
access

public

Return values
CSCometItemApiReference

the created reference

addReferencedItemToPlacedList()

Adds a PDM product/view to the list of products that are referenced in the current document.

public addReferencedItemToPlacedList(int|array<string|int, Item$iReferenceItemId[, array<string|int, mixed> $asAdditionalParams = array() ]) : CSCometItemApiReference
Parameters
$iReferenceItemId : int|array<string|int, Item>

The ID of the item that should be added to the reference list.

$asAdditionalParams : array<string|int, mixed> = array()

additional values in the form key=>value which might be the keys like 'Type', 'SortOrder' or userdefined values

Tags
access

public

Return values
CSCometItemApiReference

the created reference

addReferencedItemToPlannedList()

Adds a PDM product/view to the list of products that are referenced in the current document.

public addReferencedItemToPlannedList(int|array<string|int, Item$iReferenceItemId[, array<string|int, mixed> $asAdditionalParams = array() ]) : CSCometItemApiReference
Parameters
$iReferenceItemId : int|array<string|int, Item>

The ID of the item that should be added to the reference list or Item object.

$asAdditionalParams : array<string|int, mixed> = array()

additional values in the form key=>value which might be the keys like 'Type', 'SortOrder' or userdefined values

Tags
access

public

Return values
CSCometItemApiReference

the created reference

archive()

Returns whether the file is archived

public archive(mixed $archiveVolumeID) : bool
Parameters
$archiveVolumeID : mixed
Tags
deprecated

since PXC24.5: The archive functionality is deprecated and should not be used anymore.

Return values
bool

whether the file is archived

checkDocumentSyncState()

/CS/PD/*: Explanation needed

public checkDocumentSyncState() : mixed
Tags
access

public

Return values
mixed

checkin()

Checks the item in

public checkin([bool $recursive = false ][, string $note = null ]) : bool
Parameters
$recursive : bool = false

whether the checkin has to affect all children

$note : string = null

a version note

Tags
access

public

Return values
bool

whether checkin succeeded or not

checkout()

Checks the item out

public checkout([bool $recursive = false ][, int $UserID = null ]) : bool
Parameters
$recursive : bool = false

whether the checkout has to affect all childrens

$UserID : int = null

ID of the user the item has to be checked out for, if null the current user is taken

Tags
access

public

Return values
bool

whether checkout succeeded or not

compareFormattedValueTo()

Compares the formatted content whether it is marked as changed to an old value

public compareFormattedValueTo(string $identifier, mixed $value[, int $languageID = null ][, string $medium = '' ]) : mixed

If you pass the label of the field as identifier be aware that labels are not unique and the value of the first field with that label will be returned.

Parameters
$identifier : string

field ID or field label of the value to get

$value : mixed

the new formatted value to compare to

$languageID : int = null

the requested languageID of the identifier or null if the current default language should be used

$medium : string = ''

an alternative medium the value should be formatted for ( CSItemMedium::HTML or CSItemMedium::TEXT are supported as standard). This parameter is passed to the CSTypes getValue() method.

Tags
@return

int < / > 0 if $value is less / more than the old value and 0 if they are equal.

Return values
mixed

copy()

Copies an existing item

public copy(int $targetID[, int $position = CSITEM_POSITION_CHILD ][, bool $recursive = false ]) : CSItemApiItem
Parameters
$targetID : int

ID of the targeted item

$position : int = CSITEM_POSITION_CHILD

Position relative to the target item

$recursive : bool = false

Whether the item is copied recursive

Tags
access

public

Return values
CSItemApiItem

A CSItemApiItem representing the new copy or null if copy was not successful.

Creates a link to the MamFile in a given directory

public createLink([string $mamPath = null ]) : CSMamFile
Parameters
$mamPath : string = null

the complete path of the file including the filename which should be created, or the directory it should be created in

Tags
access

public

Return values
CSMamFile

a CSMamFile representing the link

createPageThumbsAsHtml()

Returns the Thumb representation of all pages from this file

public createPageThumbsAsHtml() : string
Tags
Return values
string

containing thumb previews as links

delete()

Deletes an item

public delete([bool $deleteReferencedCollections = false ]) : void
Parameters
$deleteReferencedCollections : bool = false

whether all collections which reference this item should also be deleted

Tags
access

public

Return values
void

deleteKeyword()

Deletes a keyword from the current item

public deleteKeyword(mixed $keyword) : mixed
Parameters
$keyword : mixed

keyword ID or CSKeyword object containing the keywords

Tags
access

public

Return values
mixed

deleteKeywords()

Deletes all keywords for the current item

public deleteKeywords() : mixed
Tags
access

public

Return values
mixed

deletePreviewFiles()

Deletes the cache files for the CSMamFile and its children and marks the previews as missing

public deletePreviewFiles([bool $recursive = true ][, bool $removeImageSizeInformations = true ]) : void
Parameters
$recursive : bool = true

whether previews in subdirectories should be also deleted

$removeImageSizeInformations : bool = true

whether image proportions should also be marked to be recalculated

Tags
access

public

Return values
void

disableRightCheck()

This method can be used to disable the standard right checks for this object.

public disableRightCheck() : bool

Even, if a user doesn't have the right to edit the item, he can check out/in or store it.

Tags
access

public

Return values
bool

enableRightCheck()

This method can be used to enable the standard right checks for this object.

public enableRightCheck() : bool

If the right check was disabled previously by @disableRightCheck method. It is not necessary to enable the right check if it was not disabled previously.

Tags
access

public

Return values
bool

executeWorkflowAction()

executes a workflow action on the current record

public executeWorkflowAction(mixed $action[, bool $recursive = false ][, string $note = '' ]) : bool
Parameters
$action : mixed

an action object instance or the actionID of the action to execute

$recursive : bool = false

whether this action should be executed recursively on all children

$note : string = ''

the note that should be stored for the executed action

Tags
access

public

Return values
bool

whether the action has been executed successfully or not

exists()

Is the current file instance existing.

public exists() : bool
Tags
access

public

Return values
bool

true/false

exportExcel()

Exports the Items to a Excel file (like in the Excel list export)

public exportExcel([mixed $depth = true ][, array<string|int, mixed> $fields = array() ][, array<string|int, mixed> $rootIds = array() ][, string $fileName = '' ][, bool $csv = false ]) : string
Parameters
$depth : mixed = true

the depth of searching children. Eighter an integer or true to get the values of all children

$fields : array<string|int, mixed> = array()

limit the export to the given fields

$rootIds : array<string|int, mixed> = array()

the optional rootIds which should be exported, otherwise the current ID is used as rootId.

$fileName : string = ''

the name and path to write the excel file to

$csv : bool = false

whether the export should be in Excel (default: false) or CSV Format (true)

Tags
access

public

throws
CSItemException

if an error occurs

Return values
string

the path to the export file

getAccessLevels()

Returns an array containing all accesslevels for this item

public getAccessLevels([bool $showInherited = false ][, bool $showOnlyVisibles = false ]) : array<string|int, mixed>
Parameters
$showInherited : bool = false

whether inherited accesslevels should also be returned

$showOnlyVisibles : bool = false

whether only accesslevels should be returned which are visible to the current user

Tags
access

public

Return values
array<string|int, mixed>

an array containing all accesslevels in the form ID => Name

getAggregatedValue()

Aggregates the values for a given field

public getAggregatedValue(array<string|int, mixed> $configurationId[, mixed $depth = true ][, bool $allowInheritance = true ][, bool $addFolders = true ][, array<string|int, mixed> $rootIds = null ][, int $languageId = null ]) : float
Parameters
$configurationId : array<string|int, mixed>

the IDs for the configurations. Its values might either be integers describing configurationIDs or the standard fields like 'Label', 'StateID', 'WorkflowID'. If this value is null then all fields are fetched

$depth : mixed = true

the depth of searching children. Eighter an integer or true to get the values of all children

$allowInheritance : bool = true

whether the result from the parent node should be returned if no value is found for an item

$addFolders : bool = true

whether values from folders should also be returned

$rootIds : array<string|int, mixed> = null

the optional rootIds which should be searched, otherwise the current ID is used as rootId.

$languageId : int = null

the languageId which should be searched

Tags
access

public

Return values
float

the aggregated value

getAllFields()

Return all known fields including the default api fields objects (like for Label, ExternalKey, ..) and the user defined fields (including system api fields with negative ID)

public getAllFields() : array<string|int, CSItemApiField>
Tags
Return values
array<string|int, CSItemApiField>

getAttachmentFolder()

Returns the MAM path where attachments are stored

public getAttachmentFolder() : string
Tags
access

public

Return values
string

the MAM path where attachments are stored

getAvailableWorkflowActions()

Returns the available Workflow Actions for the current item

public getAvailableWorkflowActions([bool $bCheckRights = false ]) : array<string|int, Action>
Parameters
$bCheckRights : bool = false

if true, only actions available for the current user are returned

Tags
Return values
array<string|int, Action>

array of Action Records which are available in the form ActionID => Action.

getBackReferences()

Returns all backreferences for an item

public getBackReferences([string $className = null ][, string $attrID = null ]) : array<string|int, mixed>
Parameters
$className : string = null

the optional name of the class of the referencing record

$attrID : string = null

the optional id of the attribute of the referencing record

Tags
access

public

Return values
array<string|int, mixed>

an array of backreferences information array with the keys StartFieldID, Amount, LanguageID, ... and Reference containing the record referencing this item.

getChangedAt()

Return last change date of the item

public getChangedAt([string $format = NULL ]) : string
Parameters
$format : string = NULL

date format php.net/date

Tags
access

public

Return values
string

formatted change date

getChildren()

Returns an array with the children of an item

public getChildren(int $levels) : array<string|int, CSItemApiItem>
Parameters
$levels : int

depth of levels to descend to, if 0 all childrends are returned

Tags
access

public

Return values
array<string|int, CSItemApiItem>

array with the children items of the item

getChildrenIDs()

Returns an array with the ids of the children of an item

public getChildrenIDs(int $levels[, bool $includeFolder = false ][, mixed $rootID = null ]) : array<string|int, mixed>
Parameters
$levels : int

Depth of levels to descend to, if 0 all childrends are returned

$includeFolder : bool = false

Whether the id of the rootFolder should also be returned

$rootID : mixed = null

The optional ID or an array of IDs as root folder. If null, the current item is taken as root folder

Tags
access

public

Return values
array<string|int, mixed>

the children IDs of the item

getCometTemplateForPageID()

Returns id of the comet page template for a given pageID

public getCometTemplateForPageID(mixed $pageID) : mixed
Parameters
$pageID : mixed

page id

Tags
access

public

Return values
mixed

comet template id

getCometTemplates()

Returns all selected comet page templates for this document

public getCometTemplates() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

the comet template ids

getCometTemplatesForWhiteboarding()

Returns visible templates for all pages in document

public getCometTemplatesForWhiteboarding() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

pageID => (array) comet template

getConfigurationClassId()

Returns the root configuration class of the item

public getConfigurationClassId() : int
Tags
access

public

Return values
int

the root configuration class id of the item.

getConfigurationClassIds()

Returns the configuration class ids of the item.

public getConfigurationClassIds([bool $bAllowInheritance = true ]) : array<string|int, mixed>
Parameters
$bAllowInheritance : bool = true

Whether the value can be inherited from its parents if it is not defined in the item

Tags
access

public

Return values
array<string|int, mixed>

with the configuration class ids.

getConfigurationField()

Returns the CSItemApiField object for the current items configuration (Base Field)

public getConfigurationField() : CSItemApiField
Tags
Return values
CSItemApiField

the Field representing the configuration

getContextFolder()

Returns the mam path of a context folder (object folder) for the current item (@see CSMam::getContextFolder())

public getContextFolder() : string
Tags
access

public

Return values
string

the path of the requested context folder

getCreatedAt()

Return creation date of the item

public getCreatedAt([string $format = NULL ]) : string
Parameters
$format : string = NULL

date format php.net/date

Tags
access

public

Return values
string

formatted creation date

getCrossReferencedViews()

Returns all CSItemApiViews referencing this item

public getCrossReferencedViews([bool $returnOnlyIds = false ]) : array<string|int, mixed>
Parameters
$returnOnlyIds : bool = false

whether the views or only the IDs should be returned

Tags
access

public

Return values
array<string|int, mixed>

either an array of IDs or of CSItemApiViews objects

getCSImage()

Returns a item image as a cs:image CSTag

public getCSImage(int $attrID[, array<string|int, mixed> $params = array() ][, string $wrapHTML1 = null ][, string $wrapHTML2 = null ]) : string
Parameters
$attrID : int

the id of the attribute which contains the image, or directly the value as a json string

$params : array<string|int, mixed> = array()

additional parameter for the cs:image CSTag

$wrapHTML1 : string = null

HTML code which will be put before the cs:image CSTag

$wrapHTML2 : string = null

HTML code which will be put after the cs:image CSTag

Tags
access

public

Return values
string

a item image as a cs:image CSTag

getCTime()

Return the creation date for the current file.

public getCTime([string $format = null ]) : string
Parameters
$format : string = null

the format of the date. It can be any format which is available in the php date() method call.

Tags
access

public

Return values
string

the creation date of the of the file.

getDataCTime()

Return creation date of CONTENTSERV data entry for current file

public getDataCTime([string $format = null ]) : string
Parameters
$format : string = null

date format php.net/date

Tags
access

public

Return values
string

formatted creation date

getDataMTime()

Return modification date of CONTENTSERV data entry for current file

public getDataMTime([string $format = null ]) : string
Parameters
$format : string = null

date format php.net/date

Tags
access

public

Return values
string

formatted creation date

getDefaultLanguageID()

Returns the ID of the default language from the current session.

public getDefaultLanguageID() : int
Tags
access

public

Return values
int

the default language for this item

getDefaultPageTemplateForPageSide()

returns the default page template for the passed page side

public getDefaultPageTemplateForPageSide(int $iPageSide) : CSCometPageTemplate
Parameters
$iPageSide : int

the page side for which the default page template should be returned. This can be one of the following constants:

CSICM_PAGE_SIDE_LEFT CSICM_PAGE_SIDE_RIGHT CSICM_PAGE_SIDE_SINGLE

Tags
access

public

Return values
CSCometPageTemplate

the default page template if one exists, otherwise null. This can happen if

  • no default template is defined
  • the defined default template can not be found in the database
  • the default template does not match the passed page side and there is no opposite template defined

getDefaultTemplateID()

Returns the default comet page template id set in the item editor

public getDefaultTemplateID() : int
Tags
access

public

Return values
int

the default template id

getDocumentHeight()

Returns the height of the InDesign document in centimeters.

public getDocumentHeight() : float
Tags
access

public

Return values
float

The height in cm.

getDocumentLanguage()

returns the document language for the current document

public getDocumentLanguage() : object
Tags
access

public

Return values
object

the language as CSLanguage-object if value is set otherwise null

getDocumentLanguageID()

Returns the id of the currently set document language

public getDocumentLanguageID() : int
Tags
access

public

Return values
int

the language id

Returns a HTML Link to a document of the product

public getDocumentLink(int $attrID, mixed $text[, array<string|int, mixed> $params = array() ][, string $wrapHTML1 = null ][, string $wrapHTML2 = null ], int $filesizeprec[, mixed $decseperator = '.' ]) : string
Parameters
$attrID : int

the id of the attribute which contains the document

$text : mixed

the label of the link

$params : array<string|int, mixed> = array()

additional parameter for the Tag

$wrapHTML1 : string = null

HTML code which will be put before the Tag

$wrapHTML2 : string = null

HTML code which will be put after the Tag

$filesizeprec : int

the number of decimals of the filesize

$decseperator : mixed = '.'

this char will be used as decimal seperator in the filesize

Tags
access

public

Return values
string

getDocumentSize()

Returns the size name of the InDesign document (like "DIN A4").

public getDocumentSize() : string
Tags
access

public

Return values
string

The descriptive name of the document size.

getDocumentTypeAreaHeight()

Returns the type area height of the InDesign document in centimeters.

public getDocumentTypeAreaHeight() : float
Tags
access

public

Return values
float

The type area height in cm.

getDocumentTypeAreaWidth()

Returns the type area width of the InDesign document in centimeters.

public getDocumentTypeAreaWidth() : float
Tags
access

public

Return values
float

The type area width in cm.

getDocumentWidth()

Returns the width of the InDesign document in centimeters.

public getDocumentWidth() : float
Tags
access

public

Return values
float

The width in cm.

Returns the URL of the link, where the user can download the file.

public getDownloadLink([bool $bDownloadAsZip = false ][, string $sBase = 'relative' ][, string $sDownloadFileName = null ][, bool $bDownloadAsMacBinary = false ][, string $sDownloadContext = '' ]) : string
Parameters
$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

getDriverFile()

Returns the MAM driver file API object of the file.

public getDriverFile([bool $bForWriting = false ][, bool $bCreateVersionIfMissing = false ]) : CSMamDriverFile

The API object provides information of the original or the version file if the original file is not allowed to be modified.

Parameters
$bForWriting : bool = false

Whether the path should be returned, the file should be written to or it should be loaded from

$bCreateVersionIfMissing : bool = false

Whether the original file should be copied, if $bForWriting is activated and the temporary file is not available

Tags
Return values
CSMamDriverFile

The MAM driver file API object of the current file.

getDuplicatesByMD5()

Returns the duplicate files with the same MD5 hash of the current file.

public getDuplicatesByMD5() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

An array in the structure e.g. array(ID => CSMamFile Object) If the file has no MD5 hash, the result is an empty array.

getEditorURL()

Returns the URL to the backend editor for this Item

public getEditorURL([bool $checkout = false ]) : string
Parameters
$checkout : bool = false

whether the document should be checked out for the current user

Tags
access

public

Return values
string

the relative URL to the backend editor

getEXIF()

Retrieve EXIF informations for this file

public getEXIF([string $key = null ]) : mixed
Parameters
$key : string = null

the key of the exif value. If empty all EXIF data is returned.

Tags
access

public

Return values
mixed

the EXIF data

getExternalKey()

Returns the external key of the item

public getExternalKey() : string
Tags
access

public

Return values
string

external key of the item

getField()

Returns a specific field of an item

public getField(string $identifier) : CSItemApiField

If you pass the label of the field as identifier be aware that labels are not unique and the first field with that label will be returned.

Parameters
$identifier : string

ID or label of the field

Tags
access

public

Return values
CSItemApiField

object

getFieldIDs()

Returns all the FieldsID of the item without the base field

public getFieldIDs() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

array of CSItemField IDs with the children of the base field

getFields()

Returns all the fields of the item without the base field

public getFields() : array<string|int, CSItemApiField>
Tags
access

public

Return values
array<string|int, CSItemApiField>

array of CSItemFields objects with the children of the base field

getFieldStateID()

Gets the Workflow State for a given field

public getFieldStateID(int $configurationID[, int $languageID = null ], int $subType) : int
Parameters
$configurationID : int

the field for which the State is requested

$languageID : int = null

the language for which the State is requested

$subType : int

this parameter can define the optional subtype of the value

Tags
access

public

Return values
int

the StateID of the Workflow

getFileBaseName()

Obtain filename without the file suffix

public getFileBaseName([bool $stripType = false ]) : string
Parameters
$stripType : bool = false

whether the filetype should be removed

Tags
access

public

Return values
string

the name of the file

getFileContent()

Returns the file content of the MamFile.

public getFileContent() : string
Tags
Return values
string

the content of the file

getFileName()

Obtain the FileName without directories

public getFileName() : string
Tags
access

public

Return values
string

the FileName of the CSMamFile

getFilePath()

Returns the Path of the file

public getFilePath() : string
Tags
access

public

Return values
string

Path of the file

getFiles()

Obtain list of CSMamFile objects contained in current folder

public getFiles([bool $includeFiles = true ][, bool $includeFolders = false ][, bool $returnOnlyIDs = false ]) : array<string|int, CSMamFile>
Parameters
$includeFiles : bool = true

list files

$includeFolders : bool = false

list folders

$returnOnlyIDs : bool = false

whether CSMamFile objects or only IDs should be returned

Tags
access

public

Return values
array<string|int, CSMamFile>

List of CSMamFile objects

getFileSize()

Retrieve formatted file size information. Returns "0" for folders.

public getFileSize([bool $bFormatHumanReadable = true ]) : string
Parameters
$bFormatHumanReadable : bool = true

whether the size is returned in bytes (false) or in a human readable form (true)

Tags
access

public

Return values
string

the file size

getFileType()

Obtain file type suffix, e.g. "jpg"

public getFileType() : string
Tags
access

public

Return values
string

file suffix

getFolder()

Returns the folder of the CSMamFile

public getFolder() : CSMamFile
Tags
access

public

Return values
CSMamFile

the parent of the file

getFonts()

Returns the name of the fonts in the InDesign document.

public getFonts() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

The font names embedded in the document as strings.

getFormattedValue()

Gets a formatted value of an item.

public getFormattedValue(string $mIdentifier[, int $iLanguageId = null ][, bool $bAllowInheritance = true ], int $iSubType[, string $mMedium = '' ][, int $iContextId = null ]) : mixed

If you pass the label of the field as identifier be aware that labels are not unique and the value of the first field with that label will be returned.

Parameters
$mIdentifier : string

Field ID or field label of the value to get

$iLanguageId : int = null

The requested languageID of the identifier or null if the current default language should be used

$bAllowInheritance : bool = true

Whether the value can be inherited from its parents if it is not defined in the item

$iSubType : int

This parameter can define the optional subtype of the value

$mMedium : string = ''

An alternative medium the value should be formatted for ( '' for CSItemMedium::DEFAULT or CSItemMedium::TEXT for 'TEXT' are supported as standard). This parameter is passed to the CSTypes getValue() method. One of the CSItemMedium constants

$iContextId : int = null

The context id for which the value should be retrieved

Tags
deprecated

Deprecated since CS21.5, use setValueForConfig() instead.

access

public

Return values
mixed

The formatted value as string

getFormattedValues()

Loads some values directly from the database and formats them automatically.

public getFormattedValues([array<string|int, mixed> $configurationIds = array() ][, mixed $depth = TRUE ][, bool $allowInheritance = TRUE ][, bool $addFolders = TRUE ][, array<string|int, mixed> $rootIds = NULL ][, mixed $languageId = NULL ][, array<string|int, mixed> $sortFields = array() ][, bool $groupByLanguageID = FALSE ][, bool $checkRights = FALSE ][, string $medium = '' ][, bool $returnSubTypes = TRUE ][, array<string|int, mixed> $additionalOptions = array() ][, int $iContextId = null ]) : array<string|int, mixed>

This is a performant method to receive MULTIPLE values at once.

Parameters
$configurationIds : array<string|int, mixed> = array()

the IDs for the configurations. Its values might either be integers describing configurationIDs or the standard fields like 'Label', 'StateID', 'WorkflowID'. If this value is null then all fields are fetched

$depth : mixed = TRUE

the depth of searching children. Either an integer or true to get the values of all children

$allowInheritance : bool = TRUE

whether the result from the parent node should be returned if no value is found for an item

$addFolders : bool = TRUE

whether values from folders should also be returned

$rootIds : array<string|int, mixed> = NULL

the optional rootIds which should be searched, otherwise the current ID is used as rootId.

$languageId : mixed = NULL

the languageId which should be searched as integer or an array of language ids, which should be searched. The array should only be used together with $groupByLanguageID.

$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)

$groupByLanguageID : bool = FALSE

whether the result is a four dimensional array with itemId, configurationId, languageId and value.

$checkRights : bool = FALSE

wether the visibility of items and attributes should be checked

$medium : string = ''

the medium the values should be formatted for (e.g. CSItemMedium::TRANSLATIONMANAGER)

$returnSubTypes : bool = TRUE

whether SubTypes should be returned

$additionalOptions : array<string|int, mixed> = array()

further settings

$iContextId : int = null

The context id for which the values should be retrieved

Tags
deprecated

Deprecated since CS21.5, use getValuesForConfig() instead.

access

public

Return values
array<string|int, mixed>

a threedimensional array with as first key the itemId or itemId_subtype, if the subtype >= 1 as second the configurationId and as value the inherited value

getGrid()

Returns an value from an appropriate field as CSGrid object

public getGrid(string $iIdentifier[, int $iLanguageID = NULL ][, bool $bAllowInheritance = TRUE ], int $iSubType) : CSGrid
Parameters
$iIdentifier : string

Field ID or field label of the value to get

$iLanguageID : int = NULL

The requested languageID of the identifier or null if the current default language should be used

$bAllowInheritance : bool = TRUE

Whether the value can be inherited from its parents if it is not defined in the item

$iSubType : int

The fields subtype

Tags
Return values
CSGrid

The value of the field as CSGrid

getIcon()

Retrieve image URL of an icon representing the current file

public getIcon([int $sizeType = false ]) : string
Parameters
$sizeType : int = false

if set to true or 1 a larger icon will be used if available, if set to 2 a huge icon

Tags
access

public

Return values
string

icon URL

getID()

Returns the ID of the item

public getID() : int
Tags
access

public

Return values
int

the ID of the item

getImage()

Returns the path of the image in the ImageServer.

public getImage([int $width = null ][, int $height = null ][, int $format = null ][, int $colorspace = null ][, int $resolution = null ][, bool $useMaster = true ][, string $additionalParams = '' ]) : string
Parameters
$width : int = null

target image width

$height : int = null

target image height

$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

$useMaster : bool = true

whether the master image or the original image should be used for transformation

$additionalParams : string = ''

additional parameters which should be appended to the ImageServer URL

Tags
deprecated

since PXC24.5: This method is no longer supported, please use the method "getImageFile"

Return values
string

the URL of the CSMamFile in the ImageServer

getImageColorspace()

Returns the colorspace of the file, if it is an image.

public getImageColorspace() : string
Tags
Return values
string

the colorspace of the image (rgb, cmyk, ...)

getImageFile()

Returns the file stream of the image in the ImageServer.

public getImageFile([int $iWidth = null ][, int $iHeight = null ][, string $sFormat = null ][, string $sColorSpace = null ][, int $iResolution = null ][, bool $bUseMaster = true ][, string $aAdditionalParams = '' ]) : CSFileStream|null
Parameters
$iWidth : int = null

The target width of the image.

$iHeight : int = null

The target height of the image.

$sFormat : string = null

Target image format (jpg, gif, ...)

$sColorSpace : string = null

Target image colorspace (rgb, cmyk)

$iResolution : int = null

Resolution in dpi of the target image

$bUseMaster : bool = true

Whether the master image or the original image should be used for transformation

$aAdditionalParams : string = ''

Additional parameters which should be appended to the ImageServer URL

Tags
throws
CSMamException
Return values
CSFileStream|null

getImageHeight()

Returns the height of the file in pixel, if it is an image.

public getImageHeight() : int
Tags
Return values
int

the height of the image

Returns the file links to images used in the indesign document as array with relative file links for each image in the InDesign document

public getImageLinks(int $includeLevel) : array<string|int, mixed>
Parameters
$includeLevel : int

how many links to include, 0 for valid mam files only, 1 for valid mam and existing but non valid mam files, 2 for all files including non valid mam and non existing files

Tags
access

public

Return values
array<string|int, mixed>

with images links for each image

getImageResolution()

Returns the resolution of the file in dpi, if it is an image.

public getImageResolution() : int
Tags
Return values
int

the resolution of the image

getImageServerID()

Returns the ID which must be passed to the ImageServer URL

public getImageServerID() : string
Tags
Return values
string

the ImageServerID

getImageServerURL()

Returns the URL of the ImageServer, which displays this item (or preview image of this item).

public getImageServerURL([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 $additionalParams = '' ]) : string
Parameters
$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

$additionalParams : string = ''

additional parameters which should be appended to the ImageServer URL

Tags
Return values
string

the URL of the CSMamFile in the ImageServer representing the current object or its preview

getImageServerURLForPreset()

Returns the URL of the ImageServer, which displays this file, based on the passed preset.

public getImageServerURLForPreset(CSMamExportPreset|int $preset[, string $base = 'relative' ]) : string
Parameters
$preset : CSMamExportPreset|int

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
throws
CSMamException
Return values
string

the URL of the CSMamFile in the ImageServer

getImageWidth()

Returns the width of the file in pixel, if it is an image.

public getImageWidth() : int
Tags
Return values
int

the width of the image

getIPTC()

Retrieve IPTC informations for this file

public getIPTC([string $key = null ]) : mixed
Parameters
$key : string = null

the key of the exif value. If empty all IPTC data are returned.

Tags
access

public

Return values
mixed

the IPTC data

getItem()

Returns the Item Record which corresponds to the CSItemApiItem object

public getItem() : Item
Tags
access

public

Return values
Item

the Record of this object

getItemOwner()

Returns the UserID of the owner of the item

public getItemOwner() : int
Tags
access

public

Return values
int

the ID of the User or 0

getItemTemplatesByPageID()

Returns array of CSCometTemplate for a given pageID

public getItemTemplatesByPageID(int $pageID) : array<string|int, CSCometItemTemplate>
Parameters
$pageID : int

page id

Tags
access

public

Return values
array<string|int, CSCometItemTemplate>

getItemTemplatesBySpreadID()

Returns a merged array of CSCometTemplate for a given spreadID

public getItemTemplatesBySpreadID(int $spreadID) : array<string|int, mixed>
Parameters
$spreadID : int

spread id

Tags
access

public

Return values
array<string|int, mixed>

CSCometTemplate

getKeywords()

Returns the keywords defined for the current file

public getKeywords([bool $allowInheritage = true ][, bool $returnCSKeywordObjects = true ]) : array<string|int, mixed>
Parameters
$allowInheritage : bool = true

whether also inherited keywords from parent items should be returned when inheritage is enabled for the item in the options.

$returnCSKeywordObjects : bool = true

whether CSKeyword objects will be returned or the keywords will be returned as strings

Tags
access

public

Return values
array<string|int, mixed>

an array of all keywords as objects

getLabel()

Returns the label of the item

public getLabel([mixed $bGenerateDefaultLabel = false ]) : string
Parameters
$bGenerateDefaultLabel : mixed = false
Tags
access

public

Return values
string

label of the item

getLabelPath()

Returns an array with the labels of an item.

public getLabelPath([bool $bIncludeSelf = FALSE ][, int $iLanguageId = NULL ]) : array<string|int, string>

The array is sorted from the oldest to the youngest ancestor.

Parameters
$bIncludeSelf : bool = FALSE

Whether the current item's label should be included in the list.

$iLanguageId : int = NULL

The ID of the language for which the labels should be retrieved.

Tags
access

public

Return values
array<string|int, string>

An array of the labels path of the item.

getLayers()

Returns the name of the layers in the InDesign document.

public getLayers() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

The layers in the document as strings.

getLinkedFile()

Returns the file a MamFile is linked to

public getLinkedFile() : CSMamFile
Tags
access

public

Return values
CSMamFile

a CSMamFile representing the target of the link or the file itself, if it is not linked

getLocalFilesystemPath()

Returns the path of the file in the local filesystem where the file can be read from or should be written to If the path for reading is requested and the original file is not accessible through the local filesystem a copy is downloaded and its path is returned

public getLocalFilesystemPath([bool $forWriting = false ][, bool $copyIfMissing = false ][, bool $returnRelativePath = false ]) : string
Parameters
$forWriting : bool = false

whether the path should be returned, the file should be written to or it should be loaded from

$copyIfMissing : bool = false

whether the original file should be copied, if $forWriting is activated and the temporary file is not available

$returnRelativePath : bool = false

whether to return the relative or absolute path to the desired file

Tags
access

public

deprecated

since CS24.0: This method is no longer supported, please use the method "getDriverFile"

Return values
string

the absolute path of the file in the local filesystem where it should be loaded from or written to

getLockUser()

returns the user object for the user id the file has been locked for

public getLockUser() : CSUser
Tags
access

public

Return values
CSUser

the user object

getMamPath()

Returns the MamPath of the file

public getMamPath() : string
Tags
access

public

Return values
string

the MamPath of the file

getMasterDimensions()

Returns the pixel dimensions of the master image of a given MAM image file.

public getMasterDimensions() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

A size structure, containing the pixel dimensions of the master image. If the master dimensions cannot be determined, the result is NULL.

getMasterPreviewCacheFile()

Returns the master preview cache file to create / embed previews from / in webpages or other applications.

public getMasterPreviewCacheFile(int $iWidth, int $iHeight[, string $sFileType = '' ]) : CSMamVolumeCacheFile
Parameters
$iWidth : int

The optional "width" parameter to define the corresponding preview cache file for the given width.

$iHeight : int

The optional "height" parameter to define the corresponding preview cache file for the given height.

$sFileType : string = ''

The target file type of the master preview cache file.

Tags
Return values
CSMamVolumeCacheFile

getMasterPreviewPath()

Returns the path of the master preview in the local filesystem, to create / embed previews from / in webpages or other applications.

public getMasterPreviewPath([bool $bForceWebImage = true ][, string $sGeometry = '' ]) : string
Parameters
$bForceWebImage : bool = true

If set to TRUE, the resulting path will point to a master web image (jpg or gif), which could be embedded in webpages. If set to FALSE, the path will point to a type-specific master file (pdf, jpg, ...), which can be embedded in other applications and may contain OPI information.

$sGeometry : string = ''

The optional geometry the file should have ("[WIDTH]x[HEIGHT]"). If the Parameter is omitted or consists of an empty string, the master image is selected.

Tags
deprecated

since PXC24.0: This method is no longer supported, please use "getMasterPreviewCacheFile()".

Return values
string

The path of the requested master preview file.

getMetaData()

Returns object of CSFileMetadata.

public getMetaData(int $iType) : CSFileMetadata
Parameters
$iType : int

The Metadata Type (@see CSMetaData constants)

Tags
Return values
CSFileMetadata

getMetaDataTypes()

Returns the supported meta types for the current class.

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

getMTime()

Return the date of last change on the current file.

public getMTime([string $format = null ]) : string
Parameters
$format : string = null

the format of the date. It can be any format which is available in the php date() method call.

Tags
access

public

Return values
string

the date of the last modification of the file.

getNewInstance()

Returns a new instance of the current object for a new ID

public getNewInstance(mixed $ID) : CSItemApiItem
Parameters
$ID : mixed

the ID in form of an integer or as an Item

Tags
access

public

Return values
CSItemApiItem

new instance of the current object for a new ID

getOwner()

Returns the UserID of the owner of the item, if it is checked out.

public getOwner() : int
Tags
access

public

Return values
int

the ID of the User or 0

getPageCount()

Returns the number of pages in the InDesign document.

public getPageCount() : int
Tags
access

public

Return values
int

The number of pages.

getPageIdByIndex()

Returns the INDD ID of a page using its page index.

public getPageIdByIndex(int $iPageIndex) : int
Parameters
$iPageIndex : int

The zero-based index of the page whose ID should be determined.

Tags
access

public

Return values
int

The ID of the page with the specified index. If no page exists for the given index, the return value is NULL.

getPageIds()

Returns an array of all page IDs, sorted by their page index, which have been obtained from the INDD master template.

public getPageIds() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

A numerically indexed array, containing the page IDs. The numeric key designates the (zero-based) page index.

getPageIndexById()

Returns the index of a page using its INDD page ID.

public getPageIndexById(int $iPageId) : int
Parameters
$iPageId : int

The ID of the page whose index should be determined.

Tags
access

public

Return values
int

The index of the page with the specified ID, starting with zero. If no page exists for the given ID, the return value is NULL.

getPageItemsMapping()

Returns a list of planned products for the whiteboard file, grouped by the INDD page ID on which the items reside.

public getPageItemsMapping() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

An associative array, where the keys denote the INDD's page ID. The value for each page ID is an array of product reference objects, where each reference object points to a product which has been planned on that page.

getPageNames()

Returns the page names (also known as paginas or folios) of all pages in the InDesign document.

public getPageNames() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

An array with page indices as the key and the page names (a.k.a. paginas) as string values.

getPageThumb()

Provides an imageserver URL for a 72dpi full-size thumbnail of a single page in the InDesign document.

public getPageThumb(string $sPageName, mixed $iWidth, mixed $iHeight) : string
Parameters
$sPageName : string

The name of the page/folio for which the thumb should be retrieved.

$iWidth : mixed
$iHeight : mixed
Tags
access

public

Return values
string

The imageserver URL to the page image.

getPageThumbAsImageServerUrl()

Provides a single thumbnail as ImageServer URL for a given page name and offers resizing and reshaping.

public getPageThumbAsImageServerUrl(string $sPageName[, int $iWidth = null ][, int $iHeight = null ][, string $sFormat = null ][, string $sColorspace = null ][, string $sCrop = null ][, string $sFlip = null ][, string $sFlop = null ]) : string
Parameters
$sPageName : string

The name of the page as returned by the method.

$iWidth : int = null

The width of the screenshot in pixels. The height will be calculated proportionally if omitted.

$iHeight : int = null

The height of the screenshot in pixels. The width will be calculated proportionally if omitted.

$sFormat : string = null

The file format of the screenshot like jpg (default), pdf, gif, eps, tiff, png

$sColorspace : string = null

The colorspace of the screenshot, allowed values are rgb (default), cmyk or grayscale

$sCrop : string = null

A comma-separated list of integer values with left, top, width, height of the crop area relative to the original image

$sFlip : string = null

Mirrors the image vertically.

$sFlop : string = null

Mirrors the image horizontally.

Tags
access

public

Return values
string

The ImageServer URL.

getPageThumbs()

Returns an array of page thumbnails with imageserver URLs for each page in the InDesign document.

public getPageThumbs(int $iWidth, int $iHeight) : array<string|int, mixed>
Parameters
$iWidth : int
$iHeight : int
Tags
access

public

Return values
array<string|int, mixed>

An array with the page name as the keys and imageserver URL as the value for each page.

getPageThumbsAsImageServerUrls()

Provides all page thumbnails as ImageServer URLs and offers resizing and reshaping.

public getPageThumbsAsImageServerUrls([int $width = null ][, int $height = null ][, string $format = null ][, string $colorspace = null ][, string $crop = null ][, string $flip = null ][, string $flop = null ]) : array<string|int, mixed>
Parameters
$width : int = null

The width of the screenshot in pixels. The height will be calculated proportionally if omitted.

$height : int = null

The height of the screenshot in pixels. The width will be calculated proportionally if omitted.

$format : string = null

The file format of the screenshot like jpg (default), pdf, gif, eps, tiff, png

$colorspace : string = null

the colorspace of the screenshot, allowed values are rgb (default), cmyk or grayscale

$crop : string = null

comma-separated list of integer values with left, top, width, height of the crop area relative to the original image

$flip : string = null

mirrors the image vertically

$flop : string = null

mirrors the image horizontally

Tags
access

public

Return values
array<string|int, mixed>

with PageNames as keys and Image Server URLs as values for each page thumbnail.

getPageThumbsMapping()

Returns a list of page thumb imageserver URLs for the whiteboard file, grouped by the INDD page ID.

public getPageThumbsMapping([mixed $bUseTemplateThumbs = FALSE ]) : array<string|int, mixed>
Parameters
$bUseTemplateThumbs : mixed = FALSE
Tags
access

public

Return values
array<string|int, mixed>

An associative array, where the keys denote the INDD's page ID. The value for each page ID is an imageserver URL, which points to the page preview thumbnail for that page.

getPath()

Returns an array with the ancestors of an item

public getPath([bool $returnOnlyIDs = false ]) : array<string|int, mixed>

The array is sorted from the oldest to the youngest ancestor

Parameters
$returnOnlyIDs : bool = false

whether the path should be returned as IDs (true) or as Item objects (false)

Tags
access

public

Return values
array<string|int, mixed>

the ancestors of the item

getPDF()

Generates a PDF document from the whiteboard document's sketch information.

public getPDF([array<string|int, mixed> $aExportOptions = array() ]) : string
Parameters
$aExportOptions : array<string|int, mixed> = array()

An associative array, where the keys designate the PDF export options (specified by using the PDF_EXPORTOPT_* constants).

Tags
throws
CSMamException

This will indicate errors on the Java side of the PDF generation.

Return values
string

The path of the generated PDF file, relative to the ADMIN directory. In case the Zend Java Bridge is not installed properly and thus no PDF can be generated, an empty string is returned.

getPlacedListForDTP()

Returns a DTP Placed List

public getPlacedListForDTP([int $iLanguageId = null ]) : mixed
Parameters
$iLanguageId : int = null

Unused; reserved for future use.

Tags
deprecated

Deprecated since CS22.0, no longer supported (thus, no alternative).

Return values
mixed

getPlannedListForDTP()

Returns a DTP Planned List

public getPlannedListForDTP([int $iLanguageId = null ]) : mixed
Parameters
$iLanguageId : int = null

The document language for that the list should be retrieved.

Tags
deprecated

Deprecated since CS22.0, no longer supported (thus, no alternative).

Return values
mixed

getPlannedPageNames()

Returns the planned page names (for example in the publication manager) of all pages in the document.

public getPlannedPageNames() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

An array with page indices as the key and the planned page names (a.k.a. paginas) as string values.

getPredecessor()

Returns the Predecessor of an CSItemApiItem

public getPredecessor() : CSItemApiItem

The Predecessor is the CSItemApiItem that is pointed at through the CopyOf Attribute. The CopyOf Attribute is automatically set upon duplicate operations and points to the item, that was duplicated.

Tags
access

public

Return values
CSItemApiItem

the predecessor of the item

getPreviewFields()

Returns fields that were marked as preview fields

public getPreviewFields([bool $bIncludeTextFields = true ][, bool $bIncludeImageFields = true ][, bool $bReturnOnlyFieldsFromCurrentItem = false ]) : array<string|int, CSItemApiField>
Parameters
$bIncludeTextFields : bool = true

If true also Text fields are returned

$bIncludeImageFields : bool = true

If true also Images fields are returned

$bReturnOnlyFieldsFromCurrentItem : bool = false

If true then only fields for the current item should be returned.

Tags
access

public

Return values
array<string|int, CSItemApiField>

array of fields that are marked as preview fields

getPreviewImage()

Returns the path of the preview image in the ImageServer.

public getPreviewImage([int $width = null ][, int $height = null ][, int $format = null ][, int $colorspace = null ][, int $resolution = null ]) : string

This function is only a placeholder, please use getPreviewImageURL method instead.

Parameters
$width : int = null

target image width

$height : int = null

target image height

$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

Tags
access

public

see
getPreviewImageURL
Return values
string

the URL of the CSMamFile in the ImageServer

getPreviewImageURL()

Returns the path of the preview image in the ImageServer.

public getPreviewImageURL([int $width = null ][, int $height = null ][, int $format = null ][, int $colorspace = null ][, int $resolution = null ][, string $base = 'relative' ]) : string
Parameters
$width : int = null

target image width

$height : int = null

target image height

$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

$base : string = 'relative'

the URL building method as in @see CS::getLinkToResource()

Tags
access

public

Return values
string

the URL of the CSMamFile in the ImageServer

getRating()

Retrieve item rating api

public getRating() : object
Tags
access

public

Return values
object

CSItemRating instance initialized with the current Item API

getReferenceConfigurations()

Returns all fields of the configuration (a.k.a. class) associated with the references for an attribute of an item.

public getReferenceConfigurations(mixed $mRefSourceAttr[, bool $bIncludeContainerConfig = FALSE ]) : array<string|int, mixed>
Parameters
$mRefSourceAttr : mixed

The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.

$bIncludeContainerConfig : bool = FALSE

If set to TRUE, the configuration link containing all the fields (a.k.a. parent configuration) is included in the results.

Tags
throws
CSItemException
access

public

Return values
array<string|int, mixed>

An array of item configurations. These are the attributes attached to the references stored in the attribute designated by $mRefSourceAttr. Returns an empty array if no configuration has been defined for the reference attribute.

getReferencedItem()

Returns the first referenced item for a reference CSType Attribute

public getReferencedItem(int $attrID[, int $languageID = NULL ]) : CSItemApiItem
Parameters
$attrID : int

the id of the attribute which contains the references

$languageID : int = NULL

the language of the requested references

Tags
Return values
CSItemApiItem

or NULL if no target item is available

getReferencedItemList()

Returns an array of all item objects that are referenced in the current document.

public getReferencedItemList([int $iLanguageId = NULL ]) : CSItemApiReferenceList
Parameters
$iLanguageId : int = NULL

The language ID of the references.

Tags
access

public

Return values
CSItemApiReferenceList

a list of products associated with the current document.

getReferencedItemsValues()

Returns the attribute values that are associated with the current document's item references.

public getReferencedItemsValues([mixed $mRequestedAttrKeys = null ][, bool $bShowInherited = true ][, int $iLanguageId = null ]) : array<string|int, mixed>
Parameters
$mRequestedAttrKeys : mixed = null

A string, int or an array containing the ID(s)/label(s) of the attributes to retrieve from the references. If set to NULL, all available attributes will be retrieved.

$bShowInherited : bool = true

Set to TRUE if inherited references should be added for additive inheritance.

$iLanguageId : int = null

The language ID of the references.

Tags
throws
CSItemException
access

public

Return values
array<string|int, mixed>

A two-dimensional array containing the reference attribute values. The first dimension designates the ReferenceIDs of the reference target item(s), the second dimension is indexed by the original $mRequestedAttrKeys.

getReferenceList()

Returns the reference list for an attribute of the item

public getReferenceList(int|CSItemApiField|Itemconfiguration $attrID[, int $languageID = null ], mixed $iContextId) : CSItemApiReferenceList
Parameters
$attrID : int|CSItemApiField|Itemconfiguration

The id of the attribute which contains the references or a field object

$languageID : int = null

The language of the requested references

$iContextId : mixed
Tags
Return values
CSItemApiReferenceList

getReferences()

Returns the references for an attribute of the item It is recommended to use CSItemApiReferenceList API instead of this method. (getReferenceList method)

public getReferences(int $attrID[, mixed $details = false ][, bool $showInherited = true ][, int $languageID = null ], mixed $iContextId) : array<string|int, mixed>
Parameters
$attrID : int

the id of the attribute which contains the reference

$details : mixed = false

if set to true the result is returned as an array {'References' => { 'Reference' => $referenceObject, 'Multiplicity' => $multiplicity, 'Data' => $jsonObject), ...}, 'DeletedIDs' => $idList, 'InheritedIDs' => $idList}. If it is set to false only the $referenceObject is returned. If set to 'IDList' only the IDs are returned.

$showInherited : bool = true

if inherited references should be added for additive inheritance

$languageID : int = null

the language of the requested reference

$iContextId : mixed
Tags
see
getReferenceList
access

public

Return values
array<string|int, mixed>

an array of references either in a second array or directly as objects

getReferencesValues()

Returns the additional values that are associated with the references for an attribute of an item.

public getReferencesValues(mixed $mRefSourceAttr[, mixed $mRequestedAttrKeys = NULL ][, bool $bShowInherited = TRUE ][, int $iLanguageId = NULL ]) : array<string|int, mixed>
Parameters
$mRefSourceAttr : mixed

The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.

$mRequestedAttrKeys : mixed = NULL

A string, int or an array containing the ID(s)/label(s) of the attributes to retrieve from the references. If set to NULL, all available attributes will be retrieved. If a second or third target with the given ID is existing, it may be accessed using a suffix _[COUNTER], e.g. 11, 11_2, 11_3, ...

$bShowInherited : bool = TRUE

Set to TRUE if inherited references should be added for additive inheritance.

$iLanguageId : int = NULL

The language of the references.

Tags
throws
CSItemException
access

public

Return values
array<string|int, mixed>

A two-dimensional array containing the reference attribute values. The first dimension designates the IDs of the reference target item(s), the second dimension is indexed by the original $mRequestedAttrKeys.

getReferenceValue()

Returns a specific additional value that is associated with a specific reference for an attribute of an item.

public getReferenceValue(mixed $mRefSourceAttr, int $iRefTargetItemId, mixed $mRequestedAttrKey[, bool $bShowInherited = TRUE ][, int $iLanguageId = NULL ]) : string
Parameters
$mRefSourceAttr : mixed

The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.

$iRefTargetItemId : int

The target ID of the referenced item that the value will be retrieved for.

$mRequestedAttrKey : mixed

A string or int containing the ID/label of the attribute to retrieve from the reference.

$bShowInherited : bool = TRUE

Set to TRUE if inherited references should be added for additive inheritance.

$iLanguageId : int = NULL

The language ID of the reference.

Tags
throws
CSItemException
access

public

Return values
string

The requested reference attribute value. Returns NULL if the requested reference attribute does not exist.

getReferenceValues()

Returns the additional values that are associated with a specific reference for an attribute of an item.

public getReferenceValues(mixed $mRefSourceAttr, int $iRefTargetItemId[, mixed $mRequestedAttrKeys = NULL ][, bool $bShowInherited = TRUE ][, int $iLanguageId = NULL ]) : array<string|int, mixed>
Parameters
$mRefSourceAttr : mixed

The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.

$iRefTargetItemId : int

The target ID of the referenced item that the values will be retrieved for. If a second or third target with the given ID is existing, it may be accessed using a suffix _[COUNTER], e.g. 11, 11_2, 11_3, ...

$mRequestedAttrKeys : mixed = NULL

A string, int or an array containing the ID(s)/label(s) of the attributes to retrieve from the references. If set to NULL, all available attributes will be retrieved.

$bShowInherited : bool = TRUE

Set to TRUE if inherited references should be added for additive inheritance.

$iLanguageId : int = NULL

The language ID of the references.

Tags
throws
CSItemException
access

public

Return values
array<string|int, mixed>

An array containing the reference attribute values, indexed by the original $mRequestedAttrKeys.

getRoles()

Returns all roles the current user has for this item

public getRoles() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

an array containing all roles in the form ID => Name

getSimpleSearchableFieldIds()

Fetches the list of simple searchable field IDs

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

getSketchItemImage()

Retrieve the image for a sketch of a given item using a fallback mechanism.

public static getSketchItemImage(CSItemApiItem $oApi) : CSMamFile
Parameters
$oApi : CSItemApiItem

The item for which the image should be displayed in the sketch.

Tags
access

public

Return values
CSMamFile

A CSMamFile object containing the desired product's image or NULL, if the product image could not be retrieved. The image is determined using a fallback mechanism, checking in the following order: (1) The default product image, if no special attribute IDs have been selected for whiteboard sketches. (2) The first image attribute, if attribute IDs have been selected for whiteboard sketches and at least one of them references an image. (3) No image, if no attribute IDs have been selected for whiteboard sketches.

getSketchItemImageUrl()

Retrieve the image URL for a sketch of a given item using a fallback mechanism.

public static getSketchItemImageUrl(CSItemApiItem $oApi) : string
Parameters
$oApi : CSItemApiItem

The item for which the image should be displayed in the sketch.

Tags
access

public

Return values
string

An absolute, internal URL referring to the desired product's image. This is determined using a fallback mechanism, checking in the following order: (1) The default product image, if no special attribute IDs have been selected for whiteboard sketches. (2) The first image attribute, if attribute IDs have been selected for whiteboard sketches and at least one of them references an image. (3) An empty string, if no attribute IDs have been selected for whiteboard sketches.

getSpreadCount()

Returns the number of spreads in the InDesign document.

public getSpreadCount() : int
Tags
access

public

Return values
int

The number of spreads.

getSpreadReferences()

Returns an array with the references of spreads in the InDesign document.

public getSpreadReferences() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

containing the spreadIDs with referenced pageIDs.

getStandardFields()

Returns all the standard fields of the item and their API representation Note: As the CSItemFields are just wrappers not to be designed to display standard fields not all available methods will work for them

public getStandardFields() : array<string|int, CSItemApiField>
Tags
access

public

Return values
array<string|int, CSItemApiField>

An array where the keys are the labels and the values CSItemApiFields objects

getTable()

Gets a TableAPI-Object for a given Field ID

public getTable(string $fieldID[, int $languageID = null ]) : CSItemApiTable
Parameters
$fieldID : string

field ID or field label of the value to get

$languageID : int = null

the requested languageID of the identifier or null if the current default language should be used

Tags
throws
CSException

if no table is defined for the field

access

public

Return values
CSItemApiTable

a CSItemApiTable object for the given field

getTextFrames()

public getTextFrames() : mixed
Tags
Return values
mixed

Returns the html code for a link where one can upload a new file to the current file.

public getUploadLink([string $label = 'Upload' ][, string $onAfterUploadJs = '' ]) : string
Parameters
$label : string = 'Upload'

the label which should be displayed within the link

$onAfterUploadJs : string = ''

Parameter "event" represents the native event. Second Parameter "files" represents an array of uploaded files.

Tags
Return values
string

the html code managing the complete upload or null if uploading is not allowed in this directory

getValue()

Gets a value of an item

public getValue(string $mIdentifier[, int|null $iLanguageId = NULL ][, bool $bAllowInheritance = TRUE ][, int $iValueType = CSITEM_VALUES_UNFORMATTED ], int $iSubType[, int $iContextId = null ]) : mixed

If you pass the label of the field as identifier be aware that labels are not unique and the value of the first field with that label will be returned.

Parameters
$mIdentifier : string

Field ID or field name of the value to get.

$iLanguageId : int|null = NULL

The requested languageID of the identifier or null if the current default language should be used.

$bAllowInheritance : bool = TRUE

Whether the value can be inherited from its parents if it is not defined in the item

$iValueType : int = CSITEM_VALUES_UNFORMATTED

The CSITEM_VALUES_ type the values are formatted. Possible values are CSITEM_VALUES_UNFORMATTED, CSITEM_VALUES_FORMATTED, CSITEM_VALUES_ARRAY and CSITEM_VALUES_COMPARATOR.

$iSubType : int

This parameter can define the optional subtype of the value

$iContextId : int = null

The context id for which the value should be retrieved

Tags
deprecated

Deprecated since CS21.5, use getValueForConfig() instead.

access

public

Return values
mixed

the value either as string or as array, if the $valueType CSITEM_VALUES_ARRAY is specified

getValueAsImageURL()

Returns the URL of the ImageServer, which displays this file.

public getValueAsImageURL(string $identifier[, int $languageID = null ][, bool $allowInheritance = true ][, int $width = null ][, int $height = null ][, string $base = 'relative' ][, int $format = null ][, int $colorspace = null ][, int $resolution = null ][, bool $force = false ][, bool $useMaster = true ]) : mixed
Parameters
$identifier : string

field ID or field label of the value to get

$languageID : int = null

the requested languageID of the identifier or null if the current default language should be used

$allowInheritance : bool = true

whether the value can be inherited from its parents if it is not defined in the item

$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
access

public

Return values
mixed

the URL of the CSMamFile in the ImageServer - if it is only one as string otherwise as array of urls

getValueForConfig()

Queries the value defined by the getter object

public getValueForConfig(CSItemValueGetter $oGetter) : mixed
Parameters
$oGetter : CSItemValueGetter

The definition of the getter that identifies the value to retrieve

Tags
access

public

Return values
mixed

The value matching the getter

getValues()

Loads some values directly from the database and do not format them automatically.

public getValues([array<string|int, mixed> $configurationIds = array() ][, mixed $depth = TRUE ][, bool $allowInheritance = TRUE ][, bool $addFolders = TRUE ][, array<string|int, mixed> $rootIds = NULL ][, mixed $languageId = NULL ][, int $valueType = CSITEM_VALUES_UNFORMATTED ][, array<string|int, mixed> $sortFields = array() ][, bool $groupByLanguageID = FALSE ][, bool $checkRights = FALSE ][, string $medium = '' ][, bool $returnSubTypes = TRUE ][, array<string|int, mixed> $additionalOptions = array() ][, int $iContextId = null ]) : array<string|int, mixed>

This is a performant method to receive MULTIPLE values at once. There are three types the values can be returned as:

  • CSITEM_VALUES_UNFORMATTED (DEFAULT): The values are returned as they are stored in the database. This is the fastes call, but might sometimes be crypted.
  • CSITEM_VALUES_FORMATTED: The values are returned corresponding to the settings of their cstypes.
  • CSITEM_VALUES_ARRAY: The values are returned in form of an array, containing the unformatted and formatted value and further detail informations which are defined in the cstype.
Parameters
$configurationIds : array<string|int, mixed> = array()

the IDs for the configurations. Its values might either be integers describing configurationIDs or the standard fields like 'Label', 'StateID', 'WorkflowID'. If this value is null then all fields are fetched

$depth : mixed = TRUE

the depth of searching children. Either an integer or true to get the values of all children

$allowInheritance : bool = TRUE

whether the result from the parent node should be returned if no value is found for an item

$addFolders : bool = TRUE

whether values from folders should also be returned

$rootIds : array<string|int, mixed> = NULL

the optional rootIds which should be searched, otherwise the current ID is used as rootId.

$languageId : mixed = NULL

the languageId which should be searched as integer or an array of language ids, which should be searched. The array should only be used together with $groupByLanguageID.

$valueType : int = CSITEM_VALUES_UNFORMATTED

the CSITEM_VALUES_ type the values are formated. Possible values are CSITEM_VALUES_UNFORMATTED, CSITEM_VALUES_FORMATTED and CSITEM_VALUES_ARRAY.

$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)

$groupByLanguageID : bool = FALSE

whether the result is a four dimensional array with itemId, configurationId, languageId and value.

$checkRights : bool = FALSE

wether the visibility of items and attributes should be checked

$medium : string = ''

the medium the values should be formatted for (e.g. CSItemMedium::TRANSLATIONMANAGER)

$returnSubTypes : bool = TRUE

whether SubTypes should be returned

$additionalOptions : array<string|int, mixed> = array()

further settings

$iContextId : int = null

The context id for which the values should be retrieved

Tags
deprecated

Deprecated since CS21.5, use getValuesForConfig() instead.

access

public

Return values
array<string|int, mixed>

a threedimensional array with as first key the itemId or itemId_subtype, if the subtype>=1 as second the configurationId and as value the inherited value

getValuesForConfig()

Loads all values matching the getter definition.

public getValuesForConfig(CSItemValuesGetter $oGetter) : array<string|int, mixed>
Parameters
$oGetter : CSItemValuesGetter

The definition of the getter to retrieve the values

Tags
access

public

Return values
array<string|int, mixed>

a threedimensional array with as first key the itemId or itemId_subtype, if the subtype>=1 as second the configurationId and as value the inherited value

getVolume()

Returns the CSMamVolume of the CSMamFile

public getVolume() : CSMamVolume
Tags
access

public

Return values
CSMamVolume

the volume the file is defined in

getWebDavJSCode()

generates javascript code to open the current file in a webdav client

public getWebDavJSCode([string $objectPrefix = '' ][, string $methodName = 'openWebDavDocument' ][, mixed $includeTicketID = true ]) : string
Parameters
$objectPrefix : string = ''

a object prefix that defines where to execute the javascript code (e.g. parent) (optional)

$methodName : string = 'openWebDavDocument'

the name of the method in the CSMam.js API to be called (optional)

$includeTicketID : mixed = true
Tags
Return values
string

the JS-code for the webdav call

getWhiteboardSketchNotes()

Returns all sketch notes for a whiteboard document.

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

An array of CSWhiteboardSketchNote objects.

getWrapperItem()

Returns the cluster item of the current item API item.

public getWrapperItem() : CSItemApiWrapperItem
Tags
Return values
CSItemApiWrapperItem

getXMP()

Retrieve XMP headers for this file

public getXMP([string $key = null ]) : mixed
Parameters
$key : string = null

the key of the exif value. If empty all IPTC data are returned.

Tags
access

public

Return values
mixed

the XMP header

hasPreviewMaster()

Check for a preview master file

public hasPreviewMaster() : bool
Tags
access

public

Return values
bool

true if a master preview has been set, false otherwise

hasVersionFile()

public hasVersionFile(mixed $iVersionNr[, mixed $bCreateIfMissing = false ]) : mixed
Parameters
$iVersionNr : mixed
$bCreateIfMissing : mixed = false
Tags
Return values
mixed

importExcel()

Imports on Excel or CSV file in the format of the {@link CSItemApiItem::exportExcel} format.

public importExcel(string $fileName[, string $defaultAction = 'U' ]) : string

If the ParentID is an empty string "" in the import, this Item is used as parent

Parameters
$fileName : string

the Excel or CSV file shich should be imported

$defaultAction : string = 'U'

the _ImportAction which is used, if no ImportAction is set in the data (D: Delete, I: Insert, A: Append, U: Update, E: ExternalKey (Update or Append whether ExternalKey matches an Item))

Tags
access

public

Return values
string

the HTML representation of all changes (like in the List Imports)

isArchived()

Returns whether the file is archived

public isArchived() : bool
Tags
deprecated

since PXC24.5: The archive functionality is deprecated and should not be used anymore.

Return values
bool

whether the file is archived

isCheckedOut()

Check if the current item is checked out by the current user

public isCheckedOut([bool $isCheckedOutForCurrentUser = true ]) : bool
Parameters
$isCheckedOutForCurrentUser : bool = true

whether it is checked if the file is checked out for the current (true) or any (false) user.

Tags
access

public

Return values
bool

whether the item is checked out

isEditable()

Chechs whether the current user has the right to edit the item

public isEditable([int $languageID = null ]) : bool
Parameters
$languageID : int = null

the optional languageID to check whether the user may edit the language or any language if not set

Tags
access

public

Return values
bool

whether the user may edit this item

isFolder()

Check if the file instance is a folder.

public isFolder() : bool
Tags
access

public

Return values
bool

true/false

isForeignCheckedOut()

Check if the current item is checked out by a user who is not the current user (a/k/a "foreign check-out")

public isForeignCheckedOut() : bool
Tags
access

public

Return values
bool

TRUE, if the item is checked out by a user different from the current user, FALSE otherwise.

isImage()

Returns true if the file is an image

public isImage([mixed $onlyWebImages = false ]) : bool
Parameters
$onlyWebImages : mixed = false

if true only web compatible images are considered as image

Tags
access

public

Return values
bool

true if the file is an image

Returns true if the file is a link

public isLink([mixed $onlyWebImages = false ]) : bool
Parameters
$onlyWebImages : mixed = false
Tags
access

public

Return values
bool

true if the file is a link

isLocked()

returns whether the current file is locked

public isLocked([int $forUserID = null ]) : bool
Parameters
$forUserID : int = null

if passed the api checks whether the file is locked for the user with this id

Tags
access

public

Return values
bool

true if file is locked otherwise false

isLockedForOtherUser()

returns whether the current file is locked by another user as the current user

public isLockedForOtherUser() : bool
Tags
access

public

Return values
bool

true if file is locked for another user otherwise false

isMetaDataLicenseActivated()

Returns a boolean value whether the license for meta data is activated or not.

public isMetaDataLicenseActivated() : mixed
Tags
Return values
mixed

isMetaDataSupportActivated()

Returns a boolean whether the meta data support is activated or not.

public isMetaDataSupportActivated() : bool
Tags
Return values
bool

isPrintfile()

Defines if file is valid printfile

public isPrintfile() : bool
Tags
access

public

Return values
bool

true if the file is a whiteboard, indesign or pdf file

isRegistered()

Check if the current file instance is contained in a CSMamVolume of the MAM-Suite

public isRegistered() : bool
Tags
access

public

Return values
bool

whether the file is contained in a CSMamVolume

isVideo()

Returns true if the file is a video

public isVideo() : bool
Tags
access

public

Return values
bool

true if the file is a video

isViewable()

Checks whether the current user has the right to view the item

public isViewable([int $languageID = null ]) : bool
Parameters
$languageID : int = null

the optional languageID to check whether the user may view the language or any language if not set

Tags
access

public

Return values
bool

whether the user may view this item

isWritable()

Check for writing access on the current file instance. Not necessarily based on physical write ability of current user

public isWritable() : bool
Tags
access

public

Return values
bool

true/false

loadVersion()

Loads a specific version with a given versionNr of the current item

public loadVersion(int $versionNr) : void
Parameters
$versionNr : int

the requested versionNr of the item

Tags
access

public

Return values
void

lock()

locks a file to prevent file system perations by another users

public lock([int $forUserID = null ]) : int
Parameters
$forUserID : int = null

locks the file for the user with the specified id. If no id is supplied the current user id is used

Tags
access

public

Return values
int

the id of the user the file has beed locked for

move()

Moves the item near to the target item

public move(int $targetID[, int $position = CSITEM_POSITION_CHILD ]) : bool
Parameters
$targetID : int

ID of the targeted item

$position : int = CSITEM_POSITION_CHILD

Position relative to the target item

Tags
access

public

Return values
bool

True, if move has been executed successfully, otherwise false

readDocumentAlphaData()

Reads the document alpha data of the current document file.

public readDocumentAlphaData([mixed $synchronizeCometGroups = true ]) : mixed
Parameters
$synchronizeCometGroups : mixed = true
Tags
inheritDoc
Return values
mixed

recalculateGroupLeftPosition()

Converts an absolute (spread-based) position (in millimeters) of a Comet group into a relative (page-based) position (in millimeters).

public recalculateGroupLeftPosition(CSMamDocumentFile $mamFile, int $left, int $pageID) : int
Parameters
$mamFile : CSMamDocumentFile

The MAM document serving as a calculation basis for spread and page dimensions.

$left : int

The absolute "left" position of the Comet Group that should be recalculated.

$pageID : int

The page item ID of the INDD page, where the Comet group is located.

Tags
Return values
int

The relative "left" position of the Comet Group.

removeImage()

Removes all image or document from an attribute in the product with a given url.

public removeImage(int $attrID[, string $url = null ][, bool $doStore = false ]) : void
Parameters
$attrID : int

the id of the attribute which contains the image

$url : string = null

the path to the image or null if all images should be removed

$doStore : bool = false

store the product for a persistent change

Tags
access

public

Return values
void

removeReference()

Removes the references for an attribute

public removeReference(int $iAttrID, array<string|int, mixed> $aRemovedRefIDs[, int $iLanguageID = null ], mixed $iContextId) : bool
Parameters
$iAttrID : int

the id of the attribute which contains the references

$aRemovedRefIDs : array<string|int, mixed>

the array containing the ids of the references which should be removed

$iLanguageID : int = null

the optional languageID

$iContextId : mixed
Tags
access

public

Return values
bool

restore()

Returns whether the file is archived

public restore() : bool
Tags
deprecated

since PXC24.5: The archive functionality is deprecated and should not be used anymore.

Return values
bool

whether the file is archived

restoreFromPreviewMaster()

Restore the live master from the uploaded preview master This will not start the sync

public restoreFromPreviewMaster() : bool
Tags
Return values
bool

true if copy was created successful, false otherwise

searchContent()

Searches all items matching a given search criteria

public searchContent(CSItemSearchFilter $find[, mixed $rootIds = null ][, mixed $depth = true ][, bool $checkInheritance = true ][, mixed $sortFields = array() ][, string $limit = '' ], int $cacheTime[, bool $bExtendedResult = false ]) : CSItemSearchResult|array<string|int, int>
Parameters
$find : CSItemSearchFilter

the content which must be found.

$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. Either an integer or true to get the values of all children

$checkInheritance : bool = true

Whether inherited fields should be included into the search result or not. IMPORTANT: if this parameter is false, indexed searches are disabled and search is executed on Master DB level.

$sortFields : mixed = array()

the fields the result should be sorted by, either as sql string or as an array 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.

$cacheTime : int

the time in minutes a search result may be cached to increase performance

$bExtendedResult : bool = false

If true, this API method returns an object of type CSItemSearchResult containing more information than only a list of ids. For backward compatibility this defaults to false and returns a list of results only.

Tags
access

public

Return values
CSItemSearchResult|array<string|int, int>

An array of itemIDs matching the search with the given criteria if $bExtendedResult is false, otherwise an instance of CSItemSearchResult.

searchContentExtended()

This method handles searchSimpleContent method result paginated way.

public searchContentExtended(CSItemSearchFilter $oItemSearchFilter[, string $sSearchKeyword = '*' ][, array<string|int, mixed> $aAttrIDs = null ][, array<string|int, mixed> $aRootIDs = null ][, mixed $iDepth = true ][, bool $bCheckInheritance = true ][, int $iSearchMode = CS_SEARCH_GOOGLE_LIKE ][, array<string|int, mixed> $aSortFields = array() ], int $iCacheTime) : CSItemSearchResult
Parameters
$oItemSearchFilter : CSItemSearchFilter

any search request in the form of CSItemSearchFilter object, pagination parameters can be added with this object

$sSearchKeyword : string = '*'

the content which must be found. If it is set to '*' everything matching the other criteria (rootIDs, SqlFilter ...) is returned.

$aAttrIDs : array<string|int, mixed> = null

either null to search all simple searchable 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.

$aRootIDs : array<string|int, 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.

$iDepth : mixed = true

the depth of searching children. Either an integer or true to get the values of all children

$bCheckInheritance : bool = true

Whether inherited fields should be included into the search result or not. IMPORTANT: This parameter only has effect when not using any kind of search index. In case any search index is used and the search is not executed on the MySQL database, this parameter is ignored, as the information about inheritance is not available.

$iSearchMode : int = CS_SEARCH_GOOGLE_LIKE

a CS_SEARCH_ constant (CS_SEARCH_WITH_AND, CS_SEARCH_WITH_OR, CS_SEARCH_EXACT_PHRASE, CS_SEARCH_GOOGLE_LIKE)

$aSortFields : array<string|int, mixed> = array()

the fields the result should be sorted by, either as sql string or as an array with the field name as key and a CS_SORT constant as value (e.g. CS_SORT_STRING_ASC or CS_SORT_NUMERICAL_DESC)

$iCacheTime : int

the time in minutes a search result may be cached to increase performance

Tags
Return values
CSItemSearchResult

returns count, results and page in the CSItemSearchResult object

searchSimpleContent()

Searches all items matching a given search criteria

public searchSimpleContent(string $find[, mixed $attrIDs = null ][, mixed $rootIDs = null ][, mixed $depth = true ][, bool $checkInheritance = true ][, int $searchMode = CS_SEARCH_GOOGLE_LIKE ][, mixed $sortFields = array() ][, string $limit = '' ][, string|CSItemSearchFilter $itemFilter = '' ], int $cacheTime[, bool $bExtendedResult = false ]) : CSItemSearchResult|array<string|int, int>
Parameters
$find : string

the content which must be found. If it is set to '*' everything matching the other criteria (rootIDs, SqlFilter ...) is returned.

$attrIDs : mixed = null

either null to search all simple searchable 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. Either an integer or true to get the values of all children

$checkInheritance : bool = true

Whether inherited fields should be included into the search result or not. IMPORTANT: if this parameter is false, indexed searches are disabled and search is executed on Master DB level.

$searchMode : int = CS_SEARCH_GOOGLE_LIKE

a CS_SEARCH_ constant (CS_SEARCH_WITH_AND, CS_SEARCH_WITH_OR, CS_SEARCH_EXACT_PHRASE, CS_SEARCH_GOOGLE_LIKE)

$sortFields : mixed = array()

the fields the result should be sorted by, either as sql string or as an array 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|CSItemSearchFilter = ''

an additional sql-filter which should be applied to the database queries

$cacheTime : int

the time in minutes a search result may be cached to increase performance

$bExtendedResult : bool = false

If true, this API method returns an object of type CSItemSearchResult containing more information than only a list of ids. For backward compatibility this defaults to false and returns a list of results only.

Tags
access

public

Return values
CSItemSearchResult|array<string|int, int>

An array of itemIDs matching the search with the given criteria if $bExtendedResult is false, otherwise an instance of CSItemSearchResult.

setAccessLevels()

Sets the access levels for this item

public setAccessLevels(array<string|int, mixed> $rubricIDs) : void
Parameters
$rubricIDs : array<string|int, mixed>

an array containing all new RubricIDs

Tags
access

public

Return values
void

setConfiguration()

Sets the configuration id for the current item

public setConfiguration(int|string|Itemconfiguration $mConfiguration) : void
Parameters
$mConfiguration : int|string|Itemconfiguration

The configuration id or the configuration object that should be applied to this item.

Tags
access

public

Return values
void

setConfigurationClassIds()

Sets the configuration class ids

public setConfigurationClassIds(array<string|int, mixed> $aClassIds) : void
Parameters
$aClassIds : array<string|int, mixed>

An array with configuration class or folder ids.

Tags
Return values
void

setDefaultLanguageID()

Changes the default language to the given language for the current session and therefore for all items.

public setDefaultLanguageID(int $languageID[, bool $storePermanently = true ]) : mixed

This affects all language dependant methods (e.g. setValue, getValue) and Guis

Parameters
$languageID : int

the requested languageID of the identifier or null if the current default language should be used

$storePermanently : bool = true

whether the change should be stored in the session (true) or only for the current request (false)

Tags
access

public

Return values
mixed

setExternalKey()

Sets the external key of the item

public setExternalKey(string $externalKey) : void
Parameters
$externalKey : string

the new external key of the item

Tags
access

public

Return values
void

setFieldStateID()

Sets the Workflow State for a given field

public setFieldStateID(int $configurationID, int $stateID[, int $languageID = null ], int $subType) : int
Parameters
$configurationID : int

the field for which the State is set

$stateID : int

the new StateID

$languageID : int = null

the language for which the State is set

$subType : int

this parameter can define the optional subtype of the value

Tags
access

public

Return values
int

the StateID of the Workflow

setFileContent()

Sets a new file content to the MamFile.

public setFileContent(string $sFileContent[, string $sNewFileType = null ][, string $sLocalFilePath = null ][, CSFileStream $oStreamFile = null ]) : bool

To be able to do this, the file has to been checked out first.

Parameters
$sFileContent : string

the new filecontent as a string.

$sNewFileType : string = null

the new filetype

$sLocalFilePath : string = null

the path of a local file (e.g. a uploaded file) which should be used instead of the $fileContent

$oStreamFile : CSFileStream = null

The stream file API object.

Tags
Return values
bool

whether the content could be modified

setFileName()

Renames the CSMamFile

public setFileName(string $newName) : mixed
Parameters
$newName : string

the new FileName of CSMamFile

Tags
access

public

Return values
mixed

setFormattedValue()

Sets a formatted value of an item

public setFormattedValue(int|string $mIdentifier, mixed $mValue[, int|null $iLanguageId = null ][, string $mMedium = '' ][, int $iContextId = null ]) : void

If you pass the label of the field as identifier be aware that labels are not unique and the value of the first field with that label will be returned.

Parameters
$mIdentifier : int|string

Field ID or field name of the value to get.

$mValue : mixed

The new formatted value to set (usually as string).

$iLanguageId : int|null = null

The requested languageID of the identifier or null if the current default language should be used.

$mMedium : string = ''

An alternative medium the value should be formatted for ( CSItemMedium::HTML or CSItemMedium::TEXT are supported as standard). This parameter is passed to the CSTypes getValue() method.

$iContextId : int = null

The context id for which the value should be set

Tags
deprecated

Deprecated since CS21.5, use setValueForConfig() instead.

Return values
void

setGrid()

Allows to set a CSGridItem as value to a field

public setGrid(string $iIdentifier, CSGrid $oGrid[, int $iLanguageID = NULL ], int $iSubType) : void
Parameters
$iIdentifier : string

Field ID or field label of the value to set

$oGrid : CSGrid

The object to set

$iLanguageID : int = NULL

The requested languageID of the identifier or null if the current default language should be used

$iSubType : int

The fields subtype

Tags
Return values
void

setKeyword()

Adds a keyword to the current item

public setKeyword(mixed $keyword) : mixed
Parameters
$keyword : mixed

keyword ID or CSKeyword object containing the keywords

Tags
access

public

Return values
mixed

setKeywords()

Sets the keywords for the current item

public setKeywords(array<string|int, mixed> $keywordIDs) : mixed
Parameters
$keywordIDs : array<string|int, mixed>

an array of keyword IDs or CSKeyword objects containing the keywords

Tags
access

public

Return values
mixed

setLabel()

Sets the label of the item

public setLabel(string $label) : void
Parameters
$label : string

the new label of the item

Tags
access

public

Return values
void

setOmittingVersionFile()

this method allows it to temporary disable the version file creation.

public setOmittingVersionFile([bool $bOmit = true ]) : bool

This prevents undo checkout operations from restoring the file content but can save a lot of performance on file share based environments. Should only be used if no revert of files is necessary.

Parameters
$bOmit : bool = true

if true, no version files are created, otherwise the default behavior is restored

Tags
access

public

Return values
bool

the previous state of version file creation

setPlannedPageNames()

Allows to set the planned page names (for example in the publication manager) of all pages in the document.

public setPlannedPageNames(mixed $pageNames) : void
Parameters
$pageNames : mixed

array with page names (like 1, 2, 3) as the key and the planned page names (004,005,0006) as values.

Tags
access

public

Return values
void

setReferences()

Sets the references for an attribute

public setReferences(int $attrID[, array<string|int, mixed> $refIDs = array() ][, array<string|int, mixed> $removedRefIDs = array() ][, int $languageID = null ][, array<string|int, mixed> $additionalParams = array() ], mixed $iContextId) : void
Parameters
$attrID : int

the id of the attribute which contains the references

$refIDs : array<string|int, mixed> = array()

the array containing the ids of the new references

$removedRefIDs : array<string|int, mixed> = array()

the array containing the ids of the references which should be removed from inherited values if additive inheritance is active

$languageID : int = null

the optional languageID

$additionalParams : array<string|int, mixed> = array()

additional values in the form key=>value which might be the standard keys like 'Type' or userdefined values

$iContextId : mixed
Tags
Note:

Always use store after setReferences() call else values won't get stored in item attribute table.

access

public

Return values
void

setReferencesValues()

Associates multiple additional values with the references for an attribute of an item.

public setReferencesValues(mixed $mRefSourceAttr[, array<string|int, mixed> $aasReferencesValues = array() ][, int $iLanguageId = NULL ]) : bool
Parameters
$mRefSourceAttr : mixed

The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.

$aasReferencesValues : array<string|int, mixed> = array()

array A two-dimensional array containing the reference attribute values, grouped by the target item IDs (first dimension's key) and the reference attribute IDs/labels (second dimension's key). Non-existent target item IDs will be ignored. Upon storing the values, they will be implicitly typecasted into a string.

$iLanguageId : int = NULL

The language of the references.

Tags
throws
CSItemException
access

public

Return values
bool

TRUE on success or FALSE if the new reference attribute values could not be set.

setReferenceValue()

Associates a single value with a specific reference for an attribute of an item.

public setReferenceValue(mixed $mRefSourceAttr, int $iRefTargetItemId, mixed $mRefAttrKey, string $sReferenceValue[, int $iLanguageId = NULL ]) : bool
Parameters
$mRefSourceAttr : mixed

The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.

$iRefTargetItemId : int

If the target item ID does not exist, the call will silently succeed without setting any value. If a second or third target with the given ID is existing, it may be accessed using a suffix _[COUNTER], e.g. 11, 11_2, 11_3, ...

$mRefAttrKey : mixed

A string or int containing the ID/label of the reference's attribute which shall be written.

$sReferenceValue : string

The reference attribute value. Upon storing the values, they will be implicitly typecasted into a string.

$iLanguageId : int = NULL

The language of the references.

Tags
throws
CSItemException
access

public

Return values
bool

TRUE on success or FALSE if the new reference attribute values could not be set.

setReferenceValues()

Associates multiple additional values with a specific reference for an attribute of an item.

public setReferenceValues(mixed $mRefSourceAttr, int $iRefTargetItemId[, array<string|int, mixed> $asReferenceValues = array() ][, int $iLanguageId = NULL ]) : bool
Parameters
$mRefSourceAttr : mixed

The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.

$iRefTargetItemId : int

If the target item ID does not exist, the call will silently succeed without setting any value. If a second or third target with the given ID is existing, it may be accessed using a suffix _[COUNTER], e.g. 11, 11_2, 11_3, ...

$asReferenceValues : array<string|int, mixed> = array()

array An array containing the reference attribute values, indexed by the reference attribute IDs/labels. Upon storing the values, they will be implicitly typecasted into a string.

$iLanguageId : int = NULL

The language of the references.

Tags
throws
CSItemException
access

public

Return values
bool

TRUE on success or FALSE if the new reference attribute values could not be set.

setValue()

Sets a value of an item

public setValue(string $mIdentifier, string $mValue[, int|null $iLanguageId = null ], int $iSubType[, int $iContextId = null ]) : void

If you pass the label of the field as identifier be aware that labels are not unique and the value of the first field with that label will be set.

Parameters
$mIdentifier : string

Field name or ID of the value to set

$mValue : string

Value to set

$iLanguageId : int|null = null

The languageID of the identifier or null if the current default language should be used

$iSubType : int

The subType of a value, if a configuration has multiple attributes

$iContextId : int = null

The context id for which the value should be set

Tags
deprecated

Deprecated since CS21.5, use setValueForConfig() instead.

access

public

Return values
void

setValueForConfig()

Sets a value on the item matching the setter definition.

public setValueForConfig(CSItemValueSetter $oSetter) : void
Parameters
$oSetter : CSItemValueSetter

The definition of the value to set.

Tags
access

public

Return values
void

setValues()

This method is designed to update multiple values for multiple Items.

public setValues(array<string|int, mixed> $aValues[, int $iLanguageID = NULL ][, bool $bLoadIDFromExternalKey = FALSE ][, bool $bDoPreflight = TRUE ][, bool $bAllowInheritance = TRUE ][, bool $bIgnoreWhitespaces = TRUE ]) : bool

The array should look like the following (basically like an array returned by ): array( [ItemID1 / ExternalKey1] => array( [ConfigurationID1] => [Value1], [ConfigurationID2] => [Value2], ... ), [ItemID2 / ExternalKey2] => array( [ConfigurationID1] => [Value1], [ConfigurationID3] => [Value3], ... ), ... ) You can also pass an array of ConfigurationIDs/Value pairs to update only the current Item

Parameters
$aValues : array<string|int, mixed>

An array containing the values to be updated

$iLanguageID : int = NULL

The language id which should be updated as integer

$bLoadIDFromExternalKey : bool = FALSE

Whether the value updates are searching for ExternalKeys instead of item ids

$bDoPreflight : bool = TRUE

If set to FALSE all values will be set wether they have changed or not (CAUTION: disabling the preflight option costs Performance!!!)

$bAllowInheritance : bool = TRUE

Whether the result from the parent node should be returned if no value is found for an item

$bIgnoreWhitespaces : bool = TRUE

If set to TRUE the whitespaces will be trimmed for compare (only applies if $bDoPreflight is TRUE)

Tags
access

public

throws
CSException

In the Message all Identifiers are listed NL-separated which could not be found in the system

Return values
bool

setValuesForConfig()

Sets values on the item matching the setter definition.

public setValuesForConfig(CSItemValuesSetter $oSetter) : void
Parameters
$oSetter : CSItemValuesSetter

The definition of the values to set.

Tags
access

public

Return values
void

store()

Stores an item to the database and returns the ID of the item

public store() : int
Tags
access

public

Return values
int

the ID of the item

synchronize()

Synchronizes all files within the current folder Sometimes a extended synchronisation is required, e.g. when the local version files have been deleted, e.g. by installing a backup on a other system. For this reason the $forceCompleteCheck flag has been added.

public synchronize([bool $forceCompleteCheck = false ]) : array<string|int, mixed>

If this flag is set the details of all files are transfered. Therefore this action may require a long time to synchronize

Parameters
$forceCompleteCheck : bool = false

whether all files should be explicitly compared or only the changed ones

Tags
access

public

Return values
array<string|int, mixed>

of arrays containing the changed ids, with a group as key (new, created, deleted, changed, syncstatechanged) and the related ids as values

toXml()

Returns an xml content with the item and it's children

public toXml(int $levels[, string $xsl = '' ][, mixed $additionalOptions = array() ]) : array<string|int, mixed>
Parameters
$levels : int

depth of the xml hierarchy

$xsl : string = ''

xsl-file to transform the xml

$additionalOptions : mixed = array()
Tags
access

public

Return values
array<string|int, mixed>

$additionalOptions additional settings which may be passed to the CSItemExport, containing special keys like:

  • 'useCDATA': whether CDATA (true) elements or escaped entities should be used

undoCheckout()

Do an undo checkout to the current item

public undoCheckout([bool $recursive = false ]) : bool
Parameters
$recursive : bool = false

whether the undo checkout has to affect all childrens

Tags
access

public

Return values
bool

whether undoCheckout succeeded or not

Replaces a link with a copy of the original file

public unlink() : bool
Tags
access

public

Return values
bool

whether the unlink succeeded

unlock()

unlocks a file previously locked by the lock-method

public unlock() : int
Tags
access

public

Return values
int

the user id the file has been locked for previously

unzip()

Extracts files from the Mamfile, if it is a zip.

public unzip([CSMamFile $dstFolder = null ][, array<string|int, mixed> $copyAttributes = array() ][, bool $overwrite = false ][, array<string|int, mixed> $aForbiddenFileTypes = array() ][, bool $bCreateDuplicateForExistingFiles = false ][, bool $bReturnDetailInformation = false ]) : array<string|int, CSMamFile>
Parameters
$dstFolder : CSMamFile = null

The optional folder where the contained files should be unzipped to

$copyAttributes : array<string|int, mixed> = array()

The attributeIDs which should be copied from the zip file to the extracted files. If it is null no attributes are copied and if it is an empty array all attributes are copied.

$overwrite : bool = false

If TRUE, files are getting overwritten, otherwise not.

$aForbiddenFileTypes : array<string|int, mixed> = array()

An array of file types that should not be extracted and added to the MAM.

$bCreateDuplicateForExistingFiles : bool = false

If set to TRUE duplicates are created.

$bReturnDetailInformation : bool = false

If set to TRUE an array with detail information is returned. For example: if file was duplicates/overwritten/exists ...

Tags
Return values
array<string|int, CSMamFile>

An array of the CSMamFile objects of all extracted files.

unzipFiles()

Extracts only files (without folder structure) from the MamFile, if it is a zip.

public unzipFiles([CSMamFile $dstFolder = null ][, array<string|int, mixed> $copyAttributes = array() ][, bool $overwrite = false ][, array<string|int, mixed> $aForbiddenFileTypes = array() ][, bool $bCreateDuplicateForExistingFiles = false ][, bool $bReturnDetailInformation = false ]) : array<string|int, CSMamFile>
Parameters
$dstFolder : CSMamFile = null

The optional folder where the contained files should be unzipped to

$copyAttributes : array<string|int, mixed> = array()

The attributeIDs which should be copied from the zip file to the extracted files. If it is null no attributes are copied and if it is an empty array all attributes are copied.

$overwrite : bool = false

If TRUE, files are getting overwritten, otherwise not.

$aForbiddenFileTypes : array<string|int, mixed> = array()

An array of file types that should not be extracted and added to the MAM.

$bCreateDuplicateForExistingFiles : bool = false

If set to TRUE duplicates are created.

$bReturnDetailInformation : bool = false

If set to TRUE an array with detail information is returned. For example: if file was duplicates/overwritten/exists ...

Tags
Return values
array<string|int, CSMamFile>

An array of the CSMamFile objects of all extracted files.


        

Search results