[Home] [Help]
PACKAGE BODY: APPS.OTA_FRM_OBJ_INCLUSION_API
Source
1 PACKAGE BODY ota_frm_obj_inclusion_api as
2 /* $Header: otfoiapi.pkb 120.1 2005/08/05 12:19 asud noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' OTA_FRM_OBJ_INCLUSION_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- --------------------------< CREATE_FRM_OBJ_INCLUSION >---------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_frm_obj_inclusion (
13 p_validate in boolean default false
14 ,p_effective_date in date
15 ,p_object_id in number
16 ,p_object_type in varchar2
17 ,p_primary_flag in varchar2
18 ,p_start_date_active in date default sysdate
19 ,p_end_date_active in date default null
20 ,p_forum_id in number
21 ,p_object_version_number out nocopy number
22 ) is
23 --
24 -- Declare cursors and local variables
25 --
26 l_proc varchar2(72) := g_package||' create_frm_obj_inclusion';
27 l_object_version_number number;
28 l_effective_date date;
29 begin
30
31 hr_utility.set_location('Entering:'|| l_proc, 10);
32 --
33 -- Issue a savepoint
34 --
35 savepoint CREATE_FRM_OBJ_INCLUSION;
36 --
37 -- Truncate the time portion from all IN date parameters
38 --
39 l_effective_date := trunc(p_effective_date);
40 --
41 -- Call Before Process User Hook
42 --
43 begin
44 ota_frm_obj_inclusion_bk1.create_frm_obj_inclusion_b
45 ( p_effective_date => p_effective_date
46 ,p_forum_id => p_forum_id
47 ,p_object_id => p_object_id
48 ,p_object_type => p_object_type
49 ,p_start_date_active => p_start_date_active
50 ,p_end_date_active => p_end_date_active
51 ,p_primary_flag => p_primary_flag
52 ,p_object_version_number => p_object_version_number);
53 exception
54 when hr_api.cannot_find_prog_unit then
55 hr_api.cannot_find_prog_unit_error
56 (p_module_name => 'CREATE_FRM_OBJ_INCLUSION'
57 ,p_hook_type => 'BP'
58 );
59 end;
60
61 -- Validation in addition to Row Handlers
62 --
63 --
64 -- Process Logic
65 --
66
67 ota_foi_ins.ins
68 ( p_effective_date => l_effective_date
69 ,p_forum_id => p_forum_id
70 ,p_object_id => p_object_id
71 ,p_object_type => p_object_type
72 ,p_start_date_active => p_start_date_active
73 ,p_end_date_active => p_end_date_active
74 ,p_primary_flag => p_primary_flag
75 ,p_object_version_number => l_object_version_number
76 );
77 --
78 -- Call After Process User Hook
79 begin
80 ota_frm_obj_inclusion_bk1.create_frm_obj_inclusion_a
81 ( p_effective_date => p_effective_date
82 ,p_forum_id => p_forum_id
83 ,p_object_id => p_object_id
84 ,p_object_type => p_object_type
85 ,p_start_date_active => p_start_date_active
86 ,p_end_date_active => p_end_date_active
87 ,p_primary_flag => p_primary_flag
88 ,p_object_version_number => p_object_version_number);
89 exception
90 when hr_api.cannot_find_prog_unit then
91 hr_api.cannot_find_prog_unit_error
92 (p_module_name => 'CREATE_FRM_OBJ_INCLUSION'
93 ,p_hook_type => 'AP'
94 );
95 end;
96 --
97 -- When in validation only mode raise the Validate_Enabled exception
98 --
99 if p_validate then
100 raise hr_api.validate_enabled;
101 end if;
102 --
103 -- Set all output arguments
104 --
105 p_object_version_number := l_object_version_number;
106
107
108 hr_utility.set_location(' Leaving:'||l_proc, 70);
109 exception
110 when hr_api.validate_enabled then
111 --
112 -- As the Validate_Enabled exception has been raised
113 -- we must rollback to the savepoint
114 --
115 rollback to CREATE_FRM_OBJ_INCLUSION;
116 --
117 -- Only set output warning arguments
118 -- (Any key or derived arguments must be set to null
119 -- when validation only mode is being used.)
120 --
121 p_object_version_number := null;
122 hr_utility.set_location(' Leaving:'||l_proc, 80);
123 when others then
124 --
125 -- A validation or unexpected error has occured
126 --
127 rollback to CREATE_FRM_OBJ_INCLUSION;
128 p_object_version_number := null;
129 hr_utility.set_location(' Leaving:'||l_proc, 90);
130 raise;
131
132 end create_frm_obj_inclusion;
133 --
134 -- ----------------------------------------------------------------------------
135 -- --------------------------< UPDATE_FRM_OBJ_INCLUSION >---------------------|
136 -- ----------------------------------------------------------------------------
137 --
138 procedure update_frm_obj_inclusion (
139 p_validate in boolean default false
140 ,p_effective_date in date
141 ,p_object_id in number
142 ,p_object_type in varchar2
143 ,p_primary_flag in varchar2 default hr_api.g_varchar2
144 ,p_start_date_active in date default hr_api.g_date
145 ,p_end_date_active in date default hr_api.g_date
146 ,p_forum_id in number
147 ,p_object_version_number in out nocopy number
148 ) is
149 --
150 -- Declare cursors and local variables
151 --
152 l_proc varchar2(72) := g_package||' update_frm_obj_inclusion';
153 l_object_version_number number := p_object_version_number;
154 l_effective_date date;
155 begin
156
157 hr_utility.set_location('Entering:'|| l_proc, 10);
158 --
159 -- Issue a savepoint
160 --
161 savepoint UPDATE_FRM_OBJ_INCLUSION;
162 --
163 -- Truncate the time portion from all IN date parameters
164 --
165 l_effective_date := trunc(p_effective_date);
166 --
167 -- Call Before Process User Hook
168 --
169 begin
170 ota_frm_obj_inclusion_bk2.update_frm_obj_inclusion_b
171 ( p_effective_date => l_effective_date
172 ,p_forum_id => p_forum_id
173 ,p_object_id => p_object_id
174 ,p_object_type => p_object_type
175 ,p_start_date_active => p_start_date_active
176 ,p_end_date_active => p_end_date_active
177 ,p_primary_flag => p_primary_flag
178 ,p_object_version_number => l_object_version_number);
179 exception
180 when hr_api.cannot_find_prog_unit then
181 hr_api.cannot_find_prog_unit_error
182 (p_module_name => 'UPDATE_FRM_OBJ_INCLUSION'
183 ,p_hook_type => 'BP'
184 );
185 end;
186
187 -- Validation in addition to Row Handlers
188 --
189 --
190 -- Process Logic
191 --
192
193 ota_foi_upd.upd
194 ( p_effective_date => l_effective_date
195 ,p_forum_id => p_forum_id
196 ,p_object_id => p_object_id
197 ,p_object_type => p_object_type
198 ,p_start_date_active => p_start_date_active
199 ,p_end_date_active => p_end_date_active
200 ,p_primary_flag => p_primary_flag
201 ,p_object_version_number => l_object_version_number
202 );
203 --
204 -- Call After Process User Hook
205 begin
206 ota_frm_obj_inclusion_bk2.update_frm_obj_inclusion_a
207 ( p_effective_date => l_effective_date
208 ,p_forum_id => p_forum_id
209 ,p_object_id => p_object_id
210 ,p_object_type => p_object_type
211 ,p_start_date_active => p_start_date_active
212 ,p_end_date_active => p_end_date_active
213 ,p_primary_flag => p_primary_flag
214 ,p_object_version_number => l_object_version_number);
215 exception
216 when hr_api.cannot_find_prog_unit then
217 hr_api.cannot_find_prog_unit_error
218 (p_module_name => 'UPDATE_FRM_OBJ_INCLUSION'
219 ,p_hook_type => 'AP'
220 );
221 end;
222 --
223 -- When in validation only mode raise the Validate_Enabled exception
224 --
225 if p_validate then
226 raise hr_api.validate_enabled;
227 end if;
228 --
229
230
231 hr_utility.set_location(' Leaving:'||l_proc, 70);
232 exception
233 when hr_api.validate_enabled then
234 --
235 -- As the Validate_Enabled exception has been raised
236 -- we must rollback to the savepoint
237 --
238 rollback to UPDATE_FRM_OBJ_INCLUSION;
239 --
240 -- Only set output warning arguments
241 -- (Any key or derived arguments must be set to null
242 -- when validation only mode is being used.)
243 --
244 p_object_version_number := l_object_version_number;
245 hr_utility.set_location(' Leaving:'||l_proc, 80);
246 when others then
247 --
248 -- A validation or unexpected error has occured
249 --
250 rollback to UPDATE_FRM_OBJ_INCLUSION;
251 p_object_version_number := l_object_version_number;
252 hr_utility.set_location(' Leaving:'||l_proc, 90);
253 raise;
254
255 end update_frm_obj_inclusion;
256
257 -- ----------------------------------------------------------------------------
258 -- |-------------------------< DELETE_FRM_OBJ_INCLUSION >- ------------------|
259 -- ----------------------------------------------------------------------------
260 --
261 procedure delete_frm_obj_inclusion
262 (p_validate in boolean default false
263 ,p_forum_id in number
264 ,p_object_id in number
265 ,p_object_type in varchar2
266 ,p_object_version_number in number
267
268 ) is
269 --
270 -- Declare cursors and local variables
271 --
272 l_proc varchar2(72) := g_package||' delete_frm_obj_inclusion';
273 l_object_version_id number;
274 --
275 --
276 begin
277
278 hr_utility.set_location('Entering:'|| l_proc, 10);
279 --
280 -- Issue a savepoint
281 --
282 savepoint DELETE_FRM_OBJ_INCLUSION;
283 --
284 -- Truncate the time portion from all IN date parameters
285 --
286 --
287
288 -- Call Before Process User Hook
289 begin
290 ota_frm_obj_inclusion_bk3.delete_frm_obj_inclusion_b
291 (p_forum_id => p_forum_id
292 ,p_object_id => p_object_id
293 ,p_object_type => p_object_type
294 ,p_object_version_number => p_object_version_number
295 );
296 exception
297 when hr_api.cannot_find_prog_unit then
298 hr_api.cannot_find_prog_unit_error
299 (p_module_name => 'DELETE_FRM_OBJ_INCLUSION'
300 ,p_hook_type => 'BP'
301 );
302 end;
303
304 --
305 -- Validation in addition to Row Handlers
306 --
307 --
308 -- Process Logic
309 --
310 ota_foi_del.del
311 (p_forum_id => p_forum_id
312 ,p_object_id => p_object_id
313 ,p_object_type => p_object_type
314 ,p_object_version_number => p_object_version_number
315 );
316
317
318 --
319 -- Call After Process User Hook
320 begin
321 ota_frm_obj_inclusion_bk3.delete_frm_obj_inclusion_a
322 (p_forum_id => p_forum_id
323 ,p_object_id => p_object_id
324 ,p_object_type => p_object_type
325 ,p_object_version_number => p_object_version_number
326 );
327 exception
328 when hr_api.cannot_find_prog_unit then
329 hr_api.cannot_find_prog_unit_error
330 (p_module_name => 'DELETE_FRM_OBJ_INCLUSION'
331 ,p_hook_type => 'AP'
332 );
333 end;
334 --
335 -- When in validation only mode raise the Validate_Enabled exception
336 --
337 if p_validate then
338 raise hr_api.validate_enabled;
339 end if;
340 --
341 -- Set all output arguments
342 --
343 --
344 hr_utility.set_location(' Leaving:'||l_proc, 170);
345 exception
346 when hr_api.validate_enabled then
347 --
348 -- As the Validate_Enabled exception has been raised
349 -- we must rollback to the savepoint
350 --
351 rollback to DELETE_FRM_OBJ_INCLUSION;
352 --
353 -- Only set output warning arguments
354 -- (Any key or derived arguments must be set to null
355 -- when validation only mode is being used.)
356 --
357 hr_utility.set_location(' Leaving:'||l_proc, 180);
358 when others then
359 --
360 -- A validation or unexpected error has occured
361 --
362 rollback to DELETE_FRM_OBJ_INCLUSION;
363 hr_utility.set_location(' Leaving:'||l_proc, 190);
364 raise;
365
366 end delete_frm_obj_inclusion;
367 --
368 end ota_frm_obj_inclusion_api;