[Home] [Help]
PACKAGE BODY: APPS.PQH_REF_TEMPLATES_API
Source
1 Package Body pqh_REF_TEMPLATES_api as
2 /* $Header: pqrftapi.pkb 115.5 2002/12/06 18:07:37 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' pqh_REF_TEMPLATES_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_REF_TEMPLATE >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_REF_TEMPLATE
13 (p_validate in boolean default false
14 ,p_ref_template_id out nocopy number
15 ,p_base_template_id in number
16 ,p_parent_template_id in number
17 ,p_reference_type_cd in varchar2
18 ,p_object_version_number out nocopy number
19 ,p_effective_date in date
20 ) is
21 --
22 -- Declare cursors and local variables
23 --
24 l_ref_template_id pqh_ref_templates.ref_template_id%TYPE;
25 l_proc varchar2(72) := g_package||'create_REF_TEMPLATE';
26 l_object_version_number pqh_ref_templates.object_version_number%TYPE;
27 --
28 begin
29 --
30 hr_utility.set_location('Entering:'|| l_proc, 10);
31 --
32 -- Issue a savepoint if operating in validation only mode
33 --
34 savepoint create_REF_TEMPLATES;
35 --
36 hr_utility.set_location(l_proc, 20);
37 --
38 -- Process Logic
39 --
40 begin
41 --
42 -- Start of API User Hook for the before hook of create_REF_TEMPLATE
43 --
44 pqh_REF_TEMPLATES_bk1.create_REF_TEMPLATE_b
45 (
46 p_base_template_id => p_base_template_id
47 ,p_parent_template_id => p_parent_template_id
48 ,p_reference_type_cd => p_reference_type_cd
49 ,p_effective_date => trunc(p_effective_date)
50 );
51 exception
52 when hr_api.cannot_find_prog_unit then
53 hr_api.cannot_find_prog_unit_error
54 (
55 p_module_name => 'CREATE_REF_TEMPLATE'
56 ,p_hook_type => 'BP'
57 );
58 --
59 -- End of API User Hook for the before hook of create_REF_TEMPLATE
60 --
61 end;
62 --
63 pqh_rft_ins.ins
64 (
65 p_ref_template_id => l_ref_template_id
66 ,p_base_template_id => p_base_template_id
67 ,p_parent_template_id => p_parent_template_id
68 ,p_reference_type_cd => p_reference_type_cd
69 ,p_object_version_number => l_object_version_number
70 ,p_effective_date => trunc(p_effective_date)
71 );
72 --
73 begin
74 --
75 -- Start of API User Hook for the after hook of create_REF_TEMPLATE
76 --
77 pqh_REF_TEMPLATES_bk1.create_REF_TEMPLATE_a
78 (
79 p_ref_template_id => l_ref_template_id
80 ,p_base_template_id => p_base_template_id
81 ,p_parent_template_id => p_parent_template_id
82 ,p_reference_type_cd => p_reference_type_cd
83 ,p_object_version_number => l_object_version_number
84 ,p_effective_date => trunc(p_effective_date)
85 );
86 exception
87 when hr_api.cannot_find_prog_unit then
88 hr_api.cannot_find_prog_unit_error
89 (p_module_name => 'CREATE_REF_TEMPLATE'
90 ,p_hook_type => 'AP'
91 );
92 --
93 -- End of API User Hook for the after hook of create_REF_TEMPLATE
94 --
95 end;
96 --
97 hr_utility.set_location(l_proc, 60);
98 --
99 -- When in validation only mode raise the Validate_Enabled exception
100 --
101 if p_validate then
102 raise hr_api.validate_enabled;
103 end if;
104 --
105 -- Set all output arguments
106 --
107 p_ref_template_id := l_ref_template_id;
108 p_object_version_number := l_object_version_number;
109 --
110 hr_utility.set_location(' Leaving:'||l_proc, 70);
111 --
112 exception
113 --
114 when hr_api.validate_enabled then
115 --
116 -- As the Validate_Enabled exception has been raised
117 -- we must rollback to the savepoint
118 --
119 ROLLBACK TO create_REF_TEMPLATES;
120 --
121 -- Only set output warning arguments
122 -- (Any key or derived arguments must be set to null
123 -- when validation only mode is being used.)
124 --
125 p_ref_template_id := null;
126 p_object_version_number := null;
127 hr_utility.set_location(' Leaving:'||l_proc, 80);
128 --
129 when others then
130 p_ref_template_id := null;
131 p_object_version_number := null;
132 --
133 -- A validation or unexpected error has occured
134 --
135 ROLLBACK TO create_REF_TEMPLATES;
136 raise;
137 --
138 end create_REF_TEMPLATE;
139 -- ----------------------------------------------------------------------------
140 -- |------------------------< update_REF_TEMPLATE >--- ------------------|
141 -- ----------------------------------------------------------------------------
142 --
143 procedure update_REF_TEMPLATE
144 (p_validate in boolean default false
145 ,p_ref_template_id in number
146 ,p_base_template_id in number default hr_api.g_number
147 ,p_parent_template_id in number default hr_api.g_number
148 ,p_reference_type_cd in varchar2 default hr_api.g_varchar2
149 ,p_object_version_number in out nocopy number
150 ,p_effective_date in date
151 ) is
152 --
153 -- Declare cursors and local variables
154 --
155 l_proc varchar2(72) := g_package||'update_REF_TEMPLATE';
156 l_object_version_number pqh_ref_templates.object_version_number%TYPE;
157 --
158 begin
159 --
160 hr_utility.set_location('Entering:'|| l_proc, 10);
161 --
162 -- Issue a savepoint if operating in validation only mode
163 --
164 savepoint update_REF_TEMPLATES;
165 --
166 hr_utility.set_location(l_proc, 20);
167 --
168 -- Process Logic
169 --
170 l_object_version_number := p_object_version_number;
171 --
172 begin
173 --
174 -- Start of API User Hook for the before hook of update_REF_TEMPLATE
175 --
176 pqh_REF_TEMPLATES_bk2.update_REF_TEMPLATE_b
177 (
178 p_ref_template_id => p_ref_template_id
179 ,p_base_template_id => p_base_template_id
180 ,p_parent_template_id => p_parent_template_id
181 ,p_reference_type_cd => p_reference_type_cd
182 ,p_object_version_number => p_object_version_number
183 ,p_effective_date => trunc(p_effective_date)
184
185 );
186 exception
187 when hr_api.cannot_find_prog_unit then
188 hr_api.cannot_find_prog_unit_error
189 (p_module_name => 'UPDATE_REF_TEMPLATE'
190 ,p_hook_type => 'BP'
191 );
192 --
193 -- End of API User Hook for the before hook of update_REF_TEMPLATE
194 --
195 end;
196 --
197 pqh_rft_upd.upd
198 (
199 p_ref_template_id => p_ref_template_id
200 ,p_base_template_id => p_base_template_id
201 ,p_parent_template_id => p_parent_template_id
202 ,p_reference_type_cd => p_reference_type_cd
203 ,p_object_version_number => l_object_version_number
204 ,p_effective_date => trunc(p_effective_date)
205
206 );
207 --
208 begin
209 --
210 -- Start of API User Hook for the after hook of update_REF_TEMPLATE
211 --
212 pqh_REF_TEMPLATES_bk2.update_REF_TEMPLATE_a
213 (
214 p_ref_template_id => p_ref_template_id
215 ,p_base_template_id => p_base_template_id
216 ,p_parent_template_id => p_parent_template_id
217 ,p_reference_type_cd => p_reference_type_cd
218 ,p_object_version_number => l_object_version_number
219 ,p_effective_date => trunc(p_effective_date)
220
221 );
222 exception
223 when hr_api.cannot_find_prog_unit then
224 hr_api.cannot_find_prog_unit_error
225 (p_module_name => 'UPDATE_REF_TEMPLATE'
226 ,p_hook_type => 'AP'
227 );
228 --
229 -- End of API User Hook for the after hook of update_REF_TEMPLATE
230 --
231 end;
232 --
233 hr_utility.set_location(l_proc, 60);
234 --
235 -- When in validation only mode raise the Validate_Enabled exception
236 --
237 if p_validate then
238 raise hr_api.validate_enabled;
239 end if;
240 --
241 -- Set all output arguments
242 --
243 p_object_version_number := l_object_version_number;
244 --
245 hr_utility.set_location(' Leaving:'||l_proc, 70);
246 --
247 exception
248 --
249 when hr_api.validate_enabled then
250 --
251 -- As the Validate_Enabled exception has been raised
252 -- we must rollback to the savepoint
253 --
254 ROLLBACK TO update_REF_TEMPLATES;
255 --
256 -- Only set output warning arguments
257 -- (Any key or derived arguments must be set to null
258 -- when validation only mode is being used.)
259 --
260 hr_utility.set_location(' Leaving:'||l_proc, 80);
261 --
262 when others then
263 p_object_version_number := l_object_version_number;
264 --
265 -- A validation or unexpected error has occured
266 --
267 ROLLBACK TO update_REF_TEMPLATES;
268 raise;
269 --
270 end update_REF_TEMPLATE;
271 -- ----------------------------------------------------------------------------
272 -- |------------------------< delete_REF_TEMPLATE >----------------------|
273 -- ----------------------------------------------------------------------------
274 --
275 procedure delete_REF_TEMPLATE
276 (p_validate in boolean default false
277 ,p_ref_template_id in number
278 ,p_object_version_number in number
279 ,p_effective_date in date
280 ) is
281 --
282 -- Declare cursors and local variables
283 --
284 l_proc varchar2(72) := g_package||'delete_REF_TEMPLATE';
285 l_object_version_number pqh_ref_templates.object_version_number%TYPE;
286 --
287 begin
288 --
289 hr_utility.set_location('Entering:'|| l_proc, 10);
290 --
291 -- Issue a savepoint if operating in validation only mode
292 --
293 savepoint delete_REF_TEMPLATES;
294 --
295 hr_utility.set_location(l_proc, 20);
296 --
297 -- Process Logic
298 --
299 l_object_version_number := p_object_version_number;
300 --
301 --
302 begin
303 --
304 -- Start of API User Hook for the before hook of delete_REF_TEMPLATE
305 --
306 pqh_REF_TEMPLATES_bk3.delete_REF_TEMPLATE_b
307 (
308 p_ref_template_id => p_ref_template_id
309 ,p_object_version_number => p_object_version_number
310 ,p_effective_date => trunc(p_effective_date)
311
312 );
313 exception
314 when hr_api.cannot_find_prog_unit then
315 hr_api.cannot_find_prog_unit_error
316 (p_module_name => 'DELETE_REF_TEMPLATE'
317 ,p_hook_type => 'BP'
318 );
319 --
320 -- End of API User Hook for the before hook of delete_REF_TEMPLATE
321 --
322 end;
323 --
324 pqh_rft_del.del
325 (
326 p_ref_template_id => p_ref_template_id
327 ,p_object_version_number => l_object_version_number
328 ,p_effective_date => trunc(p_effective_date)
329
330 );
331 --
332 begin
333 --
334 -- Start of API User Hook for the after hook of delete_REF_TEMPLATE
335 --
336 pqh_REF_TEMPLATES_bk3.delete_REF_TEMPLATE_a
337 (
338 p_ref_template_id => p_ref_template_id
339 ,p_object_version_number => l_object_version_number
340 ,p_effective_date => trunc(p_effective_date)
341
342 );
343 exception
344 when hr_api.cannot_find_prog_unit then
345 hr_api.cannot_find_prog_unit_error
346 (p_module_name => 'DELETE_REF_TEMPLATE'
347 ,p_hook_type => 'AP'
348 );
349 --
350 -- End of API User Hook for the after hook of delete_REF_TEMPLATE
351 --
352 end;
353 --
354 hr_utility.set_location(l_proc, 60);
355 --
356 -- When in validation only mode raise the Validate_Enabled exception
357 --
358 if p_validate then
359 raise hr_api.validate_enabled;
360 end if;
361 --
362 hr_utility.set_location(' Leaving:'||l_proc, 70);
363 --
364 exception
365 --
366 when hr_api.validate_enabled then
367 --
368 -- As the Validate_Enabled exception has been raised
369 -- we must rollback to the savepoint
370 --
371 ROLLBACK TO delete_REF_TEMPLATES;
372 --
373 -- Only set output warning arguments
374 -- (Any key or derived arguments must be set to null
375 -- when validation only mode is being used.)
376 --
377 --
378 when others then
379 --
380 -- A validation or unexpected error has occured
381 --
382 ROLLBACK TO delete_REF_TEMPLATES;
383 raise;
384 --
385 end delete_REF_TEMPLATE;
386 --
387 -- ----------------------------------------------------------------------------
388 -- |-------------------------------< lck >------------------------------------|
389 -- ----------------------------------------------------------------------------
390 --
391 procedure lck
392 (
393 p_ref_template_id in number
394 ,p_object_version_number in number
395 ) is
396 --
397 --
398 -- Declare cursors and local variables
399 --
400 l_proc varchar2(72) := g_package||'lck';
401 --
402 begin
403 --
404 hr_utility.set_location('Entering:'|| l_proc, 10);
405 --
406 pqh_rft_shd.lck
407 (
408 p_ref_template_id => p_ref_template_id
409 ,p_object_version_number => p_object_version_number
410 );
411 --
412 hr_utility.set_location(' Leaving:'||l_proc, 70);
413 --
414 end lck;
415 --
416 end pqh_REF_TEMPLATES_api;