[Home] [Help]
PACKAGE BODY: APPS.PQH_DOCUMENT_ATTRIBUTES_API
Source
1 Package BODY pqh_document_attributes_api as
2 /* $Header: pqdoaapi.pkb 115.1 2003/03/06 20:55:24 nsanghal noship $ */
3 --
4 --
5 -- Package Variables
6 --
7 g_package varchar2(33) := ' PQH_DOCUMENT_ATTRIBUTES_API.';
8 --
9 -- ----------------------------------------------------------------------------
10 -- |--------------------------<CREATE_DOCUMENT_ATTRIBUTE>--------------------------|
11 -- ----------------------------------------------------------------------------
12 --
13 procedure create_document_attribute
14 (p_validate in boolean default false
15 ,p_effective_date in date
16 ,p_document_id in number
17 ,p_attribute_id in number
18 ,p_tag_name in varchar2
19 ,p_document_attribute_id out NOCOPY number
20 ,p_object_version_number out NOCOPY number
21 ,p_effective_start_date out NOCOPY date
22 ,p_effective_end_date out NOCOPY date
23 ) is
24 --
25 -- Declare cursors and local variables
26 --
27 l_proc varchar2(72) := g_package||'CREATE_DOCUMENT_ATTRIBUTE';
28
29 l_document_attribute_id pqh_document_attributes_f.document_attribute_id%TYPE;
30 l_object_version_number pqh_document_attributes_f.object_version_number%TYPE;
31 l_effective_start_date pqh_document_attributes_f.effective_start_date%TYPE;
32 l_effective_end_date pqh_document_attributes_f.effective_end_date%TYPE;
33 --
34 begin
35 hr_utility.set_location('Entering:'|| l_proc, 10);
36 --
37 -- Issue a savepoint
38 --
39 savepoint CREATE_DOCUMENT_ATTRIBUTE;
40 --
41 -- Truncate the time portion from all IN date parameters
42 --
43
44 --
45 -- Call Before Process User Hook
46 begin
47 PQH_DOCUMENT_ATTRIBUTES_BK1.create_document_attribute_b
48 ( p_effective_date => p_effective_date
49 ,p_document_id => p_document_id
50 ,p_attribute_id => p_attribute_id
51 ,p_tag_name => p_tag_name
52 );
53 exception
54 when hr_api.cannot_find_prog_unit then
55 hr_api.cannot_find_prog_unit_error
56 (p_module_name => 'CREATE_DOCUMENT_ATTRIBUTE'
57 ,p_hook_type => 'BP'
58 );
59 end;
60 --
61 -- Validation in addition to Row Handlers
62 --
63 --
64 -- Process Logic
65 --
66 pqh_doA_ins.ins
67 (p_effective_date => p_effective_date
68 ,p_document_id => p_document_id
69 ,p_attribute_id => p_attribute_id
70 ,p_tag_name => p_tag_name
71 ,p_document_attribute_id => l_document_attribute_id
72 ,p_object_version_number => l_object_version_number
73 ,p_effective_start_date => l_effective_start_date
74 ,p_effective_end_date => l_effective_end_date
75 );
76
77 --
78 -- Call After Process User Hook
79 --
80 begin
81 PQH_DOCUMENT_ATTRIBUTES_BK1.create_document_attribute_a
82 ( p_effective_date => p_effective_date
83 ,p_document_id => p_document_id
84 ,p_attribute_id => p_attribute_id
85 ,p_tag_name => p_tag_name
86 ,p_document_attribute_id => l_document_attribute_id
87 ,p_object_version_number => l_object_version_number
88 ,p_effective_start_date => l_effective_start_date
89 ,p_effective_end_date => l_effective_end_date
90 );
91
92 exception
93 when hr_api.cannot_find_prog_unit then
94 hr_api.cannot_find_prog_unit_error
95 (p_module_name => 'CREATE_DOCUMENT_ATTRIBUTE'
96 ,p_hook_type => 'AP'
97 );
98 end;
99
100 --
101 -- When in validation only mode raise the Validate_Enabled exception
102 --
103 if p_validate then
104 raise hr_api.validate_enabled;
105 end if;
106 --
107 -- Set all output arguments
108 --
109 p_document_attribute_id := l_document_attribute_id;
110 p_object_version_number := l_object_version_number;
111 p_effective_start_date := l_effective_start_date;
112 p_effective_end_date := l_effective_end_date;
113 --
114 hr_utility.set_location(' Leaving:'||l_proc, 70);
115 exception
116 when hr_api.validate_enabled then
117 --
118 -- As the Validate_Enabled exception has been raised
119 -- we must rollback to the savepoint
120 --
121 rollback to CREATE_DOCUMENT_ATTRIBUTE;
122 --
123 -- Only set output warning arguments
124 -- (Any key or derived arguments must be set to null
125 -- when validation only mode is being used.)
126 --
127 p_document_attribute_id := null;
128 p_object_version_number := null;
129 p_effective_start_date := null;
130 p_effective_end_date := null;
131 hr_utility.set_location(' Leaving:'||l_proc, 80);
132 --
133 when others then
134 --
135 -- A validation or unexpected error has occured
136 --
137 p_document_attribute_id := null;
138 p_object_version_number := null;
139 p_effective_start_date := null;
140 p_effective_end_date := null;
141
142 rollback to CREATE_DOCUMENT_ATTRIBUTE;
143 hr_utility.set_location(' Leaving:'||l_proc, 90);
144 raise;
145 end create_document_attribute;
146
147 --
148 -- ----------------------------------------------------------------------------
149 -- |--------------------------<update_document_attribute>--------------------------|
150 -- ----------------------------------------------------------------------------
151 --
152 procedure update_document_attribute
153 (p_validate in boolean default false
154 ,p_effective_date in date
155 ,p_datetrack_mode in varchar2
156 ,p_document_attribute_id in number
157 ,p_object_version_number in out NOCOPY number
158 ,p_document_id in number default hr_api.g_number
159 ,p_attribute_id in number default hr_api.g_number
160 ,p_tag_name in varchar2 default hr_api.g_varchar2
161 ,p_effective_start_date out NOCOPY date
162 ,p_effective_end_date out NOCOPY date
163 ) is
164
165 --
166 -- Declare cursors and local variables
167 --
168
169 l_proc varchar2(72) := g_package||'UPDATE_DOCUMENT_ATTRIBUTE';
170
171 l_effective_start_date pqh_DOCUMENT_ATTRIBUTES_f.effective_start_date%TYPE;
172 l_effective_end_date pqh_DOCUMENT_ATTRIBUTES_f.effective_end_date%TYPE;
173 l_object_version_number number := p_object_version_number;
174 --
175 begin
176 hr_utility.set_location('Entering:'|| l_proc, 10);
177 --
178 -- Issue a savepoint
179 --
180 savepoint UPDATE_DOCUMENT_ATTRIBUTE;
181 --
182 -- Truncate the time portion from all IN date parameters
183 --
184
185 --
186 -- Call Before Process User Hook
187 begin
188 PQH_DOCUMENT_ATTRIBUTES_BK2.update_document_attribute_b
189 (p_effective_date => p_effective_date
190 ,p_datetrack_mode => p_datetrack_mode
191 ,p_document_attribute_id => p_document_attribute_id
192 ,p_object_version_number => p_object_version_number
193 ,p_document_id => p_document_id
194 ,p_attribute_id => p_attribute_id
195 ,p_tag_name => p_tag_name
196 );
197
198 exception
199 when hr_api.cannot_find_prog_unit then
200 hr_api.cannot_find_prog_unit_error
201 (p_module_name => 'UPDATE_DOCUMENT_ATTRIBUTE'
202 ,p_hook_type => 'BP'
203 );
204 end;
205 --
206 -- Validation in addition to Row Handlers
207 --
208 -- Process Logic
209 --
210 pqh_doa_upd.upd
211 (p_effective_date => p_effective_date
212 ,p_datetrack_mode => p_datetrack_mode
213 ,p_document_attribute_id => p_document_attribute_id
214 ,p_object_version_number => p_object_version_number
215 ,p_document_id => p_document_id
216 ,p_attribute_id => p_attribute_id
217 ,p_tag_name => p_tag_name
218 ,p_effective_start_date => l_effective_start_date
219 ,p_effective_end_date => l_effective_end_date
220 );
221 --
222
223 --
224 -- Call After Process User Hook
225 --
226 begin
227 PQH_DOCUMENT_ATTRIBUTES_BK2.update_document_attribute_a
228 (p_effective_date => p_effective_date
229 ,p_datetrack_mode => p_datetrack_mode
230 ,p_document_attribute_id => p_document_attribute_id
231 ,p_object_version_number => p_object_version_number
232 ,p_document_id => p_document_id
233 ,p_attribute_id => p_attribute_id
234 ,p_tag_name => p_tag_name
235 ,p_effective_start_date => l_effective_start_date
236 ,p_effective_end_date => l_effective_end_date
237 );
238
239
240 exception
241 when hr_api.cannot_find_prog_unit then
242 hr_api.cannot_find_prog_unit_error
243 (p_module_name => 'UPDATE_DOCUMENT_ATTRIBUTE'
244 ,p_hook_type => 'AP'
245 );
246 end;
247 --
248 -- When in validation only mode raise the Validate_Enabled exception
249 --
250 if p_validate then
251 raise hr_api.validate_enabled;
252 end if;
253 --
254 -- Set all output arguments
255 --
256
257 p_object_version_number := l_object_version_number;
258 p_effective_start_date := l_effective_start_date;
259 p_effective_end_date := l_effective_end_date;
260 --
261 hr_utility.set_location(' Leaving:'||l_proc, 70);
262 exception
263 when hr_api.validate_enabled then
264 --
265 -- As the Validate_Enabled exception has been raised
266 -- we must rollback to the savepoint
267 --
268 rollback to UPDATE_DOCUMENT_ATTRIBUTE;
269 --
270 -- Only set output warning arguments
271 -- (Any key or derived arguments must be set to null
272 -- when validation only mode is being used.)
273 --
274 -- p_document_id := null;
275 p_object_version_number := null;
276 p_effective_start_date := null;
277 p_effective_end_date := null;
278 hr_utility.set_location(' Leaving:'||l_proc, 80);
279 --
280 when others then
281 --
282 -- A validation or unexpected error has occured
283 --
284 -- p_document_id := null;
285 p_object_version_number := null;
286 p_effective_start_date := null;
287 p_effective_end_date := null;
288
289 rollback to UPDATE_DOCUMENT_ATTRIBUTE;
290 hr_utility.set_location(' Leaving:'||l_proc, 90);
291 raise;
292 end update_document_attribute;
293
294
295 -- ----------------------------------------------------------------------------
296 -- |--------------------------<DELETE_DOCUMENT_ATTRIBUTE>--------------------------|
297 -- ----------------------------------------------------------------------------
298 -- {Start Of Comments}
299 --
300 -- Description:
301 --
302 --
303 -- Prerequisites:
304 --
305 --
306 -- In Parameters:
307 -- Name Reqd Type Description
308 --
309 --
310 -- Post Success:
311 --
312 --
313 -- Name Type Description
314 --
315 -- Post Failure:
316 --
317 --
318 -- Access Status:
319 -- Public.
320 --
321 -- {End Of Comments}
322 --
323 procedure delete_document_attribute
324 (p_validate in boolean default false
325 ,p_effective_date in date
326 ,p_datetrack_mode in varchar2
327 ,p_document_attribute_id in number
328 ,p_object_version_number in OUT NOCOPY number
329 ,p_effective_start_date OUT NOCOPY date
330 ,p_effective_end_date OUT NOCOPY date
331 )
332 is
333 --
334 -- Declare cursors and local variables
335 --
336
337 l_proc varchar2(72) := g_package||'DELETE_DOCUMENT_ATTRIBUTE';
338 l_effective_start_date pqh_DOCUMENT_ATTRIBUTES_f.effective_start_date%TYPE;
339 l_effective_end_date pqh_DOCUMENT_ATTRIBUTES_f.effective_end_date%TYPE;
340 l_object_version_number number := p_object_version_number;
341 --
342 begin
343 hr_utility.set_location('Entering:'|| l_proc, 10);
344 --
345 -- Issue a savepoint
346 --
347 savepoint DELETE_DOCUMENT_ATTRIBUTE;
348 --
349 -- Truncate the time portion from all IN date parameters
350 --
351
352 --
353 -- Call Before Process User Hook
354 --
355 begin
356 PQH_DOCUMENT_ATTRIBUTES_BK3.delete_document_attribute_b
357 (p_effective_date => p_effective_date
358 ,p_datetrack_mode => p_datetrack_mode
359 ,p_document_attribute_id => p_document_attribute_id
360 ,p_object_version_number => p_object_version_number
361 );
362 exception
363 when hr_api.cannot_find_prog_unit then
364 hr_api.cannot_find_prog_unit_error
365 (p_module_name => 'DELETE_DOCUMENT_ATTRIBUTE'
366 ,p_hook_type => 'BP'
367 );
368 end;
369 --
370 -- Validation in addition to Row Handlers
371 --
372 -- Process Logic
373 --
374 pqh_doa_del.del
375 (p_effective_date => p_effective_date
376 ,p_datetrack_mode => p_datetrack_mode
377 ,p_document_attribute_id => p_document_attribute_id
378 ,p_object_version_number => p_object_version_number
379 ,p_effective_start_date => l_effective_start_date
380 ,p_effective_end_date => l_effective_end_date
381 );
382
383 --
384 -- Call After Process User Hook
385 --
386 begin
387 PQH_DOCUMENT_ATTRIBUTES_BK3.delete_document_attribute_a
388 (p_effective_date => p_effective_date
389 ,p_datetrack_mode => p_datetrack_mode
390 ,p_document_attribute_id => p_document_attribute_id
391 ,p_object_version_number => p_object_version_number
392 ,p_effective_start_date => l_effective_start_date
393 ,p_effective_end_date => l_effective_end_date
394 );
395 exception
396 when hr_api.cannot_find_prog_unit then
397 hr_api.cannot_find_prog_unit_error
398 (p_module_name => 'DELETE_DOCUMENT_ATTRIBUTE'
399 ,p_hook_type => 'AP'
400 );
401 end;
402 --
403 -- When in validation only mode raise the Validate_Enabled exception
404 --
405 if p_validate then
406 raise hr_api.validate_enabled;
407 end if;
408 --
409 p_object_version_number := p_object_version_number;
410 p_effective_start_date := l_effective_start_date;
411 p_effective_end_date := l_effective_end_date;
412 --
413 --
414 hr_utility.set_location(' Leaving:'||l_proc, 70);
415 exception
416 when hr_api.validate_enabled then
417 --
418 -- As the Validate_Enabled exception has been raised
419 -- we must rollback to the savepoint
420 --
421 rollback to DELETE_DOCUMENT_ATTRIBUTE;
422 --
423 -- Only set output warning arguments
424 -- (Any key or derived arguments must be set to null
425 -- when validation only mode is being used.)
426 --
427 p_object_version_number := l_object_version_number;
428 p_effective_start_date := null;
429 p_effective_end_date := null;
430 --
431 hr_utility.set_location(' Leaving:'||l_proc, 80);
432 when others then
433 --
434 -- A validation or unexpected error has occured
435 --
436 p_object_version_number := l_object_version_number;
437 p_effective_start_date := null;
438 p_effective_end_date := null;
439
440 rollback to DELETE_DOCUMENT_ATTRIBUTE;
441 hr_utility.set_location(' Leaving:'||l_proc, 90);
442 raise;
443 --
444 end delete_document_attribute;
445 --
446 end pqh_DOCUMENT_ATTRIBUTES_api;