Updates the value of the ISelectionListProperty
.
ISelectionListProperty
; cannot be null
. ISelectionListProperty
; cannot be null
, an empty string, or longer than 255 characters. The new value should be an existing string value in the selection list associated with the ISelectionListProperty
otherwise an ArgumentException
will be thrown when the content item is checked in.
InvalidOperationException
will be thrown if this method is called on an item that is not checked out. The updated property value will not be persisted until IContentItemManager.CheckInItem
is called. If the content item does not contain the specified property, an ArgumentException
will be thrown when IContentItemManager.CheckInItem
is called.
ISelectionList
, create an ISelectionListProperty
using that Selection List, and set the value for the ISelectionListProperty
. // Create and store a selection list with a list of string values. String[] listValues = { "value1", "value2", "value3", "value4", "value5" }; ISelectionList selectionList = selectionListManager.CreateSelectionList(folder, "My Selection List", listValues); selectionList.Store(); // Create a Selection List Property and add to an existing Data Entry Template. ISelectionListProperty selectionListProp = propertyManager.CreateSelectionListProperty("Selection List Property", "Description for Selection List Property", selectionList); dataEntryTemplate.AddProperty(selectionListProp); dataEntryTemplate.Store(); // Set the Selection List Property value on a Content item, assuming the Content item // is created using the above Data Entry Template that has the Selection List Property. contentItemManager.CheckOutItem(contentItem); contentItem.SetSelectionListPropertyValue(selectionListProp, "value2"); // When setting a selection list value, the string must match exactly // one of the values in the selection list. // Check in the Content item to persist the updated Selection List property value. contentItemManager.CheckInItem(contentItem, "Check in the item with Selection List Property value updated."); // Retrieves the value after the item is checked-in. String retrievedValue = contentItem.GetSelectionListPropertyValue(selectionListProperty);
Exception Type | Condition |
---|---|
InvalidOperationException | The item has already been removed or the item is not checked out. |
ArgumentException | The item does not contain the specified property or the value is an empty string or longer than 255 characters. |
IContentItem Interface | Plumtree.Remote.PRC.Content.Item Namespace | CheckInItem