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