|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
An IContentItem represents a content item. It manages property
value modification and retrieval, and encapulates a content item's meta-data.
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
then modify property values with get/setPropertyValue
and then finally persist the modifications with
IContentItemManager.checkInItem.
For information about the conditions that make a content item searchable
in the Search Server, 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
isSearchable
set to true, andsetting the portlet ID on the item .
The content item and the portlet thus become a Portlet Item.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.
| 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 Content Server 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 last checked-in date is available otherwise false. |
boolean |
hasLastModifiedDate()
Returns true if last modified date is available otherwise false. |
boolean |
hasLastPublishedDate()
Returns true if 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 |
public void clearAssociatedPortletID()
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.
java.lang.IllegalStateException - if the content item is not checked-out or has been deleted.setAssociatedPortletID(int),
getAssociatedPortletID()public IBaseProperty[] getAllProperties()
IBaseProperty for all
the properties of the IContentItem. The
returned properties are sub-types of IBaseProperty.
IBaseProperty for all the properties of the IContentItem
or an empty array if there are none. The returned array is not ordered.
java.lang.IllegalStateException - if the item has already been removed.public int getAssociatedPortletID()
java.lang.IllegalStateException - if the content item has been deleted.IPresentationTemplate.isSearchable(),
setAssociatedPortletID(int),
clearAssociatedPortletID()public boolean getBooleanPropertyValue(IBaseProperty booleanProperty)
IBooleanProperty.
booleanProperty - the IBooleanProperty; cannot be null.
IBooleanProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
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.public int getCheckedOutUserID()
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.
IContentItem checked-out.
java.lang.IllegalStateException - if the item has not
been persisted, has been removed or is not checked-out.
public IFolder getContainingFolder()
throws ContentSecurityException,
ContentException,
java.rmi.RemoteException
IFolder that contains this content item.
folder that contains this content item.
ContentSecurityException - if the user does not have
permission to access the containing folder.
ContentException - if the method call resulted in a Content Server 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.
public IDataEntryTemplate getDataEntryTemplate()
throws ContentSecurityException,
ContentException,
java.rmi.RemoteException
IContentItemManager.createContentItem
or an IllegalStateException will be thrown.
IDataEntryTemplate for
this IContentItem.
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 Content Server 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.public java.util.Date getDatePropertyValue(IBaseProperty dateProperty)
IDateProperty.
dateProperty - the IDateProperty; cannot be null.
IDateProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
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.public double getDoublePropertyValue(IBaseProperty doubleProperty)
IDoubleProperty.
doubleProperty - the IDoubleProperty; cannot be null.
IDoubleProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
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.public java.lang.String getEditorURL()
java.lang.IllegalStateException - if the item has not been persisted
or has already been removed.public java.lang.String getFileName(IBaseProperty fileProperty)
IFileProperty
after setFilePropertyValue
is called.
See code sample in setFilePropertyValue
on how to retrieve and update value for an IFileProperty.
fileProperty - the file property;
cannot be null.
java.lang.IllegalStateException - if the content item
has already been removed.
java.lang.IllegalArgumentException - if the item does not contain
the specified property.
public java.io.InputStream getFilePropertyValue(IBaseProperty fileProperty)
throws ContentSecurityException,
ContentException,
java.rmi.RemoteException
IFileProperty.
See code sample in setFilePropertyValue
on how to retrieve and update value for an IFileProperty.
fileProperty - the IFileProperty; cannot be null.
IFileProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
ContentSecurityException - if the user does not have the permission to access the item.
ContentException - if the method call resulted in a Content Server 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.public int getImageHeight(IBaseProperty imageProperty)
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 code sample in setImagePropertyValue
on how to retrieve and update value for an IImageProperty.
imageProperty - the image property;
cannot be null.
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.public java.lang.String getImageName(IBaseProperty imageProperty)
IImageProperty
after setImagePropertyValue
is called.
See code sample in setImagePropertyValue
on how to retrieve and update value for an IImageProperty.
imageProperty - the image property;
cannot be null.
java.lang.IllegalStateException - if the content item
has already been removed.
java.lang.IllegalArgumentException - if the item does not contain
the specified property.
public java.io.InputStream getImagePropertyValue(IBaseProperty imageProperty)
throws ContentSecurityException,
ContentException,
java.rmi.RemoteException
IImageProperty.
See code sample in setImagePropertyValue
on how to retrieve and update value for an IImageProperty.
imageProperty - the IImageProperty; cannot be null.
IImageProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
ContentSecurityException - if the user does not have the permission to access the item.
ContentException - if the method call resulted in a Content Server 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.public int getImageWidth(IBaseProperty imageProperty)
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 code sample in setImagePropertyValue
on how to retrieve and update value for an IImageProperty.
imageProperty - the image property;
cannot be null.
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.public int getIntegerPropertyValue(IBaseProperty integerProperty)
IIntegerProperty.
integerProperty - the IIntegerProperty; cannot be null.
IIntegerProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
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.
public IContentItem[] getItemCollectionPropertyValue(IBaseProperty collectionProperty)
throws ContentSecurityException,
ContentException,
java.rmi.RemoteException
IItemCollectionProperty.
See code sample in setItemCollectionPropertyValue
on how to retrieve and update value for an IItemCollectionProperty.
collectionProperty - the IItemCollectionProperty; cannot be null.
IItemCollectionProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
ContentSecurityException - if the user does not have the permission to access the current item.
ContentException - if the method call resulted in a Content Server 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.
public IContentItem getItemReferencePropertyValue(IBaseProperty itemRefProperty)
throws ContentSecurityException,
ContentException,
java.rmi.RemoteException
IItemReferenceProperty.
See code sample in setItemReferencePropertyValue
on how to retrieve and update value for an IItemReferenceProperty.
itemRefProperty - the IItemReferenceProperty; cannot be null.
IItemReferenceProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
ContentSecurityException - if the user does not have the permission to access the current item.
ContentException - if the method call resulted in a Content Server 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.public java.util.Date getLastCheckedInDate()
IContentItem is checked-in.
java.lang.IllegalStateException - if the item has not
persisted, has been removed, or has never been checked-in.public java.lang.String getLastCheckedInVersionComment()
IContentItem.
An IllegalStateException
will be thrown if the content item has never been checked-in.
IContentItem.
java.lang.IllegalStateException - if the item has not
been persisted, has been removed, or has never been checked-in.public java.util.Date getLastModifiedDate()
IContentItem is checked-in.
java.lang.IllegalStateException - if the item has never been checked-in
or has already been removed.public java.util.Date getLastPublishedDate()
IContentItem is created on the published target.
Use hasLastPublishedDate
to determine if a date is available.
java.lang.IllegalStateException - if the item
has not been persisted, has been removed or has not been published.public int getLastPublishedUserID()
IContentItem or
throws an IllegalStateException
if the IContentItem has not been published.
isPublished can be used to check if the
IContentItem has been published.
IContentItem.
java.lang.IllegalStateException - if the item has not
been persisted, has been removed or has not been published.public java.lang.String getLatestVersionNumber()
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".
IContentItem.
java.lang.IllegalStateException - if the item has not
been persisted or has already been removed.public java.lang.String getName()
java.lang.IllegalStateException - if the content item
has already been removed.public java.lang.String getPreviewURL()
IContentItemManager.previewContentItem
is called prior to this method.
Note: The returned URL is a non-gatewayed URL.
java.lang.IllegalStateException - if the content item
has not been persisted or has already been removed.public IBaseProperty getProperty(java.lang.String name)
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 has to 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.
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.
IBaseProperty matching the specified name
on the content item or null if no such property exists.
java.lang.IllegalStateException - if the content item has already been removed.getAllProperties()public java.lang.String getPublishURL()
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.
java.lang.IllegalStateException - if the content item
has not been persisted, has been removed, or is not published.public java.lang.String getSelectionListPropertyValue(IBaseProperty selectionListProperty)
ISelectionListProperty.
See code sample in setSelectionListPropertyValue
on how to retrieve and update value for an ISelectionListProperty.
selectionListProperty - the ISelectionListProperty; cannot be null.
ISelectionListProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
ContentSecurityException - if the user does not have the permission to access the item.
ContentException - if the method call resulted in a Content Server exception.
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.
java.rmi.RemoteException - if there was a communication
problem during the execution of the remote method call.public java.lang.String getTextBlockPropertyValue(IBaseProperty textBlockProperty)
ITextBlockProperty.
textBlockProperty - the ITextBlockProperty; cannot be null.
ITextBlockProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
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.public java.lang.String getTextLinePropertyValue(IBaseProperty textLineProperty)
ITextLineProperty.
textLineProperty - the ITextLineProperty; cannot be null.
ITextLineProperty. An
IllegalArgumentException will be thrown if content item does not contain the specified property.
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.public java.lang.String getUUID()
IContentItemManager.getContentItem.
to retrieve the content item.
java.lang.IllegalStateException - if the item has not been
persisted or has already been removed.public boolean hasLastCheckedInDate()
true if last checked-in date is available otherwise false.
true if last checked-in date is available otherwise false.
java.lang.IllegalStateException - if the item has already been removed.public boolean hasLastModifiedDate()
true if last modified date is available otherwise false.
true if last modified date is available otherwise false.
java.lang.IllegalStateException - if the item has already been removed.public boolean hasLastPublishedDate()
true if last published date is available otherwise returns false.
true if last published date is available otherwise returns false.
java.lang.IllegalStateException - if the content item has been removed.public boolean hasPropertyValue(IBaseProperty property)
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 code sample in IContentItem class documentation
on how to use this method to test for presence of value for different properties.
property - the property to be checked for presence of value;
cannot be null.
true if the value of the specified property has been
set for this content item otherwise false.
java.lang.IllegalStateException - if the item has already been removed.
java.lang.IllegalArgumentException - if the content item does not
contain the specified property.public boolean isCheckedOut()
java.lang.IllegalStateException - if the content item has already been removed.public boolean isExpired()
java.lang.IllegalStateException - if the content item has already been
removed.public boolean isPublishable()
true if the content item has been persisted
and the corresponding IDataEntryTemplate
has an IPresentationTemplate attached, otherwise
returns false.
java.lang.IllegalStateException - if the content item has already been removed.public boolean isPublished()
java.lang.IllegalStateException - if the content item has already been
removed.public void setAssociatedPortletID(int portletID)
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.
portletID - the portlet ID to associate with the item.
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.IPresentationTemplate.isSearchable(),
IFolder.addAssociatedPortletID(int)
public void setBooleanPropertyValue(IBaseProperty booleanProperty,
boolean value)
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 code sample in IContentItem class documentation
on how to modify property value of different types.
booleanProperty - the IBooleanProperty; cannot be null.value - the new value for the property; cannot be null.
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.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)
public void setDatePropertyValue(IBaseProperty dateProperty,
java.util.Date value)
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 code sample in IContentItem class documentation
on how to modify property value of different types.
dateProperty - the IDateProperty; cannot be null.value - the new value for the property; cannot be null.
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.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)
public void setDoublePropertyValue(IBaseProperty doubleProperty,
double value)
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 code sample in IContentItem class documentation
on how to modify property value of different types.
doubleProperty - the IDoubleProperty; cannot be null.value - the new value for the property; cannot be null.
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.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)
public void setFilePropertyValue(IBaseProperty fileProperty,
java.lang.String fileName,
java.io.InputStream value)
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.
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 code sample in IContentItem class documentation
on how to modify property value of different types.
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.
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.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)
public void setImagePropertyValue(IBaseProperty imageProperty,
java.lang.String imageName,
java.io.InputStream value)
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.
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 code sample in IContentItem class documentation
on how to modify property value of different types.
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.
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.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)
public void setIntegerPropertyValue(IBaseProperty integerProperty,
int value)
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 code sample in IContentItem class documentation
on how to modify property value of different types.
integerProperty - the IIntegerProperty; cannot be null.value - the new value for the property; cannot be null.
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.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)
public void setItemCollectionPropertyValue(IBaseProperty collectionProperty,
IContentItem[] contentItems)
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.
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 code sample in
IContentItem class documentation
on how to modify property value of different types.
collectionProperty - the IItemCollectionProperty; cannot be null.contentItems - the new collections of content items; cannot be null.
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.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)
public void setItemReferencePropertyValue(IBaseProperty itemRefProperty,
IContentItem contentItem)
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.
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 code sample in
IContentItem class documentation
on how to modify property value of different types.
itemRefProperty - the IItemReferenceProperty; cannot be null.contentItem - the content item to create a reference to; cannot be null.
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.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)public void setName(java.lang.String name)
IContentItemManager.checkOutItem
needs to be called prior to this method, otherwise an IllegalStateException will be thrown.
The updated name will not be persisted until
IContentItemManager.checkInItem is called.
name - the name of the content item
The name 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.
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.
public void setSelectionListPropertyValue(IBaseProperty selectionListProperty,
java.lang.String selectionListValue)
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.
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 code sample in IContentItem class documentation
on how to modify property value of different types.
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.
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 an empty string or longer than 255 characters.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)
public void setTextBlockPropertyValue(IBaseProperty textBlockProperty,
java.lang.String value)
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 code sample in IContentItem class documentation
on how to modify property value of different types.
textBlockProperty - the ITextBlockProperty; cannot be null.value - the new value for the property; cannot be null.
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.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)
public void setTextLinePropertyValue(IBaseProperty textLineProperty,
java.lang.String value)
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 code sample in IContentItem class documentation
on how to modify property value of different types.
textLineProperty - the ITextLineProperty; cannot be null.value - the new value for the property; cannot be null or longer than 255 characters.
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
value is a string longer than 255 characters.IContentItemManager.checkInItem(com.plumtree.remote.prc.content.item.IContentItem, java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright ©2007 BEA Systems, Inc. All Rights Reserved.