Skip to content

adm_storage_api

This document contains the API documentation for the adm_storage_api package.

Retrieves file content from appropriate storage location Handles both database BLOB and object storage transparently

Signature:

function get_file_content (
p_version_id in adm_document_versions.version_id%type
) return blob;

Parameters:

NameDirectionTypeDescription
p_version_idinadm_document_versions.version_id%typeThe version ID to retrieve content for

Returns: blob - The file content as BLOB


Determines the appropriate storage location for a file based on storage policies

Signature:

function determine_storage_location (
p_folder_path in varchar2
) return varchar2;

Parameters:

NameDirectionTypeDescription
p_folder_pathinvarchar2The full folder path where the file will be stored

Returns: varchar2 - ‘OBJECT_STORAGE’ or ‘DATABASE’


Creates or updates a storage policy

Signature:

function create_storage_policy (
p_folder_path_pattern in varchar2,
p_storage_location in varchar2,
p_description in varchar2 default null
) return number;

Parameters:

NameDirectionTypeDescription
p_folder_path_patterninvarchar2Folder path pattern (e.g., ”/”, “/users/”, “/archive/“)
p_storage_locationinvarchar2Storage location: DATABASE or OBJECT_STORAGE
p_descriptioninvarchar2 default nullOptional description

Returns: number - policy_id of created or updated policy


Updates an existing storage policy

Signature:

procedure update_storage_policy (
p_policy_id in number,
p_folder_path_pattern in varchar2,
p_storage_location in varchar2,
p_description in varchar2 default null
);

Parameters:

NameDirectionTypeDescription
p_policy_idinnumberPolicy ID to update
p_folder_path_patterninvarchar2Folder path pattern
p_storage_locationinvarchar2Storage location: DATABASE or OBJECT_STORAGE
p_descriptioninvarchar2 default nullOptional description

Activates a storage policy

Signature:

procedure activate_storage_policy (
p_policy_id in number
);

Parameters:

NameDirectionTypeDescription
p_policy_idinnumberPolicy ID to activate

Deactivates a storage policy

Signature:

procedure deactivate_storage_policy (
p_policy_id in number
);

Parameters:

NameDirectionTypeDescription
p_policy_idinnumberPolicy ID to deactivate

Deletes a storage policy

Signature:

procedure delete_storage_policy (
p_policy_id in number
);

Parameters:

NameDirectionTypeDescription
p_policy_idinnumberPolicy ID to delete

Migrates file from current storage to object storage

Signature:

procedure migrate_to_object_storage (
p_version_id in adm_document_versions.version_id%type,
p_defer in boolean default true
);

Parameters:

NameDirectionTypeDescription
p_version_idinadm_document_versions.version_id%typeThe version ID to migrate
p_deferinboolean default trueIf true run migration in a background job; if false, migrate immediately

Migrates file from object storage back to BLOB

Signature:

procedure migrate_to_blob_storage (
p_version_id in adm_document_versions.version_id%type,
p_defer in boolean default true
);

Parameters:

NameDirectionTypeDescription
p_version_idinadm_document_versions.version_id%typeThe version ID to migrate
p_deferinboolean default trueIf true run migration in a background job; if false, migrate immediately

Migrates a folder from current storage to object storage. Recursively migrates all files in the folder and all subfolders

Signature:

procedure migrate_folder_to_object_storage (
p_folder_id in adm_folders.folder_id%type,
p_defer in boolean default true
);

Parameters:

NameDirectionTypeDescription
p_folder_idinadm_folders.folder_id%typeThe folder ID to migrate
p_deferinboolean default trueIf true, mark files for later migration; if false, migrate immediately

Migrates a folder from object storage back to BLOB. Recursively migrates all files in the folder and all subfolders

Signature:

procedure migrate_folder_to_blob_storage (
p_folder_id in adm_folders.folder_id%type,
p_defer in boolean default true
);

Parameters:

NameDirectionTypeDescription
p_folder_idinadm_folders.folder_id%typeThe folder ID to migrate
p_deferinboolean default trueIf true, mark files for later migration; if false, migrate immediately

Goes through all the adm_object_storage_policies and applies them to any file not following them

Signature:

procedure apply_adm_object_storage_policies (
p_defer in boolean default true
);

Parameters:

NameDirectionTypeDescription
p_deferinboolean default trueIf true, mark files for later migration; if false, migrate immediately

Goes through a specific adm_object_storage_policy and applies it to any file not following it

Signature:

procedure apply_adm_object_storage_policy (
p_policy_id in adm_object_storage_policies.policy_id%type,
p_defer in boolean default true
);

Parameters:

NameDirectionTypeDescription
p_policy_idinadm_object_storage_policies.policy_id%typeThe policy ID to apply
p_deferinboolean default trueIf true, mark files for later migration; if false, migrate immediately