rem {{ $Header: \\ukst76\rcsroot.7_0\model\JIN\GENERATE\RCS\JRIFILE.JPS 40.4 1999/01/06 15:54:45 rmolland Exp rmolland $ rem {{ ------------------------------------------------------------------------ rem File: $Workfile: jrphfile.sql $ rem Author: $Author: rmolland $ rem Date: $Date: 1999/01/06 15:54:45 $ rem Version: $Revision: 40.4 $ rem Status: $State: Exp $ rem Locked_by: $Locker: rmolland $ rem Project: The Oracle Common Repository rem Description: File access service rem Notes: rem RealAuth: Jon Wetherbee rem IncepDate: December 4, 1997 rem Copyright: (c) Oracle Corporation 1997. All Rights Reserved. rem Tagline: -- Oracle Repository: Managing *all* your data -- rem --------------------------------------------------------------------------- rem Log of Changes from Source Control System rem --------------------------------------------------------------------------- rem }} ------------------------------------------------------------------------ rem prompt Package Header: jr_file create or replace package jr_file is --------------------------------------------------------------------------- -- jr_file.new_file() -- create a new file (within the context of a parent folder, if specified) -- through the CDAPI (thin wrapper onto CDAPI) -- Folder is created within the context of a (specified) folder. A context -- folder *must* be specified... -- -- IMPORTANT: NO exception handling! Caller must catch and deal with exceptions --------------------------------------------------------------------------- procedure new_file(filename in varchar2, context_folder in number, file_irid out number, file_ivid out number, file_kind out varchar2, blob_loc out BLOB, file_platform in varchar2 default null); --------------------------------------------------------------------------- -- jr_file.new_file() -- create a new file (within the context of a parent folder, if specified) -- through the CDAPI (thin wrapper onto CDAPI) -- Folder is created within the context of a (specified) folder. A context -- folder *must* be specified... -- -- IMPORTANT: NO exception handling! Caller must catch and deal with exceptions --------------------------------------------------------------------------- procedure new_file(filename in varchar2, context_folder in number, file_irid out number, file_ivid out number, file_platform in varchar2 default null); --------------------------------------------------------------------------- -- jr_file.new_file() -- create a new file (within the context of a parent folder, if specified) -- through the CDAPI -- Provided for compatibility with previous code, returns irid. --------------------------------------------------------------------------- function new_file(filename varchar2, context_folder number default null) return number; ------------------------------------------------------------------------- -- Delete file -- Through CDAPI -- -- IMPORTANT: NO exception handling! Caller must catch and deal with -- exceptions ------------------------------------------------------------------------- procedure delete_file(file_irid in number); --------------------------------------------------------------------------------- -- procedure for creating a registering a file with a folder. Simply returns if -- the file exists in the specified folder RJM 26/8/98 --------------------------------------------------------------------------------- procedure register_file (file_name in varchar2, file_irid out number, file_ivid out number, folder_ref in number, file_status out varchar2); --------------------------------------------------------------------------------- -- jr_file.get_file_for_upload() -- Gets details about the repository file in the specified folder and prepare -- file for upload. -- If the file does not exist it is created. -- RJM 22/12/98 --------------------------------------------------------------------------------- procedure get_file_for_upload (file_name in varchar2, folder_ref in number, f_kind out varchar2, f_irid out number, f_ivid out number, f_status out varchar2, f_size out number, f_crc out number, f_timestamp out date, f_blob out BLOB, platform in varchar2 default null); --------------------------------------------------------------------------------- -- jr_file.prepare_file_for_upload() -- Gets relevant upload details for a repository file and ensures the -- file is ready for upload, checking that the file is checked out and has a -- a valid lob locator. -- -- Returns the lob length, file status, the file kind ((B)LOB or (C)LOB), -- the os_file size, the file CRC and the file os_timestamp. -- RJM 22/12/98 --------------------------------------------------------------------------------- procedure prepare_file_for_upload (f_irid in number, f_ivid in number, f_kind out varchar2, f_status out varchar2, f_size out number, f_crc out number, f_timestamp out date, f_blob out BLOB, platform in varchar2 default null); --------------------------------------------------------------------------------- -- jr_file.prepare_for_stream_upload() -- Procedure which prepares a file (lob) for upload from a memory stream. -- Performs the bare minimum checks to ensure the file is valid for upload. -- I.e. Makes sure the file is checked out and has a valid lob locator. -- -- Returns the lob length, file status and the file kind ((B)LOB or (C)LOB) -- RJM 22/12/98 --------------------------------------------------------------------------------- procedure prepare_for_stream_upload (f_irid in number, f_ivid in number, f_kind out varchar2, f_status out varchar2, f_blob out BLOB, platform in varchar2 default null); --------------------------------------------------------------------------------- -- jr_file.prepare_file_for_write() -- Procedure which prepares a file (lob) for writing -- The file kind is used to assign a lob_locator if necessary. -- Returns the lob length. -- RJM 22/12/98 --------------------------------------------------------------------------------- procedure prepare_file_for_write (f_irid in number, f_ivid in number, f_kind in varchar2, blob_loc out BLOB); --------------------------------------------------------------------------------- -- jr_file.count_files_for_download() -- Counts the number of files (recursively) that will be downloaded from the -- root_ref folder --------------------------------------------------------------------------------- function num_files_for_download(root_ref number, strFilter varchar2) return number; function count_files_for_download(root_ref number) return number; --------------------------------------------------------------------------------- -- -- jr_file.get_file_registry_LOB_kind() -- get the lob kind for the specified file name from the file registry -- 'C' = clob, 'B' = blob 'U' = unkown -- --------------------------------------------------------------------------------- function get_file_registry_LOB_kind(file_name varchar2, file_platform varchar2) return varchar2; --------------------------------------------------------------------------------- -- jr_file.GetEmptyLobLoc() -- RJM 22/12/98 --------------------------------------------------------------------------------- procedure get_empty_lob_loc (irid in number, ivid in number, name in varchar2, kind out varchar2, blob_loc out BLOB, platform in varchar2 default null); procedure test (file_name varchar2, folder_name varchar2, platform varchar2 default null); procedure test2 (file_name varchar2, folder_name varchar2, platform varchar2 default null); -- some constants for jr_file use rule_clob constant varchar2(15) := 'TXT_FILE'; rule_blob constant varchar2(15) := 'BIN_FILE'; rule_deflate constant varchar2(15) := 'COMPRESSED'; rule_inflate constant varchar2(15) := 'UNCOMPRESSED'; kind_blob constant varchar2(1) := 'B'; kind_clob constant varchar2(1) := 'C'; kind_compr_clob constant varchar2(1) := 'X'; kind_compr_blob constant varchar2(1) := 'Y'; kind_compressed constant varchar2(1) := 'Z'; kind_unkown constant varchar2(1) := 'U'; WIN32 constant varchar2(5) := 'WIN32'; SOLARIS constant varchar2(7) := 'SOLARIS'; end jr_file; / rem rem ---------------------------------------------------------------------------- rem }} End of file $Workfile: jrphfile.sql $ $$Header_is_done rem ---------------------------------------------------------------------------x