adm_storage_api
This document contains the API documentation for the adm_storage_api
package.
Functions and Procedures
Section titled “Functions and Procedures”get_file_content
Section titled “get_file_content”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:
Name | Direction | Type | Description |
---|---|---|---|
p_version_id | in | adm_document_versions.version_id%type | The version ID to retrieve content for |
Returns: blob
- The file content as BLOB
determine_storage_location
Section titled “determine_storage_location”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:
Name | Direction | Type | Description |
---|---|---|---|
p_folder_path | in | varchar2 | The full folder path where the file will be stored |
Returns: varchar2
- ‘OBJECT_STORAGE’ or ‘DATABASE’
create_storage_policy
Section titled “create_storage_policy”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:
Name | Direction | Type | Description |
---|---|---|---|
p_folder_path_pattern | in | varchar2 | Folder path pattern (e.g., ”/”, “/users/”, “/archive/“) |
p_storage_location | in | varchar2 | Storage location: DATABASE or OBJECT_STORAGE |
p_description | in | varchar2 default null | Optional description |
Returns: number
- policy_id of created or updated policy
update_storage_policy
Section titled “update_storage_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:
Name | Direction | Type | Description |
---|---|---|---|
p_policy_id | in | number | Policy ID to update |
p_folder_path_pattern | in | varchar2 | Folder path pattern |
p_storage_location | in | varchar2 | Storage location: DATABASE or OBJECT_STORAGE |
p_description | in | varchar2 default null | Optional description |
activate_storage_policy
Section titled “activate_storage_policy”Activates a storage policy
Signature:
procedure activate_storage_policy ( p_policy_id in number);
Parameters:
Name | Direction | Type | Description |
---|---|---|---|
p_policy_id | in | number | Policy ID to activate |
deactivate_storage_policy
Section titled “deactivate_storage_policy”Deactivates a storage policy
Signature:
procedure deactivate_storage_policy ( p_policy_id in number);
Parameters:
Name | Direction | Type | Description |
---|---|---|---|
p_policy_id | in | number | Policy ID to deactivate |
delete_storage_policy
Section titled “delete_storage_policy”Deletes a storage policy
Signature:
procedure delete_storage_policy ( p_policy_id in number);
Parameters:
Name | Direction | Type | Description |
---|---|---|---|
p_policy_id | in | number | Policy ID to delete |
migrate_to_object_storage
Section titled “migrate_to_object_storage”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:
Name | Direction | Type | Description |
---|---|---|---|
p_version_id | in | adm_document_versions.version_id%type | The version ID to migrate |
p_defer | in | boolean default true | If true run migration in a background job; if false, migrate immediately |
migrate_to_blob_storage
Section titled “migrate_to_blob_storage”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:
Name | Direction | Type | Description |
---|---|---|---|
p_version_id | in | adm_document_versions.version_id%type | The version ID to migrate |
p_defer | in | boolean default true | If true run migration in a background job; if false, migrate immediately |
migrate_folder_to_object_storage
Section titled “migrate_folder_to_object_storage”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:
Name | Direction | Type | Description |
---|---|---|---|
p_folder_id | in | adm_folders.folder_id%type | The folder ID to migrate |
p_defer | in | boolean default true | If true, mark files for later migration; if false, migrate immediately |
migrate_folder_to_blob_storage
Section titled “migrate_folder_to_blob_storage”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:
Name | Direction | Type | Description |
---|---|---|---|
p_folder_id | in | adm_folders.folder_id%type | The folder ID to migrate |
p_defer | in | boolean default true | If true, mark files for later migration; if false, migrate immediately |
apply_adm_object_storage_policies
Section titled “apply_adm_object_storage_policies”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:
Name | Direction | Type | Description |
---|---|---|---|
p_defer | in | boolean default true | If true, mark files for later migration; if false, migrate immediately |
apply_adm_object_storage_policy
Section titled “apply_adm_object_storage_policy”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:
Name | Direction | Type | Description |
---|---|---|---|
p_policy_id | in | adm_object_storage_policies.policy_id%type | The policy ID to apply |
p_defer | in | boolean default true | If true, mark files for later migration; if false, migrate immediately |