Class DKParts
- java.lang.Object
-
- com.ibm.mm.sdk.common.DKSequentialCollection
-
- com.ibm.mm.sdk.common.DKParts
-
- All Implemented Interfaces:
- dkCollection, java.io.Serializable
public class DKParts extends DKSequentialCollection implements java.io.Serializable
Collection class for managing document content parts (LOBs) in CM8.DKParts extends
DKSequentialCollectionto provide specialized functionality for managing content elements (Large Objects/LOBs) associated with a document. It wraps FileNet's ContentElementList and provides CM8-style access to document content.Key Features:
- Manages document content elements (LOBs)
- Automatic document checkout/checkin for content modifications
- Wraps FileNet ContentElementList for CM8 compatibility
- Supports adding and removing content parts
- Lazy loading of existing content from documents
Usage Pattern:
DKDDO document = datastore.createDDO("Document"); DKParts parts = new DKParts(document, datastore); DKLobICM lob = new DKLobICM(contentBytes, "application/pdf", datastore); parts.addElement(lob); // Or use addMember for immediate persistence parts.addMember(document, lob);- See Also:
DKSequentialCollection,DKLobICM,DKDDO,DKDatastoreICM, Serialized Form
-
-
Field Summary
-
Fields inherited from class com.ibm.mm.sdk.common.DKSequentialCollection
associatedAttrName, currentPosition, fileNetCollection, items, name, owner
-
-
Constructor Summary
Constructors Constructor and Description DKParts(DKDDO parentDocument, DKDatastoreICM datastore)Constructs a new DKParts collection for the specified document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddElement(java.lang.Object element)Adds an element to the collection.voidaddMember(DKDDO parentDoc, DKLobICM element)Adds a content element and immediately persists the changes.com.filenet.api.collection.ContentElementListgetContentElementList()Gets the underlying FileNet ContentElementList.DKDDOgetParentDocument()Gets the parent document that owns this content collection.voidremoveAllElements()Removes all content elements from the collection and persists the changes.-
Methods inherited from class com.ibm.mm.sdk.common.DKSequentialCollection
addAllElements, cardinality, createIterator, getAssociatedAttrName, getFileNetCollection, getName, getOwner, insertElementAt, nextElement, removeElementAt, replaceElementAt, reset, retrieveElementAt, setAssociatedAttrName, setFileNetCollection, setName, setOwner
-
-
-
-
Constructor Detail
-
DKParts
public DKParts(DKDDO parentDocument, DKDatastoreICM datastore)
Constructs a new DKParts collection for the specified document.Initializes the content element list by loading any existing content from the document or creating a new empty list. The document is automatically checked out if needed for content modifications.
- Parameters:
parentDocument- the parent document that owns this content collectiondatastore- the datastore instance for content operations
-
-
Method Detail
-
getParentDocument
public DKDDO getParentDocument()
Gets the parent document that owns this content collection.- Returns:
- the parent DKDDO document
-
getContentElementList
public com.filenet.api.collection.ContentElementList getContentElementList()
Gets the underlying FileNet ContentElementList.- Returns:
- the FileNet content element list
-
addElement
public void addElement(java.lang.Object element) throws DKUsageErrorAdds an element to the collection.- Specified by:
addElementin interfacedkCollection- Overrides:
addElementin classDKSequentialCollection- Parameters:
element- the element to add to the collection- Throws:
DKUsageError- if the element is null or cannot be added
-
addMember
public void addMember(DKDDO parentDoc, DKLobICM element) throws DKUsageError, DKException
Adds a content element and immediately persists the changes.This method adds the LOB element to the collection, then checks in and saves the document to persist the changes immediately. Use this for single additions. For bulk operations, use
addElement(Object)followed by a manual save.- Parameters:
parentDoc- the parent documentelement- the LOB element to add- Throws:
DKUsageError- if the operation failsDKException- if persistence fails
-
removeAllElements
public void removeAllElements() throws DKUsageErrorRemoves all content elements from the collection and persists the changes.This method clears all LOB elements, creates a new empty content list, and immediately persists the changes by checking in and saving the document.
- Specified by:
removeAllElementsin interfacedkCollection- Overrides:
removeAllElementsin classDKSequentialCollection- Throws:
DKUsageError- if the content element list is not initialized
-
-