com.ibm.mm.sdk.common

Class DKFolder

  • All Implemented Interfaces:
    dkCollection, java.io.Serializable


    public class DKFolder
    extends DKSequentialCollection
    implements java.io.Serializable
    Represents a folder in the CM8 content management system.

    A folder is a container that can hold documents and other folders, providing hierarchical organization of content. This class extends DKSequentialCollection to provide collection-like operations for managing folder contents.

    Folders support operations such as:

    • Adding members (documents or subfolders)
    • Removing members
    • Clearing all contents

    All folder operations are persisted to the underlying FileNet P8 repository.

    See Also:
    DKSequentialCollection, DKDDO, Serialized Form
    • Constructor Detail

      • DKFolder

        public DKFolder(DKDDO parentFolderDDO)
        Constructs a new DKFolder associated with a parent folder DDO.
        Parameters:
        parentFolderDDO - the parent folder data object
    • Method Detail

      • addElement

        public void addElement(java.lang.Object element)
                        throws DKUsageError
        Adds an element to this folder.

        The element must be a DKDDO instance representing a document or subfolder. The addition is persisted to the repository.

        Specified by:
        addElement in interface dkCollection
        Overrides:
        addElement in class DKSequentialCollection
        Parameters:
        element - the element to add (must be a DKDDO instance)
        Throws:
        DKUsageError - if the element is null, not a DKDDO instance, or the folder is not initialized
      • removeMember

        public void removeMember(DKDDO ddoFolder,
                                 DKDDO member)
                          throws DKUsageError,
                                 DKException
        Removes a member from the specified folder.

        The member must be a DKDDO instance. The removal is persisted to the repository.

        Parameters:
        ddoFolder - the folder from which to remove the member
        member - the member to remove (must be a DKDDO instance)
        Throws:
        DKUsageError - if the member is null, not a DKDDO instance, or the folder is not initialized
        DKException - if a datastore error occurs
      • addMember

        public void addMember(DKDDO folder,
                              DKDDO member)
                       throws DKUsageError,
                              DKException
        Add a new member to this folder and reflects the results immediately in the datastore, i.e. make it persistent. At the end of the operation, the new member will be in this DKFolder collection in-memory, as well as in the persistent folder representation in the datastore.

        The member must exist (has been created) in the datastore before it can be added to a folder. If the subclass of dkDatastoreExt for a backend datastore does not support the dkDatastoreExt.addToFolder method an exception will be thrown.

        Parameters:
        folder - a folder DKDDO object representing the parent folder
        member - the member DKDDO to be added to the folder (can be document or subfolder)
        Throws:
        DKUsageError - if the parameters are invalid or the operation fails
        DKException - if a datastore error occurs
      • removeAllElements

        public void removeAllElements(DKDDO folderDDO)
                               throws DKUsageError,
                                      DKException
        Removes all elements from this folder and persists the changes to FileNet P8. This method unfiles all documents and subfolders from the folder in the repository. NOTE: Caller is responsible for checkout/checkin of folder (CM8 pattern)
        Parameters:
        folderDDO - the folder DKDDO object representing the parent folder
        Throws:
        DKUsageError - if the folder is null or the operation fails
        DKException - if a datastore error occurs
Copyright © 2024 IBM Corporation

Copyright © 2024 IBM Corporation. All rights reserved.