Skip to content

adm_folder_api

This document contains the API documentation for the adm_folder_api package.

Retrieves a folder ID based on the folder path Throws an exception if the folder does not exist.

Signature:

function get_folder_id (
p_folder_path in adm_folders.folder_path%type
) return adm_folders.folder_id%type;

Parameters:

NameDirectionTypeDescription
p_folder_pathinadm_folders.folder_path%typeThe path of the folder to find

Returns: adm_folders.folder_id%type - The ID of the folder matching the given path


Creates a new folder and returns its ID

Signature:

function add_folder (
p_folder_name in adm_folders.folder_name%type,
p_parent_folder_id in adm_folders.parent_folder_id%type,
p_is_system_folder in adm_folders.is_system_folder%type default 'N'
) return adm_folders.folder_id%type;

Parameters:

NameDirectionTypeDescription
p_folder_nameinadm_folders.folder_name%typeThe name of the new folder
p_parent_folder_idinadm_folders.parent_folder_id%typeThe ID of the parent folder
p_is_system_folderinadm_folders.is_system_folder%type default 'N'Flag indicating if this is a system folder (defaults to ‘N’)

Returns: adm_folders.folder_id%type - The ID of the newly created folder


Creates a new folder (procedure version)

Signature:

procedure add_folder (
p_folder_name in adm_folders.folder_name%type,
p_parent_folder_id in adm_folders.parent_folder_id%type,
p_is_system_folder in adm_folders.is_system_folder%type default 'N'
);

Parameters:

NameDirectionTypeDescription
p_folder_nameinadm_folders.folder_name%typeThe name of the new folder
p_parent_folder_idinadm_folders.parent_folder_id%typeThe ID of the parent folder
p_is_system_folderinadm_folders.is_system_folder%type default 'N'Flag indicating if this is a system folder (defaults to ‘N’)

Renames an existing folder

Signature:

procedure rename_folder (
p_folder_id in adm_folders.folder_id%type,
p_new_folder_name in adm_folders.folder_name%type
);

Parameters:

NameDirectionTypeDescription
p_folder_idinadm_folders.folder_id%typeThe ID of the folder to be renamed
p_new_folder_nameinadm_folders.folder_name%typeThe new name for the folder

Moves a folder to a new parent folder

Signature:

procedure move_folder (
p_folder_id in adm_folders.folder_id%type,
p_new_parent_folder_id in adm_folders.parent_folder_id%type
);

Parameters:

NameDirectionTypeDescription
p_folder_idinadm_folders.folder_id%typeThe ID of the folder to be moved
p_new_parent_folder_idinadm_folders.parent_folder_id%typeThe ID of the new parent folder

Moves a folder to the user’s trash folder

Signature:

procedure trash_folder (
p_folder_id in adm_folders.folder_id%type,
p_user_id in varchar2
);

Parameters:

NameDirectionTypeDescription
p_folder_idinadm_folders.folder_id%typeThe ID of the folder to be moved to trash
p_user_idinvarchar2The ID of the user who is trashing the folder

Restores a folder from the trash to its original location

Signature:

procedure restore_folder (
p_folder_id in adm_folders.folder_id%type
);

Parameters:

NameDirectionTypeDescription
p_folder_idinadm_folders.folder_id%typeThe ID of the folder in trash to be restored

Permanently deletes a folder from the trash Call trash_folder first to move the folder to trash.

Signature:

procedure permanently_delete_folder (
p_folder_id in adm_folders.folder_id%type
);

Parameters:

NameDirectionTypeDescription
p_folder_idinadm_folders.folder_id%typeThe ID of the folder to be permanently deleted

Creates a trash folder for a specific user

Signature:

function create_trash_folder (
p_username in varchar2
) return adm_folders.folder_id%type;

Parameters:

NameDirectionTypeDescription
p_usernameinvarchar2The username for which to create the trash folder

Returns: adm_folders.folder_id%type - The ID of the newly created trash folder


Checks if a folder is a parent of another folder

Signature:

function is_parent_folder (
p_potential_parent_id in number,
p_potential_child_id in number
) return boolean;

Parameters:

NameDirectionTypeDescription
p_potential_parent_idinnumberThe ID of the potential parent folder
p_potential_child_idinnumberThe ID of the potential child folder

Returns: boolean - True if the potential parent is a parent of the potential child, false otherwise