Plumtree EDK (Enterprise Web Development Kit) 5.4.0

IContentItemManager.CopyContentItem Method 

Copies an IContentItem.

IContentItem CopyContentItem(
   IContentItem contentItem,
   string name
);

Parameters

contentItem
The content item to copy; cannot be null.
name
The name of the copied 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.

Return Value

A new content item that is a copy of the original item with the new name.

Remarks

Creates a copy of the an IContentItem with a new name in the same IFolder as the passed in content item.

The copied item will be checked-in and will have a new version number and version history.

// Create a new content item name from an existing, persisted item
string nameOfCopy = originalContentItem.Name + " Copy";
IContentItem copyOfItem = contentItemManager.CopyContentItem(originalContentItem, nameOfCopy);
// Now a copy of the item exists in the same folder

Exceptions

Exception Type Condition
ContentSecurityException The user does not have permission to copy the item.
NameAlreadyInUseException If there is already a content item with the given name in the same folder.
ContentException The method call resulted in a Content Server exception.
InvalidOperationException The content item to be copied has not been persisted or has already been removed.
SoapException There was a communication problem during the execution of the remote method call.
ArgumentException The name is an empty string or longer than 255 characters.

See Also

IContentItemManager Interface | Plumtree.Remote.PRC.Content.Item Namespace