com.ibm.mm.sdk.server
Class DKDatastoreExtICM
- java.lang.Object
-
- com.ibm.mm.sdk.server.DKDatastoreExtICM
-
- All Implemented Interfaces:
- dkDatastoreExt
public class DKDatastoreExtICM extends java.lang.ObjectDKDatastoreExtICM - Extension of DKDatastoreICM that provides document versioning and checkout/checkin capabilities. This class wraps a DKDatastoreICM instance and adds version control functionality following the IBM Content Manager SDK extension pattern.
-
-
Constructor Summary
Constructors Constructor and Description DKDatastoreExtICM(CM8DocumentService documentService)Alternative constructor that accepts a CM8DocumentService directly.DKDatastoreExtICM(DKDatastoreICM datastore)Constructor that wraps an existing DKDatastoreICM instance to provide extended versioning capabilities.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddLink(DKLink link)Default implementation that throwsUnsupportedOperationException.voidaddToFolder(dkDataObject folderObj, dkDataObject memberObj)Adds a document to a folder, creating a ReferentialContainmentRelationship.java.lang.StringcheckedOutUserid(DKDDO ddo)voidcheckIn(dkDataObject item)Checks in a document, creating a new version.voidcheckOut(dkDataObject item)Checks out a document for editing.DKSequentialCollectiondeleteItems(java.util.List<java.lang.String> itemIds, DKNVPair[] options)Deletes multiple items (documents/folders) from the object store.DKDatastoreICMgetBaseDatastore()Gets the base datastore instance.dkDatastoregetDatastore()DKSequentialCollectiongetFoldersContainingDDO(dkDataObject ddo)java.lang.StringgetName()booleanisCheckedOut(DKDDO ddo)voidmoveToFolder(dkCollection members, dkDataObject oldFolder, dkDataObject newFolder)voidmoveToFolder(dkCollection members, dkDataObject oldFolder, dkDataObject newFolder, java.lang.String linkType, int options)voidmoveToFolder(dkDataObject member, dkDataObject oldFolder, dkDataObject newFolder)voidremoveLink(DKLink link)Default implementation that throwsUnsupportedOperationException.voidsaveLinkRemoval(com.filenet.api.core.ReferentialContainmentRelationship relationship)com.filenet.api.core.ReferentialContainmentRelationshipunfileLink(DKLink link)
-
-
-
Constructor Detail
-
DKDatastoreExtICM
public DKDatastoreExtICM(DKDatastoreICM datastore)
Constructor that wraps an existing DKDatastoreICM instance to provide extended versioning capabilities.- Parameters:
datastore- The base datastore to extend
-
DKDatastoreExtICM
public DKDatastoreExtICM(CM8DocumentService documentService)
Alternative constructor that accepts a CM8DocumentService directly.- Parameters:
documentService- The document service to use
-
-
Method Detail
-
getBaseDatastore
public DKDatastoreICM getBaseDatastore()
Gets the base datastore instance.- Returns:
- The wrapped DKDatastoreICM instance, or null if created with documentService
-
checkedOutUserid
public java.lang.String checkedOutUserid(DKDDO ddo) throws DKException
- Throws:
DKException
-
addLink
public void addLink(DKLink link) throws DKException, java.lang.Exception
Default implementation that throwsUnsupportedOperationException. Subclasses must override this method to provide actual link addition functionality.- Specified by:
addLinkin interfacedkDatastoreExt- Parameters:
link- the link to add- Throws:
DKException- if the operation failsjava.lang.Exception- if an unexpected error occursjava.lang.UnsupportedOperationException- always, unless overridden
-
removeLink
public void removeLink(DKLink link) throws DKException, java.lang.Exception
Default implementation that throwsUnsupportedOperationException. Subclasses must override this method to provide actual link removal functionality.- Specified by:
removeLinkin interfacedkDatastoreExt- Parameters:
link- the link to remove- Throws:
DKException- if the operation failsjava.lang.Exception- if an unexpected error occursjava.lang.UnsupportedOperationException- always, unless overridden
-
unfileLink
public com.filenet.api.core.ReferentialContainmentRelationship unfileLink(DKLink link) throws DKException, java.lang.Exception
- Throws:
DKExceptionjava.lang.Exception
-
saveLinkRemoval
public void saveLinkRemoval(com.filenet.api.core.ReferentialContainmentRelationship relationship) throws DKException, java.lang.Exception- Throws:
DKExceptionjava.lang.Exception
-
addToFolder
public void addToFolder(dkDataObject folderObj, dkDataObject memberObj) throws DKException, java.lang.Exception, DKUsageError
Adds a document to a folder, creating a ReferentialContainmentRelationship. This mimics the CM8 addToFolder operation using FileNet P8 API. Delegates to the FileNet layer which implements: folder.file(document, AutoUniqueName, name, DefineSecurityParentage).save(RefreshMode)- Parameters:
folderObj- The folder to add the document to (must be a dkDataObject containing a Folder)memberObj- The document to add (must be a dkDataObject containing a Document)- Throws:
DKException- If the operation failsjava.lang.Exception- If an unexpected error occursDKUsageError- If parameters are invalid
-
checkIn
public void checkIn(dkDataObject item) throws DKException, java.lang.Exception
Checks in a document, creating a new version. This mimics the CM8 checkIn operation using FileNet P8 API. The document must have been previously checked out. This operation: 1. Validates the document is checked out 2. Saves any pending changes 3. Checks in the document, creating a new version 4. Releases the checkout reservation- Parameters:
item- The document to check in (must be a dkDataObject containing a Document)- Throws:
DKException- If the operation fails or document is not checked outjava.lang.Exception- If an unexpected error occurs
-
checkOut
public void checkOut(dkDataObject item) throws DKException, java.lang.Exception
Checks out a document for editing. This mimics the CM8 checkOut operation using FileNet P8 API. This operation: 1. Creates a checkout reservation on the document 2. Locks the document for exclusive editing 3. Returns a reservation object that can be modified 4. Updates the dkDataObject with the reservation document- Parameters:
item- The document to check out (must be a dkDataObject containing a Document)- Throws:
DKException- If the operation fails or document is already checked outjava.lang.Exception- If an unexpected error occurs
-
isCheckedOut
public boolean isCheckedOut(DKDDO ddo) throws DKException
- Throws:
DKException
-
deleteItems
public DKSequentialCollection deleteItems(java.util.List<java.lang.String> itemIds, DKNVPair[] options) throws DKException, java.lang.Exception
Deletes multiple items (documents/folders) from the object store. This method performs batch deletion of objects by their IDs.- Parameters:
itemIds- List of object IDs to deleteoptions- Optional parameters for deletion (currently unused)- Returns:
- DKSequentialCollection containing successfully deleted object IDs
- Throws:
DKException- if itemIds is null/empty or deletion failsjava.lang.Exception
-
getName
public java.lang.String getName()
-
getFoldersContainingDDO
public DKSequentialCollection getFoldersContainingDDO(dkDataObject ddo) throws DKUsageError, java.lang.Exception
- Throws:
DKUsageErrorjava.lang.Exception
-
getDatastore
public dkDatastore getDatastore() throws java.lang.Exception
- Throws:
java.lang.Exception
-
moveToFolder
public void moveToFolder(dkCollection members, dkDataObject oldFolder, dkDataObject newFolder) throws DKUsageError, java.lang.Exception
- Throws:
DKUsageErrorjava.lang.Exception
-
moveToFolder
public void moveToFolder(dkCollection members, dkDataObject oldFolder, dkDataObject newFolder, java.lang.String linkType, int options) throws DKUsageError, java.lang.Exception
- Throws:
DKUsageErrorjava.lang.Exception
-
moveToFolder
public void moveToFolder(dkDataObject member, dkDataObject oldFolder, dkDataObject newFolder) throws DKUsageError, java.lang.Exception
- Throws:
DKUsageErrorjava.lang.Exception
-
-