Class RecordFolderAPI


  • public class RecordFolderAPI
    extends RMModelRequest
    Record folder REST API Wrapper
    Since:
    2.6
    Author:
    Tuna Aksoy
    • Constructor Detail

      • RecordFolderAPI

        public RecordFolderAPI​(RMRestWrapper rmRestWrapper)
        Constructor.
        Parameters:
        rmRestWrapper - RM REST Wrapper
    • Method Detail

      • deleteRecordFolder

        public void deleteRecordFolder​(String recordFolderId)
        Deletes a record folder.
        Parameters:
        recordFolderId - The identifier of a record folder
        Throws:
        RuntimeException - for the following cases:
        • recordFolderId is not a valid format
        • authentication fails
        • current user does not have permission to delete recordFolderId
        • recordFolderId does not exist
        • recordFolderId is locked and cannot be deleted
      • getRecordFolder

        public RecordFolder getRecordFolder​(String recordFolderId,
                                            String parameters)
        Gets a record folder.
        Parameters:
        recordFolderId - The identifier of a record folder
        parameters - The URL parameters to add
        Returns:
        The RecordFolder for the given recordFolderId
        Throws:
        RuntimeException - for the following cases:
        • recordFolderId is not a valid format
        • authentication fails
        • current user does not have permission to read recordFolderId
        • recordFolderId does not exist
      • updateRecordFolder

        public RecordFolder updateRecordFolder​(RecordFolder recordFolderModel,
                                               String recordFolderId,
                                               String parameters)
        Updates a record folder.
        Parameters:
        recordFolderModel - The record folder model which holds the information
        recordFolderId - The identifier of a record folder
        parameters - The URL parameters to add
        returns - The updated RecordFolder
        Throws:
        RuntimeException - for the following cases:
        • the update request is invalid or recordFolderId is not a valid format or recordFolderModel is invalid
        • authentication fails
        • current user does not have permission to update recordFolderId
        • recordFolderId does not exist
        • the updated name clashes with an existing record folder in the current parent category
        • model integrity exception, including file name with invalid characters
      • getRecordFolderChildren

        public RecordFolderCollection getRecordFolderChildren​(String recordFolderId,
                                                              String parameters)
        Gets the children of a record folder.
        Parameters:
        recordFolderId - The identifier of a record folder
        parameters - The URL parameters to add
        Returns:
        The RecordFolderCollection for the given recordFolderId
        Throws:
        RuntimeException - for the following cases:
        • authentication fails
        • current user does not have permission to read recordFolderId
        • recordFolderId does not exist
      • createRecord

        public Record createRecord​(Record recordModel,
                                   String recordFolderId,
                                   File recordContent)
                            throws RuntimeException
        Create a record from file resource
        Parameters:
        recordModel - Record for electronic record to be created
        recordContent - File pointing to the content of the electronic record to be created
        recordFolderId - The identifier of a record folder
        Returns:
        newly created Record
        Throws:
        RuntimeException - for invalid recordModel JSON strings
      • createRecord

        public Record createRecord​(Record recordModel,
                                   String recordFolderId,
                                   String parameters)
        Creates a record in a record folder child, i.e. a record.
        Parameters:
        recordModel - The record model which holds the information
        recordFolderId - The identifier of a record folder
        parameters - The URL parameters to add
        Returns:
        The created Record
        Throws:
        RuntimeException - for the following cases:
        • {@code recordFolderId is not a valid format or {@code recordModel} is invalid
        • authentication fails
        • current user does not have permission to add children to {@code recordFolderId}
        • {@code recordFolderId} does not exist
        • model integrity exception, including node name with invalid characters