com.plumtree.remote.prc.content.item
Interface IContentItem


public interface IContentItem

Represents a content item. Manages property value modification and retrieval, and encapsulates a content item's metadata.

To update property values for a new content item, use setPropertyValue for the various property types and then persist the values with IContentItemManager.checkInItem.

To update property values for an existing content item, first check out the item with IContentItemManager.checkOutItem, modify property values with get/setPropertyValue, and then persist the modifications with IContentItemManager.checkInItem.

For information about the conditions that make a content item searchable in ALI Search, refer to the documentation in IPresentationTemplate.isSearchable .

The following example code determines what types of properties exist on a content item and how to modify their values:

 //To modify property values on an existing item, first check-out the item.
 itemManager.checkOutItem(contentItem);
 
 //Retrieve all the properties on the content item
 IBaseProperty[] allProps = contentItem.getAllProperties();
 for (int i = 0; i < allProps.length; i++)
 {
   //Test if the property a text block property
   if (allProps[i] instanceof ITextBlockProperty)
   {
       String oldValue = "";
       if (contentItem.hasPropertyValue(allProps[i]))
       {
          //Retrieve the old text block value
          oldValue = contentItem.getTextBlockPropertyValue(allProps[i]);
       }
       //Set the new value
       contentItem.setTextBlockPropertyValue(allProps[i], "Updated Value: " + oldValue);
   }
   //Test if the property is an integer property
   else if (allProps[i] instanceof IIntegerProperty)
   {
        int oldValue = 0;
        if (contentItem.hasPropertyValue(allProps[i]))
        {
          oldValue = contentItem.getIntegerPropertyValue(allProps[i]);
        }
        contentItem.setIntegerPropertyValue(allProps[i], 100 + oldValue);
   }
 
   //Test for rest of the property types...
 
 }
 
 //Finally, check-in the item to persist the updated values
 itemManager.checkInItem(contentItem, "Check In Comment");
 
Note: A content item will be automatically deleted if the underlying Data Entry Template has been deleted.

A content item can be indexed and made searchable, if it

  • 1) is published, and
  • 2) at publish time:
  • - has the attached Presentation Template's isSearchable set to true, and
  • - has a portlet associated with the item.
  • A portlet can be associated with a content item directly or indirectly:

  • 1) Directly - Associate a portlet with a content item by setting the portlet ID on the item . The content item and the portlet thus become a Portlet Item.
  • 2) Indirectly - Associate a portlet to one of the item's containing folders by adding the portlet ID to the folder . The folder must contain either a publishable Presentation Template or a content item that has already been associated to the same portlet. The folder can be either the folder containing the item, or any parent folder of that containing folder.
  • Refer to the Administrator Guide for AquaLogic Interaction Publisher for additional details on content item and portlet association.


    Method Summary
     void clearAssociatedPortletID()
              Clears the portlet association for this content item.
     IBaseProperty[] getAllProperties()
              Returns an array of IBaseProperty for all the properties of the IContentItem.
     int getAssociatedPortletID()
              Returns the object ID of the portlet associated with this content item or 0 if there is no portlet association.
     boolean getBooleanPropertyValue(IBaseProperty booleanProperty)
              Returns the value of the specified IBooleanProperty.
     int getCheckedOutUserID()
              Returns the ID of the user who has the IContentItem checked out or throws an IllegalStateException if the IContentItem is not checked out.
     IFolder getContainingFolder()
              Returns the IFolder that contains this content item.
     IDataEntryTemplate getDataEntryTemplate()
              Returns the Data Entry Template for this content item.
     java.util.Date getDatePropertyValue(IBaseProperty dateProperty)
              Returns the value of the specified IDateProperty.
     double getDoublePropertyValue(IBaseProperty doubleProperty)
              Returns the value of the specified IDoubleProperty.
     java.lang.String getEditorURL()
              Returns the URL to edit the content item in Publisher Explorer.
     java.lang.String getFileName(IBaseProperty fileProperty)
              Returns the name of the file for the specified IFileProperty after setFilePropertyValue is called.
     java.io.InputStream getFilePropertyValue(IBaseProperty fileProperty)
              Returns the value of the specified IFileProperty.
     int getImageHeight(IBaseProperty imageProperty)
              Returns the height of the image (in pixels) for the specified IImageProperty.
     java.lang.String getImageName(IBaseProperty imageProperty)
              Returns the name of the image for the specified IImageProperty after setImagePropertyValue is called.
     java.io.InputStream getImagePropertyValue(IBaseProperty imageProperty)
              Returns the value of the specified IImageProperty.
     int getImageWidth(IBaseProperty imageProperty)
              Returns the width of the image (in pixels) for the specified IImageProperty.
     int getIntegerPropertyValue(IBaseProperty integerProperty)
              Returns the value of the specified IIntegerProperty.
     IContentItem[] getItemCollectionPropertyValue(IBaseProperty collectionProperty)
              Returns the value of the specified IItemCollectionProperty.
     IContentItem getItemReferencePropertyValue(IBaseProperty itemRefProperty)
              Returns the value of the specified IItemReferenceProperty.
     java.util.Date getLastCheckedInDate()
              Returns the last date the content item was checked in.
     java.lang.String getLastCheckedInVersionComment()
              Retrieves the latest checked in version comment of the IContentItem.
     java.util.Date getLastModifiedDate()
              Returns the date the content item was last modified.
     java.util.Date getLastPublishedDate()
              Returns the last time the item was published.
     int getLastPublishedUserID()
              Returns the ID of the user who last published the IContentItem or throws an IllegalStateException if the IContentItem has not been published.
     java.lang.String getLatestVersionNumber()
              Retrieves the latest version number of the IContentItem.
     java.lang.String getName()
              Returns the content item name.
     java.lang.String getPreviewURL()
              Returns the URL to preview the content item.
     IBaseProperty getProperty(java.lang.String name)
              Returns an IBaseProperty of the specified name if it exists on the content item.
     java.lang.String getPublishURL()
              Returns the URL to the published content item.
     java.lang.String getSelectionListPropertyValue(IBaseProperty selectionListProperty)
              Returns the value of the specified ISelectionListProperty.
     java.lang.String getTextBlockPropertyValue(IBaseProperty textBlockProperty)
              Returns the value of the specified ITextBlockProperty.
     java.lang.String getTextLinePropertyValue(IBaseProperty textLineProperty)
              Returns the value of the specified ITextLineProperty.
     java.lang.String getUUID()
              Returns the content item UUID.
     boolean hasLastCheckedInDate()
              Returns true if the last checked in date is available otherwise false.
     boolean hasLastModifiedDate()
              Returns true if the last modified date is available otherwise false.
     boolean hasLastPublishedDate()
              Returns true if the last published date is available otherwise returns false.
     boolean hasPropertyValue(IBaseProperty property)
              Returns true if the value of the specified property has been set for this content item, otherwise false.
     boolean isCheckedOut()
              Returns a boolean value indicating whether or not the content item is checked out.
     boolean isExpired()
              Returns a boolean value indicating whether or not the content item is expired.
     boolean isPublishable()
              Returns a boolean indicating whether or not the content item can be published.
     boolean isPublished()
              Returns a boolean value indicating whether or not the content item is currently published.
     void setAssociatedPortletID(int portletID)
              Sets the portlet ID associated with this content item.
     void setBooleanPropertyValue(IBaseProperty booleanProperty, boolean value)
              Updates the value of the IBooleanProperty.
     void setDatePropertyValue(IBaseProperty dateProperty, java.util.Date value)
              Updates the value of the IDateProperty.
     void setDoublePropertyValue(IBaseProperty doubleProperty, double value)
              Updates the value of the IDoubleProperty.
     void setFilePropertyValue(IBaseProperty fileProperty, java.lang.String fileName, java.io.InputStream value)
              Updates the value of the IFileProperty.
     void setImagePropertyValue(IBaseProperty imageProperty, java.lang.String imageName, java.io.InputStream value)
              Updates the value of the IImageProperty.
     void setIntegerPropertyValue(IBaseProperty integerProperty, int value)
              Updates the value of the IIntegerProperty.
     void setItemCollectionPropertyValue(IBaseProperty collectionProperty, IContentItem[] contentItems)
              Updates the value of the IItemCollectionProperty.
     void setItemReferencePropertyValue(IBaseProperty itemRefProperty, IContentItem contentItem)
              Updates the value of the IItemReferenceProperty.
     void setName(java.lang.String name)
              Sets the name for this content item.
     void setSelectionListPropertyValue(IBaseProperty selectionListProperty, java.lang.String selectionListValue)
              Updates the value of the ISelectionListProperty.
     void setTextBlockPropertyValue(IBaseProperty textBlockProperty, java.lang.String value)
              Updates the value of the ITextBlockProperty.
     void setTextLinePropertyValue(IBaseProperty textLineProperty, java.lang.String value)
              Updates the value of the ITextLineProperty.
     

    Method Detail

    clearAssociatedPortletID

    public void clearAssociatedPortletID()
    Clears the portlet association for this content item. The portlet that was previously associated with this content item can be associated to a different content item or Presentation Template after this method is called and the item is persisted.

    An IllegalStateException will be thrown if this method is called on an item that has not been checked out. The portlet disassociation will not be persisted until IContentItemManager.checkInItem is called.

    Calling this method twice in a row on a content item that does not have an associated portlet will not result in an exception.

    Throws:
    java.lang.IllegalStateException - if the content item is not checked out or has been deleted
    See Also:
    setAssociatedPortletID(int), getAssociatedPortletID()

    getAllProperties

    public IBaseProperty[] getAllProperties()
    Returns an array of IBaseProperty for all the properties of the IContentItem. The returned properties are sub-types of IBaseProperty.

    Returns:
    an array of IBaseProperty for all the properties of the IContentItem or an empty array if there are none. The returned array is not ordered.
    Throws:
    java.lang.IllegalStateException - if the item has already been removed

    getAssociatedPortletID

    public int getAssociatedPortletID()
    Returns the object ID of the portlet associated with this content item or 0 if there is no portlet association.

    Returns:
    the portlet object ID associated with this item
    Throws:
    java.lang.IllegalStateException - if the content item has been deleted
    See Also:
    IPresentationTemplate.isSearchable(), setAssociatedPortletID(int), clearAssociatedPortletID()

    getBooleanPropertyValue

    public boolean getBooleanPropertyValue(IBaseProperty booleanProperty)
    Returns the value of the specified IBooleanProperty.

    Parameters:
    booleanProperty - the IBooleanProperty; cannot be null
    Returns:
    the value of the specified IBooleanProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    java.lang.IllegalStateException - if the item has been removed or the value has not been set for the specified property

    getCheckedOutUserID

    public int getCheckedOutUserID()
    Returns the ID of the user who has the IContentItem checked out or throws an IllegalStateException if the IContentItem is not checked out. isCheckedOut can be used to check if the IContentItem is checked out.

    Returns:
    the ID of the user who has the IContentItem checked out
    Throws:
    java.lang.IllegalStateException - if the item has not been persisted, has been removed, or is not checked out

    getContainingFolder

    public IFolder getContainingFolder()
                                throws ContentSecurityException,
                                       ContentException,
                                       java.rmi.RemoteException
    Returns the IFolder that contains this content item.

    Returns:
    the folder that contains this content item
    Throws:
    ContentSecurityException - if the user does not have permission to access the containing folder
    ContentException - if the method call resulted in a Publisher exception
    java.lang.IllegalStateException - if the content item has not been persisted or has already been removed
    java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

    getDataEntryTemplate

    public IDataEntryTemplate getDataEntryTemplate()
                                            throws ContentSecurityException,
                                                   ContentException,
                                                   java.rmi.RemoteException
    Returns the Data Entry Template for this content item. This method will return the Data Entry Template that the content item was created with. Note: A persisted Data Entry Template is required when creating a new content item using IContentItemManager.createContentItem or an IllegalStateException will be thrown.

    Returns:
    the IDataEntryTemplate for this IContentItem
    Throws:
    java.lang.IllegalStateException - if the current content item has not been stored or has already been removed
    ContentException - if the method call resulted in a Publisher exception
    ContentSecurityException - if the user does not have permission to access the content item
    java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

    getDatePropertyValue

    public java.util.Date getDatePropertyValue(IBaseProperty dateProperty)
    Returns the value of the specified IDateProperty.

    Parameters:
    dateProperty - the IDateProperty; cannot be null
    Returns:
    the value of the specified IDateProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    java.lang.IllegalStateException - if the item has been removed or the value has not been set for the specified property

    getDoublePropertyValue

    public double getDoublePropertyValue(IBaseProperty doubleProperty)
    Returns the value of the specified IDoubleProperty.

    Parameters:
    doubleProperty - the IDoubleProperty; cannot be null
    Returns:
    the value of the specified IDoubleProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    java.lang.IllegalStateException - if the item has been removed or the value has not been set for the specified property

    getEditorURL

    public java.lang.String getEditorURL()
    Returns the URL to edit the content item in Publisher Explorer. Note: The returned URL is a non-gatewayed URL.

    Returns:
    the Publisher Explorer URL to edit the item
    Throws:
    java.lang.IllegalStateException - if the item has not been persisted or has already been removed

    getFileName

    public java.lang.String getFileName(IBaseProperty fileProperty)
    Returns the name of the file for the specified IFileProperty after setFilePropertyValue is called.

    See the code sample in setFilePropertyValue for an example of how to retrieve and update a value for an IFileProperty.

    Parameters:
    fileProperty - the file property; cannot be null
    Returns:
    the name of the file for the specified file property
    Throws:
    java.lang.IllegalStateException - if the content item has already been removed
    java.lang.IllegalArgumentException - if the item does not contain the specified property

    getFilePropertyValue

    public java.io.InputStream getFilePropertyValue(IBaseProperty fileProperty)
                                             throws ContentSecurityException,
                                                    ContentException,
                                                    java.rmi.RemoteException
    Returns the value of the specified IFileProperty.

    See the code sample in setFilePropertyValue for an example of how to retrieve and update a value for an IFileProperty.

    Parameters:
    fileProperty - the IFileProperty; cannot be null
    Returns:
    the value of the specified IFileProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    ContentSecurityException - if the user does not have the permission to access the item
    ContentException - if the method call resulted in a Publisher exception
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    java.lang.IllegalStateException - if the item has not been persisted, has been removed, or the value has not been set for the specified property
    java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

    getImageHeight

    public int getImageHeight(IBaseProperty imageProperty)
    Returns the height of the image (in pixels) for the specified IImageProperty. Zero will be returned if no image is set for the property, or if IContentItemManager.checkInItem has not been called to persist the image property value.

    See the code sample in setImagePropertyValue for an example of how to retrieve and update a value for an IImageProperty.

    Parameters:
    imageProperty - the image property; cannot be null
    Returns:
    the image height in pixels
    Throws:
    java.lang.IllegalStateException - if the content item has not been checked in or has already been removed
    java.lang.IllegalArgumentException - if the item does not contain the specified property

    getImageName

    public java.lang.String getImageName(IBaseProperty imageProperty)
    Returns the name of the image for the specified IImageProperty after setImagePropertyValue is called.

    See the code sample in setImagePropertyValue for an example of how to retrieve and update value for an IImageProperty.

    Parameters:
    imageProperty - the image property; cannot be null
    Returns:
    the name of the image for the specified image property
    Throws:
    java.lang.IllegalStateException - if the content item has already been removed
    java.lang.IllegalArgumentException - if the item does not contain the specified property

    getImagePropertyValue

    public java.io.InputStream getImagePropertyValue(IBaseProperty imageProperty)
                                              throws ContentSecurityException,
                                                     ContentException,
                                                     java.rmi.RemoteException
    Returns the value of the specified IImageProperty.

    See the code sample in setImagePropertyValue for an example of how to retrieve and update a value for an IImageProperty.

    Parameters:
    imageProperty - the IImageProperty; cannot be null
    Returns:
    the value of the specified IImageProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    ContentSecurityException - if the user does not have the permission to access the item
    ContentException - if the method call resulted in a Publisher exception
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    java.lang.IllegalStateException - if the item has not been persisted, has been removed, or the value has not been set for the specified property
    java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

    getImageWidth

    public int getImageWidth(IBaseProperty imageProperty)
    Returns the width of the image (in pixels) for the specified IImageProperty. Zero will be returned if no image is set for the property, or if IContentItemManager.checkInItem has not been called to persist the image property value.

    See the code sample in setImagePropertyValue for an example of how to retrieve and update a value for an IImageProperty.

    Parameters:
    imageProperty - the image property; cannot be null
    Returns:
    the image width in pixels
    Throws:
    java.lang.IllegalStateException - if the content item had not been checked in or has already been removed
    java.lang.IllegalArgumentException - if the item does not contain the specified property

    getIntegerPropertyValue

    public int getIntegerPropertyValue(IBaseProperty integerProperty)
    Returns the value of the specified IIntegerProperty.

    Parameters:
    integerProperty - the IIntegerProperty; cannot be null
    Returns:
    the value of the specified IIntegerProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    java.lang.IllegalStateException - if the item has been removed or the value has not been set for the specified property

    getItemCollectionPropertyValue

    public IContentItem[] getItemCollectionPropertyValue(IBaseProperty collectionProperty)
                                                  throws ContentSecurityException,
                                                         ContentException,
                                                         java.rmi.RemoteException
    Returns the value of the specified IItemCollectionProperty.

    See the code sample in setItemCollectionPropertyValue for an example of how to retrieve and update a value for an IItemCollectionProperty.

    Parameters:
    collectionProperty - the IItemCollectionProperty; cannot be null
    Returns:
    the value of the specified IItemCollectionProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    ContentSecurityException - if the user does not have the permission to access the current item
    ContentException - if the method call resulted in a Publisher exception
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    java.lang.IllegalStateException - if the item has not been persisted, has been removed, or the value has not been set for the specified property
    java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

    getItemReferencePropertyValue

    public IContentItem getItemReferencePropertyValue(IBaseProperty itemRefProperty)
                                               throws ContentSecurityException,
                                                      ContentException,
                                                      java.rmi.RemoteException
    Returns the value of the specified IItemReferenceProperty.

    See the code sample in setItemReferencePropertyValue for an example of how to retrieve and update a value for an IItemReferenceProperty.

    Parameters:
    itemRefProperty - the IItemReferenceProperty; cannot be null
    Returns:
    the value of the specified IItemReferenceProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    ContentSecurityException - if the user does not have the permission to access the current item
    ContentException - if the method call resulted in a Publisher exception
    java.lang.IllegalArgumentException - if the item does not contain the specified property.
    java.lang.IllegalStateException - if the item has not been persisted, has been removed, or the value has not been set for the specified property
    java.rmi.RemoteException - if there was a communication problem during the execution of the remote method call

    getLastCheckedInDate

    public java.util.Date getLastCheckedInDate()
    Returns the last date the content item was checked in. The last checked in date is set when the IContentItem is checked in.

    Returns:
    the last date the content item was checked in
    Throws:
    java.lang.IllegalStateException - if the item has not persisted, has been removed, or has never been checked in

    getLastCheckedInVersionComment

    public java.lang.String getLastCheckedInVersionComment()
    Retrieves the latest checked in version comment of the IContentItem. An IllegalStateException will be thrown if the content item has never been checked in.

    Returns:
    the latest checked in version comment of the IContentItem
    Throws:
    java.lang.IllegalStateException - if the item has not been persisted, has been removed, or has never been checked in

    getLastModifiedDate

    public java.util.Date getLastModifiedDate()
    Returns the date the content item was last modified. The last modified date is set when the IContentItem is checked in.

    Returns:
    the date the content item was last modified
    Throws:
    java.lang.IllegalStateException - if the item has never been checked in or has already been removed

    getLastPublishedDate

    public java.util.Date getLastPublishedDate()
    Returns the last time the item was published. The publish time is set when the IContentItem is created on the published target. Use hasLastPublishedDate to determine if a date is available.

    Returns:
    the last time the item was published
    Throws:
    java.lang.IllegalStateException - if the item has not been persisted, has been removed or has not been published

    getLastPublishedUserID

    public int getLastPublishedUserID()
    Returns the ID of the user who last published the IContentItem or throws an IllegalStateException if the IContentItem has not been published. isPublished can be used to check if the IContentItem has been published.

    Returns:
    the ID of the user who last published the IContentItem
    Throws:
    java.lang.IllegalStateException - if the item has not been persisted, has been removed or has not been published

    getLatestVersionNumber

    public java.lang.String getLatestVersionNumber()
    Retrieves the latest version number of the IContentItem. The version number will be "1" for an item that has never been checked in. The initial check-in of a new item will increment the version number to "2".

    Returns:
    the latest version number of the IContentItem
    Throws:
    java.lang.IllegalStateException - if the item has not been persisted or has already been removed

    getName

    public java.lang.String getName()
    Returns the content item name.

    Returns:
    the content item name
    Throws:
    java.lang.IllegalStateException - if the content item has already been removed

    getPreviewURL

    public java.lang.String getPreviewURL()
    Returns the URL to preview the content item. The preview URL will only be valid if IContentItemManager.previewContentItem is called prior to this method.

    Note: The returned URL is a non-gatewayed URL.

    Returns:
    the URL to preview the content item
    Throws:
    java.lang.IllegalStateException - if the content item has not been persisted or has already been removed

    getProperty

    public IBaseProperty getProperty(java.lang.String name)
    Returns an IBaseProperty of the specified name if it exists on the content item. The returned property is a sub-type of IBaseProperty, that is, its actual type will be one of the derived property types, such as ITextLineProperty, IDoubleProperty, etc.

    The parameter name must be the full name of the property, does not support wildcards, will be trimmed of leading and trailing whitespace, and is case-insensitive for comparison.

    Parameters:
    name - the name of the property to retrieve; cannot be null, empty, or longer than 255 characters. The string used for the name will be trimmed of leading and trailing whitespace and is case-insensitive during comparison.
    Returns:
    an IBaseProperty matching the specified name on the content item or null if no such property exists
    Throws:
    java.lang.IllegalStateException - if the content item has already been removed
    See Also:
    getAllProperties()

    getPublishURL

    public java.lang.String getPublishURL()
    Returns the URL to the published content item. The publish URL will only be valid if IContentItemManager.publishContentItem is called prior to this method. If the content item is not currently published an IllegalStateException will be thrown.

    Note: The returned URL is a non-gatewayed URL.

    Returns:
    the URL to the published content item
    Throws:
    java.lang.IllegalStateException - if the content item has not been persisted, has been removed, or is not published

    getSelectionListPropertyValue

    public java.lang.String getSelectionListPropertyValue(IBaseProperty selectionListProperty)
    Returns the value of the specified ISelectionListProperty.

    See the code sample in setSelectionListPropertyValue for an example of how to retrieve and update a value for an ISelectionListProperty.

    Parameters:
    selectionListProperty - the ISelectionListProperty; cannot be null
    Returns:
    the value of the specified ISelectionListProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    java.lang.IllegalStateException - if the item has been removed or the value has not been set for the specified property

    getTextBlockPropertyValue

    public java.lang.String getTextBlockPropertyValue(IBaseProperty textBlockProperty)
    Returns the value of the specified ITextBlockProperty.

    Parameters:
    textBlockProperty - the ITextBlockProperty; cannot be null
    Returns:
    the value of the specified ITextBlockProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    java.lang.IllegalStateException - if the item has been removed or the value has not been set for the specified property

    getTextLinePropertyValue

    public java.lang.String getTextLinePropertyValue(IBaseProperty textLineProperty)
    Returns the value of the specified ITextLineProperty.

    Parameters:
    textLineProperty - the ITextLineProperty; cannot be null
    Returns:
    the value of the specified ITextLineProperty. An IllegalArgumentException will be thrown if content item does not contain the specified property.
    Throws:
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    java.lang.IllegalStateException - if the item has been removed or the value has not been set for the specified property

    getUUID

    public java.lang.String getUUID()
    Returns the content item UUID. This UUID can be used in IContentItemManager.getContentItem. to retrieve the content item.

    Returns:
    the content item UUID
    Throws:
    java.lang.IllegalStateException - if the item has not been persisted or has already been removed

    hasLastCheckedInDate

    public boolean hasLastCheckedInDate()
    Returns true if the last checked in date is available otherwise false.

    Returns:
    true if the last checked in date is available otherwise false
    Throws:
    java.lang.IllegalStateException - if the item has already been removed

    hasLastModifiedDate

    public boolean hasLastModifiedDate()
    Returns true if the last modified date is available otherwise false.

    Returns:
    true if the last modified date is available otherwise false
    Throws:
    java.lang.IllegalStateException - if the item has already been removed

    hasLastPublishedDate

    public boolean hasLastPublishedDate()
    Returns true if the last published date is available otherwise returns false.

    Returns:
    true if the last published date is available otherwise returns false
    Throws:
    java.lang.IllegalStateException - if the content item has been removed

    hasPropertyValue

    public boolean hasPropertyValue(IBaseProperty property)
    Returns true if the value of the specified property has been set for this content item, otherwise false. An IllegalStateException will be thrown if getPropertyValue is called on a property that does not have a value set.

    See the code sample in IContentItem for an example of how to use this method to test for presence of value for different properties.

    Parameters:
    property - the property to be checked for presence of value; cannot be null
    Returns:
    true if the value of the specified property has been set for this content item, otherwise false
    Throws:
    java.lang.IllegalStateException - if the item has already been removed
    java.lang.IllegalArgumentException - if the content item does not contain the specified property

    isCheckedOut

    public boolean isCheckedOut()
    Returns a boolean value indicating whether or not the content item is checked out.

    Returns:
    a boolean value indicating whether or not the content item is checked out
    Throws:
    java.lang.IllegalStateException - if the content item has already been removed

    isExpired

    public boolean isExpired()
    Returns a boolean value indicating whether or not the content item is expired.

    Returns:
    a boolean value indicating whether or not the content item is expired
    Throws:
    java.lang.IllegalStateException - if the content item has already been removed

    isPublishable

    public boolean isPublishable()
    Returns a boolean indicating whether or not the content item can be published. Returns true if the content item has been persisted and the corresponding IDataEntryTemplate has an IPresentationTemplate attached, otherwise returns false.

    Returns:
    a boolean indicating whether or not the content item can be published
    Throws:
    java.lang.IllegalStateException - if the content item has already been removed

    isPublished

    public boolean isPublished()
    Returns a boolean value indicating whether or not the content item is currently published.

    Returns:
    a boolean value indicating whether or not the content item is published
    Throws:
    java.lang.IllegalStateException - if the content item has already been removed

    setAssociatedPortletID

    public void setAssociatedPortletID(int portletID)
    Sets the portlet ID associated with this content item. If a content item is associated with a portlet and the item's attached Presentation Template is searchable, then the item will be indexed and made searchable when it is published.

    Note: The recommended way to associate a portlet with a content item is through the portlet administration settings in the portal.

    An IllegalStateException will be thrown if this method is called on an item that has not been checked out. The content item can only be associated with one portlet ID at a time. If this method is called several times on the same item, the last call will override the previous calls.

    The portlet ID must refer to a valid portlet otherwise a ContentException will be thrown when IContentItemManager.checkInItem is called on the item.

    A portlet can only be associated with one content item or Presentation Template at a time. If the portlet ID is already associated with another content item or Presentation Template, an IllegalStateException will be thrown when IContentItemManager.checkInItem is called on the item.

    The ID of a portlet can be retrieved using methods in com.plumtree.remote.prc.IPortletManager or com.plumtree.remote.prc.IPortletTemplateManager.

    The association will not be persisted until IContentItemManager.checkInItem is called.

    Parameters:
    portletID - the portlet ID to associate with the item
    Throws:
    java.lang.IllegalStateException - if the item is not checked out or has been deleted
    java.lang.IllegalArgumentException - if the portlet ID less than or equal to 0
    See Also:
    IPresentationTemplate.isSearchable(), IFolder.addAssociatedPortletID(int)

    setBooleanPropertyValue

    public void setBooleanPropertyValue(IBaseProperty booleanProperty,
                                        boolean value)
    Updates the value of the IBooleanProperty.

    An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.

    See the code sample in IContentItem class documentation for an example how to modify a property value of different types.

    Parameters:
    booleanProperty - the IBooleanProperty; cannot be null
    value - the new value for the property; cannot be null
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)

    setDatePropertyValue

    public void setDatePropertyValue(IBaseProperty dateProperty,
                                     java.util.Date value)
    Updates the value of the IDateProperty. An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.

    See the code sample in IContentItem class documentation for an example of how to modify a property value of different types.

    Parameters:
    dateProperty - the IDateProperty; cannot be null
    value - the new value for the property; cannot be null
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)

    setDoublePropertyValue

    public void setDoublePropertyValue(IBaseProperty doubleProperty,
                                       double value)
    Updates the value of the IDoubleProperty. An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.

    See the code sample in IContentItem class documentation for an example of how to modify a property value of different types.

    Parameters:
    doubleProperty - the IDoubleProperty; cannot be null
    value - the new value for the property; cannot be null
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)

    setFilePropertyValue

    public void setFilePropertyValue(IBaseProperty fileProperty,
                                     java.lang.String fileName,
                                     java.io.InputStream value)
    Updates the value of the IFileProperty. An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.


    The code sample below shows how to set the IFileProperty value to the content of an existing file.

       FileInputStream content = new FileInputStream("C:\\uploads\\fileContent.doc");
       contentItem.setFilePropertyValue(fileProperty, "fileContent.doc", content);
       // The name of the file can be set to a different file name from the actual file name, such as,
       // contentItem.setFilePropertyValue(fileProperty, "someOtherName.doc", content);
      
       // Checks-in the content item to persist the updated FileProperty value.
       itemManager.checkInItem(contentItem, "Check-in Comment");
      
       // Retrieves the file content and file name after the item is checked in.
       InputStream retrievedContent = incident.getFilePropertyValue(fileProperty);
       String retrievedFileName = contentItem.getFileName(fileProperty);
     

    See the code sample in IContentItem for an example of how to modify a property value of different types.

    Parameters:
    fileProperty - the IFileProperty; cannot be null
    fileName - the name of the file to be uploaded as the value for the specified file property; cannot be null, empty, or longer than 255 characters
    value - the new value for the property; cannot be null
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property, or if the file name is an empty string or longer than 255 characters
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)

    setImagePropertyValue

    public void setImagePropertyValue(IBaseProperty imageProperty,
                                      java.lang.String imageName,
                                      java.io.InputStream value)
    Updates the value of the IImageProperty. An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.


    The code sample below shows how to set the IFileProperty value to the content of an existing file.

       FileInputStream image = new FileInputStream("C:\\uploads\\image.jpg");
       contentItem.setImagePropertyValue(imageProperty, "image.jpg", image);
       // The name of the image can be set to a different name from the actual image name, such as,
       // contentItem.setImagePropertyValue(fileProperty, "someOtherName.jpg", image);
      
       // Checks in the content item to persist the updated ImageProperty value.
       itemManager.checkInItem(contentItem, "Check in Comment");
      
       // Retrieves the image, image name, height and width after the item is checked in.
       InputStream retrievedImage = incident.getImagePropertyValue(imageProperty);
       String retrievedImageName = contentItem.getImageName(imageProperty);
       int imageWidth = contentItem.getImageWidth(imageProperty);
       int imageHeight = contentItem.getImageHeight(imageProperty);
     

    See the code sample in IContentItem for an example of how to modify a property value of different types.

    Parameters:
    imageProperty - the IImageProperty; cannot be null
    imageName - the name of the image to be uploaded as the value of the specified image property; cannot be null, empty, or longer than 255 characters
    value - the new value for the property; cannot be null
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property, or if the image name is an empty string or longer than 255 characters
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)

    setIntegerPropertyValue

    public void setIntegerPropertyValue(IBaseProperty integerProperty,
                                        int value)
    Updates the value of the IIntegerProperty. An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.

    See the code sample in IContentItem class documentation for an example of how to modify a property value of different types.

    Parameters:
    integerProperty - the IIntegerProperty; cannot be null
    value - the new value for the property; cannot be null
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)

    setItemCollectionPropertyValue

    public void setItemCollectionPropertyValue(IBaseProperty collectionProperty,
                                               IContentItem[] contentItems)
    Updates the value of the IItemCollectionProperty. An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.


    The code sample below shows how to retrieve an array of content items and set the value of an IItemCollectionProperty to the retrieved content items.

       // Set the IItemCollectionProperty value to an array of existing Content items,
       // assuming there are one or more content items in the specified folder.
       IContentItem[] items = contentItemManager.getContentItems(folder);
       contentItemManager.checkOutItem(contentItem);
       contentItem.setItemCollectionPropertyValue(itemCollectionProperty, items);
      
       // Check-in the Content item to persist the updated Item Collection property value.
       contentItemManager.checkInItem(contentItem, "Check-in the item with Item Collection Property value updated.");
      
       // Retrieves the value after the item is checked-in.
       IContentItem[] retrievedItemCollectionPropValue = contentItem.getItemCollectionPropertyValue(itemCollectionProperty);
     

    See the code sample in IContentItem for an example of how to modify a property value of different types.

    Parameters:
    collectionProperty - the IItemCollectionProperty; cannot be null
    contentItems - the new collection of content items; cannot be null
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)

    setItemReferencePropertyValue

    public void setItemReferencePropertyValue(IBaseProperty itemRefProperty,
                                              IContentItem contentItem)
    Updates the value of the IItemReferenceProperty. An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.


    The code sample below shows how to retrieve an existing content item by name and set the value of an IItemReferenceProperty to the retrieved content item.

       // Set the ItemReferenceProperty value to another existing Content item,
       // assuming there is another content item named "News" in the specified folder.
       IContentItem newsItem = contentItemManager.getContentItem(folder, "News");
       contentItemManager.checkOutItem(contentItem);
       contentItem.setItemReferencePropertyValue(itemReferenceProperty, newsItem);
      
       // Check-in the Content item to persist the updated Item Reference property value.
       contentItemManager.checkInItem(contentItem, "Check-in the item with Item Reference Property value updated.");
      
       // Retrieves the value after the item is checked-in.
       IContentItem retrievedItemRefValue = contentItem.getItemReferencePropertyValue(itemReferenceProperty);
     

    See the code sample in IContentItem for an example of how to modify a property value of different types.

    Parameters:
    itemRefProperty - the IItemReferenceProperty; cannot be null
    contentItem - the content item to create a reference to; cannot be null
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)

    setName

    public void setName(java.lang.String name)
    Sets the name for this content item. To update the name of an existing, persisted item, IContentItemManager.checkOutItem must be called prior to this method, otherwise an IllegalStateException will be thrown. The updated name will not be persisted until IContentItemManager.checkInItem is called.

    Parameters:
    name - the name of the content item; cannot be null, empty, or longer than 255 characters. The string used for the name will be trimmed of leading and trailing whitespace when it is stored and is case-insensitive during name comparison.
    Throws:
    java.lang.IllegalStateException - if the content item has already been removed, or is not checked out
    java.lang.IllegalArgumentException - if the name is an empty string or longer than 255 characters

    setSelectionListPropertyValue

    public void setSelectionListPropertyValue(IBaseProperty selectionListProperty,
                                              java.lang.String selectionListValue)
    Updates the value of the ISelectionListProperty. The new value should be an existing string value in the selection list associated with the ISelectionListProperty otherwise an IllegalArgumentException will be thrown when the content item is checked in.

    An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.


    The code sample below shows how to create an 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);
     

    Also see the code sample in IContentItem for an example of how to modify a property value of different types.

    Parameters:
    selectionListProperty - the ISelectionListProperty; cannot be null
    selectionListValue - the new value for the property which is an existing value in the selection list associated with the ISelectionListProperty; cannot be null, an empty string, or longer than 255 characters
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property or the value is an empty string or longer than 255 characters
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)

    setTextBlockPropertyValue

    public void setTextBlockPropertyValue(IBaseProperty textBlockProperty,
                                          java.lang.String value)
    Updates the value of the ITextBlockProperty. This method takes in an HTML string, which can be written manually or obtained using a Rich Text Control tool.

    For example, in order to generate the text below:

    "Hello World"

    where "World" is in black and bolded, the HTML string can be set as follow:

    textBlockProperty.setTextBlockProperty("Hello <strong><font color=\"#000000\">World</font></strong>");

    An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.

    See the code sample in IContentItem class documentation for an example of how to modify a property value of different types.

    Parameters:
    textBlockProperty - the ITextBlockProperty; cannot be null
    value - the new value for the property; cannot be null
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)

    setTextLinePropertyValue

    public void setTextLinePropertyValue(IBaseProperty textLineProperty,
                                         java.lang.String value)
    Updates the value of the ITextLineProperty. An IllegalStateException 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 IllegalArgumentException will be thrown when IContentItemManager.checkInItem is called.

    See the code sample in IContentItem class documentation for an example of how to modify a property value of different types.

    Parameters:
    textLineProperty - the ITextLineProperty; cannot be null
    value - the new value for the property; cannot be null or longer than 255 characters
    Throws:
    java.lang.IllegalStateException - if the item has already been removed or the item is not checked out
    java.lang.IllegalArgumentException - if the item does not contain the specified property, or the value is a string longer than 255 characters
    See Also:
    IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)


    For additional information on the Oracle® WebCenter Interaction Development Kit, including tutorials, blogs, code samples and more, see the Oracle Technology Network (http://www.oracle.com/technology/index.html).

    Copyright ©2010 Oracle® Corporation. All Rights Reserved.