Skip to content

adm_document_api

This document contains the API documentation for the adm_document_api package.

Creates a new document

Signature:

function create_document (
p_folder_id in adm_documents.folder_id%type,
p_document_name in adm_documents.document_name%type,
p_file_content in adm_document_versions.file_content%type,
p_file_mime_type in adm_documents.file_mime_type%type
) return adm_documents.document_id%type;

Parameters:

NameDirectionTypeDescription
p_folder_idinadm_documents.folder_id%typeThe folder ID where the document will be stored
p_document_nameinadm_documents.document_name%typeThe name of the document
p_file_contentinadm_document_versions.file_content%typeThe binary content of the file
p_file_mime_typeinadm_documents.file_mime_type%typeThe MIME type of the file

Returns: adm_documents.document_id%type - The ID of the newly created document


Adds a new version to an existing document

Signature:

function add_document_version (
p_document_id in adm_documents.document_id%type,
p_file_content in adm_document_versions.file_content%type
) return adm_document_versions.version_id%type;

Parameters:

NameDirectionTypeDescription
p_document_idinadm_documents.document_id%typeThe document ID to add a version to
p_file_contentinadm_document_versions.file_content%typeThe binary content of the file

Returns: adm_document_versions.version_id%type - The ID of the newly created version


Calculates a SHA-256 checksum for a BLOB

Signature:

function calculate_checksum (
p_blob in blob
) return varchar2;

Parameters:

NameDirectionTypeDescription
p_blobinblobThe BLOB to calculate the checksum for

Returns: varchar2 - The SHA-256 checksum as a hexadecimal string


Renames an existing document

Signature:

procedure rename_document (
p_document_id in adm_documents.document_id%type,
p_new_name in adm_documents.document_name%type
);

Parameters:

NameDirectionTypeDescription
p_document_idinadm_documents.document_id%typeThe ID of the document to be renamed
p_new_nameinadm_documents.document_name%typeThe new name for the document

Moves a document to a different folder

Signature:

procedure move_document (
p_document_id in adm_documents.document_id%type,
p_destination_folder_id in adm_folders.folder_id%type
);

Parameters:

NameDirectionTypeDescription
p_document_idinadm_documents.document_id%typeThe ID of the document to be moved
p_destination_folder_idinadm_folders.folder_id%typeThe ID of the destination folder

Moves a document to the user’s trash folder

Signature:

procedure trash_document (
p_document_id in adm_documents.document_id%type,
p_user_id in varchar2
);

Parameters:

NameDirectionTypeDescription
p_document_idinadm_documents.document_id%typeThe ID of the document to be moved to trash
p_user_idinvarchar2The ID of the user who is trashing the document

Restores a document from the trash to its original location

Signature:

procedure restore_document (
p_document_id in adm_documents.document_id%type
);

Parameters:

NameDirectionTypeDescription
p_document_idinadm_documents.document_id%typeThe ID of the document in trash to be restored

Permanently deletes a document from the trash

Signature:

procedure permanently_delete_document (
p_document_id in adm_documents.document_id%type
);

Parameters:

NameDirectionTypeDescription
p_document_idinadm_documents.document_id%typeThe ID of the document to be permanently deleted

Adds a retention policy to a document

Signature:

procedure add_file_retention (
p_document_id in adm_documents.document_id%type,
p_retention_delete_date in adm_documents.retention_delete_date%type,
p_retention_category in adm_documents.retention_category%type default null
);

Parameters:

NameDirectionTypeDescription
p_document_idinadm_documents.document_id%typeThe ID of the document to which the retention policy will be added
p_retention_delete_dateinadm_documents.retention_delete_date%typeThe date when the document should be deleted according to the retention policy
p_retention_categoryinadm_documents.retention_category%type default null-

Removes a retention policy from a document

Signature:

procedure remove_file_retention (
p_document_id in adm_documents.document_id%type
);

Parameters:

NameDirectionTypeDescription
p_document_idinadm_documents.document_id%typeThe ID of the document from which the retention policy will be removed

Adds a legal hold to a document

Signature:

procedure add_legal_hold (
p_document_id in adm_documents.document_id%type
);

Parameters:

NameDirectionTypeDescription
p_document_idinadm_documents.document_id%typeThe ID of the document to which the legal hold will be added

Lifts a legal hold from a document

Signature:

procedure lift_legal_hold (
p_document_id in adm_documents.document_id%type
);

Parameters:

NameDirectionTypeDescription
p_document_idinadm_documents.document_id%typeThe ID of the document from which the legal hold will be lifted

Deletes a specific document version Note: You cannot delete the latest version - use trash_document instead

Signature:

procedure delete_document_version (
p_version_id in adm_document_versions.version_id%type
);

Parameters:

NameDirectionTypeDescription
p_version_idinadm_document_versions.version_id%typeThe ID of the document version to be deleted