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