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