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.Object
    DKDatastoreExtICM - 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 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
      • addLink

        public void addLink(DKLink link)
                     throws DKException,
                            java.lang.Exception
        Default implementation that throws UnsupportedOperationException. Subclasses must override this method to provide actual link addition functionality.
        Specified by:
        addLink in interface dkDatastoreExt
        Parameters:
        link - the link to add
        Throws:
        DKException - if the operation fails
        java.lang.Exception - if an unexpected error occurs
        java.lang.UnsupportedOperationException - always, unless overridden
      • removeLink

        public void removeLink(DKLink link)
                        throws DKException,
                               java.lang.Exception
        Default implementation that throws UnsupportedOperationException. Subclasses must override this method to provide actual link removal functionality.
        Specified by:
        removeLink in interface dkDatastoreExt
        Parameters:
        link - the link to remove
        Throws:
        DKException - if the operation fails
        java.lang.Exception - if an unexpected error occurs
        java.lang.UnsupportedOperationException - always, unless overridden
      • unfileLink

        public com.filenet.api.core.ReferentialContainmentRelationship unfileLink(DKLink link)
                                                                           throws DKException,
                                                                                  java.lang.Exception
        Throws:
        DKException
        java.lang.Exception
      • saveLinkRemoval

        public void saveLinkRemoval(com.filenet.api.core.ReferentialContainmentRelationship relationship)
                             throws DKException,
                                    java.lang.Exception
        Throws:
        DKException
        java.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 fails
        java.lang.Exception - If an unexpected error occurs
        DKUsageError - 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 out
        java.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 out
        java.lang.Exception - If an unexpected error occurs
      • 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 delete
        options - Optional parameters for deletion (currently unused)
        Returns:
        DKSequentialCollection containing successfully deleted object IDs
        Throws:
        DKException - if itemIds is null/empty or deletion fails
        java.lang.Exception
      • getName

        public java.lang.String getName()
      • getDatastore

        public dkDatastore getDatastore()
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
Copyright © 2024 IBM Corporation

Copyright © 2024 IBM Corporation. All rights reserved.