1 PACKAGE wpg_docload
2 AS
3
4 --
5 -- Public types and global variables
6 --
7 TYPE parts_table IS TABLE OF VARCHAR2(256) INDEX BY binary_integer;
8
9 -- The NAME column in your document table must be the same as the
10 -- value of name_col_len.
11 name_col_len CONSTANT pls_integer := 64;
12
13 -- The MIME_TYPE column in your document table must be the same as
14 -- the value of mimet_col_len.
15 mimet_col_len CONSTANT pls_integer := 48;
16
17 -- The name length of your document table must be less than
18 -- max_doctable_name_len.
19 max_doctable_name_len CONSTANT pls_integer := 256;
20
21 --
22 -- Public file upload/download procedures and functions
23 --
24
25 --
26 -- PROCEDURE:
27 -- download_file
28 -- DESCRIPTION:
29 -- This should be called from within a document download procedure
30 -- to signal the PL/SQL Gateway that p_filename is to be downloaded
31 -- from the document table to the client's browser.
32 -- Normally, a document will be downloaded to the browser unless the
33 -- browser sends an 'If-Modified-Since' header to the gateway indicating
34 -- that it has the requested document in its cache. In that case,
35 -- the gateway will determine if the browser's cached copy is up to date,
36 -- and if it is, it will send a 302 message to the browser indicating
37 -- that the browser should display the cached copy. However, because
38 -- a document URL and a document do not necessarily have a one-to-one
39 -- relationship in the PL/SQL Web Gateway, in some cases it may be
40 -- undesirable to have the cached copy of a document displayed. In those
41 -- cases, the p_bcaching parameter should be set to TRUE to indicate to
42 -- the gateway to ignore the 'If-Modified-Since' header, and download the
43 -- document.
44 -- PARAMS:
45 -- p_filename IN: file to download from the document table.
46 -- p_bcaching IN: browser caching enabled?
47 --
48 PROCEDURE download_file(p_filename IN VARCHAR2,
49 p_bcaching IN BOOLEAN DEFAULT true);
50
51 --
52 -- PROCEDURE:
53 -- download_file
54 -- DESCRIPTION:
55 -- This can be called from within any procedure to signal the
56 -- PL/SQL Gateway that p_blob is to be downloaded to the client's browser.
57 -- PARAMS:
58 -- p_blob IN: blob to download
59 --
60 PROCEDURE download_file(p_blob IN blob);
61
62 --
63 -- PROCEDURE:
64 -- download_file
65 -- DESCRIPTION:
66 -- This can be called from within any procedure to signal the
67 -- PL/SQL Gateway that p_bfile is to be downloaded to the client's browser.
68 -- PARAMS:
69 -- p_bfile IN: bfile to download
70 -- NOTE:
71 -- p_bfile is declared here as an IN/OUT because the locator is
72 -- initially opened to check for file accessibility and existance.
73 -- The open can only be done if the locator is writable and readable.
74 PROCEDURE download_file(p_bfile IN OUT bfile);
75
76 --
77 -- Private file upload/download procedures and functions
78 --
79 -- **WARNING**
80 -- The following procedures are used internally by the
81 -- PL/SQL Gateway. Do not call them from your PL/SQL code.
82 --
83
84 --
85 -- PROCEDURE:
86 -- get_download_file
87 -- DESCRIPTION:
88 -- Get the name and mime_type of the file to be downloaded
89 -- PARAMS:
90 -- p_doc_info OUT: encoded document information
91 --
92 PROCEDURE get_download_file(p_doc_info OUT VARCHAR2);
93
94 --
95 -- PROCEDURE:
96 -- get_download_blob
97 -- DESCRIPTION:
98 -- Get the blob to be downloaded
99 -- PARAMS:
100 -- p_blob OUT: blob to be downloaded
101 --
102 PROCEDURE get_download_blob(p_blob OUT blob);
103
104 --
105 -- PROCEDURE:
106 -- get_download_bfile
107 -- DESCRIPTION:
108 -- Get the bfile to be downloaded
109 -- PARAMS:
110 -- p_bfile OUT: bfile to be downloaded
111 --
112 PROCEDURE get_download_bfile(p_bfile OUT bfile);
113
114 --
115 -- FUNCTION:
116 -- is_file_download
117 -- DESCRIPTION:
118 -- Is there a file to download?
119 -- PARAMS:
120 -- none
121 -- RETURN:
122 -- TRUE if there is a pending file download, FALSE otherwise.
123 --
124 FUNCTION is_file_download
125 RETURN BOOLEAN;
126
127 --
128 -- PROCEDURE:
129 -- get_content_length
130 -- DESCRIPTION:
131 -- Return the length of a lob to be downloaded. This is only called
132 -- when the user hasn't already specified a predetermined content-length.
133 -- PARAMS:
134 -- none.
135 -- RETURN:
136 -- lob length
137 --
138 FUNCTION get_content_length
139 RETURN pls_integer;
140
141 END wpg_docload;