create or replace package cdwp_fil is -- arrays to use as target for BULK COLLECT TYPE t_iridTab IS TABLE OF ci_primary_access_files.irid%TYPE; TYPE t_ividTab IS TABLE OF ci_primary_access_files.ivid%TYPE; TYPE t_nameTab IS TABLE OF ci_primary_access_files.name%TYPE; TYPE t_file_sizeTab IS TABLE OF ci_primary_access_files.file_size%TYPE; TYPE t_short_descriptionTab IS TABLE OF ci_primary_access_files.short_description%TYPE; TYPE t_date_changedTab IS TABLE OF ci_primary_access_files.date_changed%TYPE; g_iridTab t_iridTab; g_ividTab t_ividTab; g_nameTab t_nameTab; g_file_sizeTab t_file_sizeTab; g_short_descriptionTab t_short_descriptionTab; g_date_changedTab t_date_changedTab; -- this function returns the base of URLs required to access the Servlets that run in a WebServer -- and implement part of the File Manipulating capabilities of ODWA. -- The Base URL is used in the hyperlinks for Uploading and Downloading files. function servlet_urlbase return varchar2 ; -- this function returns the URL that is appropriate for downloading the indicated file -- in the current environment; that may mean a URL to a PL/SQL package reading straight -- from the LOB column in the i$sdd_files table or a URL to a servlet can uses the -- Java File API to download the file from the Repository to the WebServer file system function url_download_file ( p_irid in number , p_ivid in number , p_filename in varchar2 , p_label in varchar2 , p_download in boolean default true -- when false that means that the URL may support View File first (resorting to Download for unknown Mime Types) , p_form_included in boolean default false -- when true, the HTML page already contains the request form for the Download request; that means the URL itself can be simpler ) return varchar2 ; -- this function will write the Javascript function to be included in the HEAD section of the HTML -- page; this function will be called to issue a file download request, using the download_file_request_form procedure js_download_file_request ; -- this function return a string containing the HTML definition of a FORM that will -- be used to request download of a file. Depending on the environment, the form may -- serve requests to the PL/SQL download_file procedure or the Servlet DoDownLoad. procedure form_download_file_request ; procedure short_list_files ( p_session_id in number , p_app_id in number default -1 ); procedure show_file ( p_session_id in number , p_irid in number default null , p_ivid in number default null , p_page in number default 1 ); procedure download_file ( p_session_id in number , p_irid in number default null , p_ivid in number default null ); procedure list_files ( p_session_id in number , p_irid in number default null , p_ivid in number default null ); -- this procedure will clear the contents of the BLOB column -- of indicated row in I$SDD_FILES ; the procedure should only be called -- from the Java Class that uploads files just prior to upload -- the clear is used because uploading of a smaller file does not remove -- the part of the original file beyond the size of the newly uploaded file procedure clear_file ( p_ivid in varchar2 ); procedure compare_files ( p_result out number , p_ivid in varchar2 ); function compare_files ( p_ivid in number ) return boolean ; -- this procedure will touch the indicated file: nothing is changed -- but the repository audit mechanism is triggered to update the changed_by column value procedure touch_file ( p_ivid in number ); procedure set_file_crc ( p_ivid in varchar2 , p_crc in number ) ; procedure update_file ( p_ivid in varchar2 , p_length in number , p_user in varchar2 ); procedure warn_compressed_file ( p_ivid in varchar2 , p_text out varchar2 ); end; -- cdwp_fil /