Class ecm.model.Item


Extends ecm.model._ModelObject.
Represents an item in a repository. An item can be a document, folder, work item, or other resource that is managed by the repository.

Typically, an item is obtained from a result set. However, an item can be obtained directly by using the ecm.model.Repository.retrieveItem method.

Important: The attributes or properties of an item might not be completely retrieved initially. To ensure that all attributes of an item are retrieved, call the ecm.model.Item.retrieveAttributes method.


Defined in: <ecm\model\Item.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 
ecm.model.Item(properties)
Constructs an item.

Field Summary

Field Attributes Field Name and Description
 
The attributes object contains the values for the user and system attributes associated with this item.
 
A boolean indicating that this repository item is a simple property container.
 
A boolean indicating that the item is deleted on the server.
 
The identifier of the entry template used to add this item, if any.
 
locked 
A boolean indicating if the item is locked on the server.
 
The userid of the user who has locked the item on the server.
 
The type of the item.
 
parent 
An instance of ecm.model.Item for the item that is the parent of this item, if any.
 
A bitstring containing privileges for the item.
 
An instance of ecm.model.Repository representing the repository on which this item is (or will be) stored.
 
An instance of ecm.model.ResultSet representing the result set that this item was obtained from, if any.
Fields borrowed from class ecm.model._ModelObject:
categorization, id, isRecurring, name, nameFilter, pane, status, type, userId

Method Summary

Method Attributes Method Name and Description
 
containsValue(attribute, value)
Returns true if the specified attribute has the value given.
 
getAttributeFormat(attribute)
Returns the format of the attribute.
 
getAttributeType(attribute)
Returns the type of the attribute.
 
getAttrLabel(attribute)
Returns the custom label for this System Property
 
Returns an instance of ecm.model.ContentClass for items of this class, if known.
 
getDisplayValue(attribute)
Returns the attribute value in a format that can be displayed in the user interface.
 
getItemValue(attribute)
For xs:object property type, returns the Item value, if it was retrieved with this Item.
 
Returns the MIME class (file type) for this item's MIME type.
 
Returns the date when this item was last modified.
 
Returns the user identifier for the user that last modified the item.
 
Returns an array of the complete path.
 
Returns the State icon CSS class for that specified state
 
getUserInfo(propertyName)
Returns the user information for the given property name.
 
getValue(attribute)
Returns the value of an attribute.
 
getValues(attribute)
Returns an array of values for the attribute.
 
hasAttribute(attribute)
Returns true if the attribute exists on this item.
 
hasPrivilege(privilege)
Returns true if this item has the specified privilege.
 
Returns true if the attribute is read only, otherwise returns false.
 
Returns true if the item is an entry template that declares records.
 
Returns true if the item is an entry template that creates documents.
 
Returns true if the item is an entry template.
 
Returns true if the item is a container of other items.
 
Returns true if the item is an entry template that creates folders.
 
isSystemProperty(attribute)
Checks if a given attribute is a System Property
 
Retrieves all attributes for the item.
 
setValue(attribute, value)
 
setValues(attribute, values)
Methods borrowed from class ecm.model._ModelObject:
destroy, onChange, own, refresh, toString

Constructor Detail

ecm.model.Item(properties)

Constructs an item. Normally, subclasses of ecm.model.Item are constructed rather than ecm.model.Item itself, but ecm.model.Item objects can be constructed for situations where items are needed that do not actually exist on the server.
Parameters:
properties
The properties for the item. The properties can be any of the public fields as defined below and on ecm.model._ModelObject.

Field Detail

attributes

The attributes object contains the values for the user and system attributes associated with this item. There is a field for each attribute name. The field value is the attribute value.

dataObject

A boolean indicating that this repository item is a simple property container. For P8 repositories, this is equivalent to a CustomObject. For CM Repositories, this is equivalent to a no content item.
Since:
2.0.2

deleted

A boolean indicating that the item is deleted on the server.

entryTemplateId

The identifier of the entry template used to add this item, if any.

locked

A boolean indicating if the item is locked on the server.

lockedUser

The userid of the user who has locked the item on the server.

mimetype

The type of the item. For simple documents this is MIME content type, but other items on the server are given mimetypes as well to distinguish them.

parent

An instance of ecm.model.Item for the item that is the parent of this item, if any.

privileges

A bitstring containing privileges for the item. The bits are as defined by Item.PrivilegeToBitmask.

repository

An instance of ecm.model.Repository representing the repository on which this item is (or will be) stored.

resultSet

An instance of ecm.model.ResultSet representing the result set that this item was obtained from, if any.

Method Detail

containsValue(attribute, value)

Returns true if the specified attribute has the value given. For multi-value attributes, this will return true if any value has the given value.
Parameters:
attribute
The identifier for the attribute.
value
The value to test.

{string} getAttributeFormat(attribute)

Returns the format of the attribute.
Parameters:
attribute
The attribute name
Returns:
{string} The format of the attribute

{string} getAttributeType(attribute)

Returns the type of the attribute.
Parameters:
attribute
The attribute name
Returns:
{string} The type of the attribute

getAttrLabel(attribute)

Returns the custom label for this System Property
Parameters:
attribute
The attribute identifier.

getContentClass()

Returns an instance of ecm.model.ContentClass for items of this class, if known. Some items, such as work items will not have an associated content class as they are not stored on the content repository directly. In such cases, this will return null.

getDisplayValue(attribute)

Returns the attribute value in a format that can be displayed in the user interface.

Note: The display value is normally created by using ValueFormatter.formatValue based on the attribute value and thus will change if the attribute value is changed (using setValue). However, if a special display value was returned for the attribute from the the server then the display value will not change even if the value is changed using setValue.

Parameters:
attribute
The name of the attribute.

getItemValue(attribute)

For xs:object property type, returns the Item value, if it was retrieved with this Item. This method can return null, even if the xs:object property has an assigned value. Use getValue to get the actual assigned value (the item id)
Parameters:
attribute
The attribute identifier.
Since:
2.0.2

getMimeClass()

Returns the MIME class (file type) for this item's MIME type.

getModifyDate()

Returns the date when this item was last modified.

getModifyUser()

Returns the user identifier for the user that last modified the item.

getPath()

Returns an array of the complete path.

getStateClass(state)

Returns the State icon CSS class for that specified state
Parameters:
state
The id from Admin of the particular state class you are looking for

getUserInfo(propertyName)

Returns the user information for the given property name.
Parameters:
propertyName
Since:
2.0.3

getValue(attribute)

Returns the value of an attribute.
Parameters:
attribute
The attribute identifier.

getValues(attribute)

Returns an array of values for the attribute. For a single-value attribute this will be an array of one value. For multi-value attributes, this will be an array with all values of the attribute.
Parameters:
attribute
The attribute identifier.

hasAttribute(attribute)

Returns true if the attribute exists on this item.
Parameters:
attribute
The attribute identifier to test.

hasPrivilege(privilege)

Returns true if this item has the specified privilege.
Parameters:
privilege

isAttributeReadOnly(attribute)

Returns true if the attribute is read only, otherwise returns false. Includes checking the class attribute definition read only setting and the item read only setting.
Parameters:
attribute
The name of the attribute.

isDeclareRecordEntryTemplate()

Returns true if the item is an entry template that declares records.
Since:
2.0.3

isDocumentEntryTemplate()

Returns true if the item is an entry template that creates documents.
Since:
2.0.3

isEntryTemplate()

Returns true if the item is an entry template.
Since:
2.0.3

isFolder()

Returns true if the item is a container of other items.

isFolderEntryTemplate()

Returns true if the item is an entry template that creates folders.
Since:
2.0.3

isSystemProperty(attribute)

Checks if a given attribute is a System Property
Parameters:
attribute

retrieveAttributes(callback)

Retrieves all attributes for the item. Depending on how the item was originally created, it may only contain a subset of the attributes. This function will retrieve any additional missing attributes.
Parameters:
callback
A function that is called when the attribute refresh has completed.

setValue(attribute, value)

Parameters:
attribute
value

setValues(attribute, values)

Parameters:
attribute
values