[Home] [Help]
PACKAGE BODY: APPS.IRC_DOCUMENT_SWI
Source
1 Package Body irc_document_swi As
2 /* $Header: iridoswi.pkb 120.0.12000000.3 2007/03/27 18:57:38 mganapat noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'irc_document_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |----------------------------< create_document >---------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_document
12 (p_validate in number default hr_api.g_false_num
13 ,p_effective_date in date
14 ,p_type in varchar2
15 ,p_person_id in number
16 ,p_mime_type in varchar2
17 ,p_assignment_id in number default null
18 ,p_file_name in varchar2 default null
19 ,p_description in varchar2 default null
20 ,p_document_id in number
21 ,p_end_date in Date default null
22 ,p_object_version_number out nocopy number
23 ,p_return_status out nocopy varchar2
24 ) is
25 --
26 -- Variables for API Boolean parameters
27 l_validate boolean;
28 --
29 -- Variables for IN/OUT parameters
30 --
31 -- Other variables
32 l_document_id number;
33 l_proc varchar2(72) := g_package ||'create_document';
34 Begin
35 hr_utility.set_location(' Entering:' || l_proc,10);
36 --
37 -- Issue a savepoint
38 --
39 savepoint create_document_swi;
40 --
41 -- Initialise Multiple Message Detection
42 --
43 hr_multi_message.enable_message_list;
44 --
45 -- Remember IN OUT parameter IN values
46 --
47 --
48 -- Convert constant values to their corresponding boolean value
49 --
50 l_validate :=
51 hr_api.constant_to_boolean
52 (p_constant_value => p_validate);
53 --
54 -- Register Surrogate ID or user key values
55 --
56 irc_ido_ins.set_base_key_value
57 (p_document_id => p_document_id
58 );
59 --
60 -- Call API
61 --
62 irc_document_api.create_document
63 (p_validate => l_validate
64 ,p_effective_date => p_effective_date
65 ,p_type => p_type
66 ,p_person_id => p_person_id
67 ,p_mime_type => p_mime_type
68 ,p_assignment_id => p_assignment_id
69 ,p_file_name => p_file_name
70 ,p_description => p_description
71 ,p_end_date => p_end_date
72 ,p_document_id => l_document_id
73 ,p_object_version_number => p_object_version_number
74 );
75 --
76 -- Convert API warning boolean parameter values to specific
77 -- messages and add them to Multiple Message List
78 --
79 --
80 -- Convert API non-warning boolean parameter values
81 --
82 --
83 -- Derive the API return status value based on whether
84 -- messages of any type exist in the Multiple Message List.
85 -- Also disable Multiple Message Detection.
86 --
87 p_return_status := hr_multi_message.get_return_status_disable;
88 hr_utility.set_location(' Leaving:' || l_proc,20);
89 --
90 exception
91 when hr_multi_message.error_message_exist then
92 --
93 -- Catch the Multiple Message List exception which
94 -- indicates API processing has been aborted because
95 -- at least one message exists in the list.
96 --
97 rollback to create_document_swi;
98 --
99 -- Reset IN OUT parameters and set OUT parameters
100 --
101 p_object_version_number := null;
102 p_return_status := hr_multi_message.get_return_status_disable;
103 hr_utility.set_location(' Leaving:' || l_proc, 30);
104 when others then
105 --
106 -- When Multiple Message Detection is enabled catch
107 -- any Application specific or other unexpected
108 -- exceptions. Adding appropriate details to the
109 -- Multiple Message List. Otherwise re-raise the
110 -- error.
111 --
112 rollback to create_document_swi;
113 if hr_multi_message.unexpected_error_add(l_proc) then
114 hr_utility.set_location(' Leaving:' || l_proc,40);
115 raise;
116 end if;
117 --
118 -- Reset IN OUT and set OUT parameters
119 --
120 p_object_version_number := null;
121 p_return_status := hr_multi_message.get_return_status_disable;
122 hr_utility.set_location(' Leaving:' || l_proc,50);
123 end create_document;
124 -- ----------------------------------------------------------------------------
125 -- |----------------------------< delete_document >---------------------------|
126 -- ----------------------------------------------------------------------------
127 PROCEDURE delete_document
128 (p_validate in number default hr_api.g_false_num
129 ,p_effective_date in date
130 ,p_document_id in number
131 ,p_object_version_number in number
132 ,p_person_id in number
133 ,p_party_id in number
134 ,p_end_date in Date
135 ,p_type in varchar2
136 ,p_return_status out nocopy varchar2
137 ) is
138 --
139 -- Variables for API Boolean parameters
140 l_validate boolean;
141 --
142 -- Variables for IN/OUT parameters
143 --
144 -- Other variables
145 l_proc varchar2(72) := g_package ||'delete_document';
146 Begin
147
148
149 hr_utility.set_location(' Entering:' || l_proc,10);
150 --
151 -- Issue a savepoint
152 --
153 savepoint delete_document_swi;
154 --
155 -- Initialise Multiple Message Detection
156 --
157 hr_multi_message.enable_message_list;
158 --
159 -- Remember IN OUT parameter IN values
160 --
161 --
162 -- Convert constant values to their corresponding boolean value
163 --
164 l_validate :=
165 hr_api.constant_to_boolean
166 (p_constant_value => p_validate);
167 --
168 -- Register Surrogate ID or user key values
169 --
170 --
171 -- Call API
172 --
173 irc_document_api.delete_document
174 (p_validate => l_validate
175 ,p_effective_date => p_effective_date
176 ,p_document_id => p_document_id
177 ,p_object_version_number => p_object_version_number
178 ,p_person_id => p_person_id
179 ,p_party_id => p_party_id
180 ,p_end_date => p_end_date
181 ,p_type => p_type
182 );
183 --
184 -- Convert API warning boolean parameter values to specific
185 -- messages and add them to Multiple Message List
186 --
187 --
188 -- Convert API non-warning boolean parameter values
189 --
190 --
191 -- Derive the API return status value based on whether
192 -- messages of any type exist in the Multiple Message List.
193 -- Also disable Multiple Message Detection.
194 --
195 p_return_status := hr_multi_message.get_return_status_disable;
196 hr_utility.set_location(' Leaving:' || l_proc,20);
197 --
198
199 --
200 exception
201 when hr_multi_message.error_message_exist then
202 --
203 -- Catch the Multiple Message List exception which
204 -- indicates API processing has been aborted because
205 -- at least one message exists in the list.
206 --
207 rollback to delete_document_swi;
208 --
209 -- Reset IN OUT parameters and set OUT parameters
210 --
211 p_return_status := hr_multi_message.get_return_status_disable;
212 hr_utility.set_location(' Leaving:' || l_proc, 30);
213 when others then
214 --
215 -- When Multiple Message Detection is enabled catch
216 -- any Application specific or other unexpected
217 -- exceptions. Adding appropriate details to the
218 -- Multiple Message List. Otherwise re-raise the
219 -- error.
220 --
221 rollback to delete_document_swi;
222 if hr_multi_message.unexpected_error_add(l_proc) then
223 hr_utility.set_location(' Leaving:' || l_proc,40);
224 raise;
225 end if;
226 --
227 -- Reset IN OUT and set OUT parameters
228 --
229 p_return_status := hr_multi_message.get_return_status_disable;
230 hr_utility.set_location(' Leaving:' || l_proc,50);
231
232
233 end delete_document;
234 -- ----------------------------------------------------------------------------
235 -- |----------------------------< update_document >---------------------------|
236 -- ----------------------------------------------------------------------------
237 PROCEDURE update_document
238 (p_validate in number default hr_api.g_false_num
239 ,p_effective_date in date
240 ,p_document_id in number
241 ,p_mime_type in varchar2 default hr_api.g_varchar2
242 ,p_type in varchar2 default hr_api.g_varchar2
243 ,p_file_name in varchar2 default hr_api.g_varchar2
244 ,p_description in varchar2 default hr_api.g_varchar2
245 ,p_person_id In number default hr_api.g_number
246 ,p_party_id in number default hr_api.g_number
247 ,p_end_date In Date default hr_api.g_date
248 ,p_assignment_id In number default hr_api.g_number
249 ,p_object_version_number in out nocopy number
250 ,p_new_doc_id out nocopy number
251 ,p_return_status out nocopy varchar2
252 ) is
253 --
254 -- Variables for API Boolean parameters
255 l_validate boolean;
256 --
257 -- Variables for IN/OUT parameters
258 l_object_version_number number;
259 --
260 -- Other variables
261 l_proc varchar2(72) := g_package ||'update_document';
262 Begin
263 hr_utility.set_location(' Entering:' || l_proc,10);
264 --
265
266 -- Issue a savepoint
267 --
268 savepoint update_document_swi;
269 --
270 -- Initialise Multiple Message Detection
271 --
272 hr_multi_message.enable_message_list;
273 --
274 -- Remember IN OUT parameter IN values
275 --
276 l_object_version_number := p_object_version_number;
277 --
278 -- Convert constant values to their corresponding boolean value
279 --
280 l_validate :=
281 hr_api.constant_to_boolean
282 (p_constant_value => p_validate);
283 --
284 -- Register Surrogate ID or user key values
285 --
286 --
287 -- Call API
288 --
289 irc_document_api.update_document_track
290 (p_validate => l_validate
291 ,p_effective_date => p_effective_date
292 ,p_document_id => p_document_id
293 ,p_mime_type => p_mime_type
294 ,p_type => p_type
295 ,p_file_name => p_file_name
296 ,p_description => p_description
297 ,p_person_id => p_person_id
298 ,p_party_id => p_party_id
299 ,p_end_date => p_end_date
300 ,p_assignment_id => p_assignment_id
301 ,p_object_version_number => p_object_version_number
302 ,p_new_doc_id => p_new_doc_id
303 );
304 --
305 -- Convert API warning boolean parameter values to specific
306 -- messages and add them to Multiple Message List
307 --
308 --
309 -- Convert API non-warning boolean parameter values
310 --
311 --
312 -- Derive the API return status value based on whether
313 -- messages of any type exist in the Multiple Message List.
314 -- Also disable Multiple Message Detection.
315 --
316 p_return_status := hr_multi_message.get_return_status_disable;
317 hr_utility.set_location(' Leaving:' || l_proc,20);
318 --
319 exception
320 when hr_multi_message.error_message_exist then
321 --
322 -- Catch the Multiple Message List exception which
323 -- indicates API processing has been aborted because
324 -- at least one message exists in the list.
325 --
326 rollback to update_document_swi;
327 --
328 -- Reset IN OUT parameters and set OUT parameters
329 --
330 p_object_version_number := l_object_version_number;
331 p_return_status := hr_multi_message.get_return_status_disable;
332 hr_utility.set_location(' Leaving:' || l_proc, 30);
333 when others then
334 --
335 -- When Multiple Message Detection is enabled catch
336 -- any Application specific or other unexpected
337 -- exceptions. Adding appropriate details to the
338 -- Multiple Message List. Otherwise re-raise the
339 -- error.
340 --
341 rollback to update_document_swi;
342 if hr_multi_message.unexpected_error_add(l_proc) then
343 hr_utility.set_location(' Leaving:' || l_proc,40);
344 raise;
345 end if;
346 --
347 -- Reset IN OUT and set OUT parameters
348 --
349 p_object_version_number := l_object_version_number;
350 p_return_status := hr_multi_message.get_return_status_disable;
351 hr_utility.set_location(' Leaving:' || l_proc,50);
352 end update_document;
353 end irc_document_swi;