Class icm.model.PropertyEditable


Extends ecm.model._ModelObject.
Represents a Property when editing an object such as a case or work item.
Defined in: <icm/model/PropertyEditable.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 
Constructs a PropertyEditable object.

Field Summary

Field Attributes Field Name and Description
 
Holds an array of ecm.model.ContentItem objects that represents the items in this attachment field.
 
The cardinality
 
The choice list
 
The indexes of items in a multi-value list that are invalid if supplied by an external system.
 
A custom validation error if one is supplied by an external system.
 
The data type
 
The default value
 
Specifies that the value has been set and this property has dependent properties.
 
The textual description
 
dirty 
Indicates if the value has been modified.
 
The display mode.
 
Indicates if an empty string can be used wherever null is accepted and otherwise could not be accepted.
 
Indicates what settings of this property object have been modified by an external data service, if any.
 
Indicates if this property has dependent properties.
 
hidden 
Indicates if this property should be hidden in a UI.
 
Indicates if this property is inherited from a super-class
 
The maximum length
 
The maximum value
 
The minimum length
 
The minimum value
 
Indicates if this property can be used to order the results of a query.
 
The original value before any modifications to the value.
 
If property represents a step parameter, this is the parameter name as opposed to the authored name.
 
Indicates the provider for this property
 
Indicates if this property is read-only
 
The ecm.model.Repository object that stores the object that contains this property.
 
Indicates if this property requires a value
 
The settability
 
Indicates the symbolicName for this property
 
system 
Indicates if this property is controlled by the system.
 
value 
The value of the property

Method Summary

Method Attributes Method Name and Description
 
addAttachment(contentItem)
Adds an item to this attachment field.
 
onChoiceListChanged(choiceList, propEditable)
Called whenever the choice list changes.
 
onCustomValidationChanged(customValidationError, customInvalidItems, propEditable)
Called whenever the custom validation error or custom invalid items changes.
 
onDisplayModeChanged(displayMode, propEditable)
Called whenever the display mode changes.
 
onHasDependentPropertiesChanged(hasDependentProperties, propEditable)
Called whenever the hasDependentProperties setting changes.
 
onHiddenChanged(hidden, propEditable)
Called whenever the hidden setting changes.
 
onMaxLengthChanged(maxLength, propEditable)
Called whenever the maximum length changes.
 
onMaxValueChanged(maxValue, propEditable)
Called whenever the maximum value changes.
 
onMinValueChanged(minValue, propEditable)
Called whenever the minimum value changes.
 
onReadOnlyChanged(readOnly, propEditable)
Called whenever the read only setting changes.
 
onRequiredChanged(required, propEditable)
Called whenever the required setting changes.
 
onValueChanged(value, propEditable)
Called whenever the value is modified.
 
removeAttachment(contentItem)
Removes an item from this attachment field.
 
Retrieves a list of ecm.model.ContentItem objects corresponding to the items in this attachment field.
 
setAttachments(contentItems)
Sets the attachments as an array of ContentItem objects.
 
setValue(val)
Call this setter method to set the value instead of setting the value property directly.

Constructor Detail

icm.model.PropertyEditable(properties)

Constructs a PropertyEditable object. A PropertyEditable object is typically constructed internally by other model objects.
Parameters:
properties
The properties for the PropertyEditable object. The properties can be any of the public fields as defined below and on ecm.model._ModelObject.

Field Detail

attachmentContents

Holds an array of ecm.model.ContentItem objects that represents the items in this attachment field. This is populated when retrieveAttachmentContents() is called.

cardinality

The cardinality

choiceList

The choice list

customInvalidItems

The indexes of items in a multi-value list that are invalid if supplied by an external system.

customValidationError

A custom validation error if one is supplied by an external system.

dataType

The data type

defaultValue

The default value

dependentsRetrievalPending

Specifies that the value has been set and this property has dependent properties. A retrieveDependentProperties() call is required on the parent object of this property. After the retrieveDependentProperties() completes and this property is updated from the result, this flag is cleared.

description

The textual description

dirty

Indicates if the value has been modified.

displayMode

The display mode.

emptyStringSameAsNull

Indicates if an empty string can be used wherever null is accepted and otherwise could not be accepted.

externalDataModifications

Indicates what settings of this property object have been modified by an external data service, if any. If this value is null, this property object has not been influenced by external data. Otherwise the value is a javascript object with some or all of the following members. All of the members are boolean true or false to indicate that that setting was modified or not. An absence of a member is the same as a false value.

hasDependentProperties

Indicates if this property has dependent properties.

hidden

Indicates if this property should be hidden in a UI.

inherited

Indicates if this property is inherited from a super-class

maxLength

The maximum length

maxValue

The maximum value

minLength

The minimum length

minValue

The minimum value

orderable

Indicates if this property can be used to order the results of a query.

originalValue

The original value before any modifications to the value.

parameterName

If property represents a step parameter, this is the parameter name as opposed to the authored name. The parameter name could be translated if a translation source is available.

provider

Indicates the provider for this property

readOnly

Indicates if this property is read-only

repository

The ecm.model.Repository object that stores the object that contains this property.

required

Indicates if this property requires a value

settability

The settability

symbolicName

Indicates the symbolicName for this property

system

Indicates if this property is controlled by the system.

value

The value of the property

Method Detail

addAttachment(contentItem)

Adds an item to this attachment field. The item to add is represented by an ecm.model.ContentItem object. The value of this field is updated with a javascript object representing the new item. The item is also added to the attachmentContents property.

If this property represents a single-value attachment field, the single value is replaced by the ContentItem object. The value of the field is updated with a single javascript object and the attachmentContents property is replaced with a 1-item array containing the ContentItem.

This method requires that the retrieveAttachmentContents() method was called previously. No action is taken if that method has not yet been called.

This method takes no action if this property does not represent an attachment field.

Parameters:
contentItem
An ecm.model.ContentItem object that represents the document that is to be added to this attachment field. Use the IBM Content Navigator API to retrieve the ContentItem object by running a query or creating a new document.

onChoiceListChanged(choiceList, propEditable)

Called whenever the choice list changes. This may happen when resolving the dependent properties
Parameters:
choiceList
The new choiceList value.
propEditable
This PropertyEditable object.

onCustomValidationChanged(customValidationError, customInvalidItems, propEditable)

Called whenever the custom validation error or custom invalid items changes. This may happen when resolving the dependent properties
Parameters:
customValidationError
The new value of the customValidationError setting.
customInvalidItems
The new value of the customInvalidItems setting.
propEditable
This PropertyEditable object.

onDisplayModeChanged(displayMode, propEditable)

Called whenever the display mode changes. This may happen when resolving the dependent properties
Parameters:
displayMode
The new value of the displayMode setting.
propEditable
This PropertyEditable object.

onHasDependentPropertiesChanged(hasDependentProperties, propEditable)

Called whenever the hasDependentProperties setting changes. This may happen when resolving the dependent properties
Parameters:
hasDependentProperties
The new value of the hasDependentProperties setting.
propEditable
This PropertyEditable object.

onHiddenChanged(hidden, propEditable)

Called whenever the hidden setting changes. This may happen when resolving the dependent properties
Parameters:
hidden
The new hidden value.
propEditable
This PropertyEditable object.

onMaxLengthChanged(maxLength, propEditable)

Called whenever the maximum length changes. This may happen when resolving the dependent properties
Parameters:
maxLength
The new maxLength value.
propEditable
This PropertyEditable object.

onMaxValueChanged(maxValue, propEditable)

Called whenever the maximum value changes. This may happen when resolving the dependent properties
Parameters:
maxValue
The new maxValue value.
propEditable
This PropertyEditable object.

onMinValueChanged(minValue, propEditable)

Called whenever the minimum value changes. This may happen when resolving the dependent properties
Parameters:
minValue
The new minValue value.
propEditable
This PropertyEditable object.

onReadOnlyChanged(readOnly, propEditable)

Called whenever the read only setting changes. This may happend resolving the dependent properties
Parameters:
readOnly
The new value of the readOnly setting.
propEditable
This PropertyEditable object.

onRequiredChanged(required, propEditable)

Called whenever the required setting changes. This may happen when resolving the dependent properties
Parameters:
required
The new required value.
propEditable
This PropertyEditable object.

onValueChanged(value, propEditable)

Called whenever the value is modified.
Parameters:
value
The new value
propEditable
This PropertyEditable instance

removeAttachment(contentItem)

Removes an item from this attachment field. The item to remove is represented by an ecm.model.ContentItem object. The javascript object is removed from the value of this field. The item is also removed from the attachmentContents property.

If this property represents a single-value attachment field and the supplied ContentItem object represents that single value, then the value of the property will be replaced with an empty javascript object and the attachmentContents property will be replaced with a zero-length array.

This method requires that the retrieveAttachmentContents() method was called previously. No action is taken if that method has not yet been called.

This method takes no action if this property does not represent an attachment field.

Parameters:
contentItem
An ecm.model.ContentItem object that represents the document that is to be removed from this attachment field. Use the IBM Content Navigator API to retrieve the ContentItem object by running a query.

retrieveAttachmentContents(callback)

Retrieves a list of ecm.model.ContentItem objects corresponding to the items in this attachment field. Populates the attachmentContents property as a result of this call. That property can be accessed directly if this method has already been called. This method calls the callback immediately if the method has already been called previously.

The attachmentContents property will always be filled with an array of ContentItem objects. For a single-value field, the attachmentContents property is filled with a 1-item array if the field has a value, otherwise it will contain a 0-length array.

Each ContentItem object obtained will have a property unretrievedAttachmentStatus that indicates a retrieval status if that item was not retrieved from a repository. Some ContentItem objects may not be retrieved and may only contain minimal information taken from the attachment. Currently the ContentItem is not retrieved if the attachment references a document stored in an external repository.

The callback function will be called with a null argument if this property does not represent an attachment field.

Parameters:
callback
Function that is passed an array of ecm.model.ContentItem objects as an argument.

setAttachments(contentItems)

Sets the attachments as an array of ContentItem objects. The value of this property is replaced with javascript objects that correspond to the passed in ContentItem objects. The attachmentContents property will hold a copy of the array passed to this method.

For a single-value attachment field, a 1-item array can be passed in to set the single attachment value and a zero-length array can be passed in to clear the attachment value. The value of a single-value attachment field has an empty javascript object if it is not set. The attachmentContents property still holds an array for a single-value attachment field and will be either a 1-item or zero-length array.

For convenience, a single ContentItem object or null can be passed to this method. This can be more convenient when dealing with single-value attachment fields. A single ContentItem object is equivalent to passing in a 1-item array and null is equivalent to passing in a zero-length array. Note that the attachmentContents property will still hold an array even if this object represents a single-value field.

This method takes no action if this property does not represent an attachment field.

Parameters:
contentItems
An array of ecm.model.ContentItem objects that represents the documents that are to be set as the attachments. Use the IBM Content Navigator API to retrieve the ContentItem objects by running a query or creating new documents.

setValue(val)

Call this setter method to set the value instead of setting the value property directly. This method does other things such as firing the onValueChanged() event when the value changes.
Parameters:
val
The new property value.