DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_PVT_FRM_THREAD_USERS_SWI

Source


1 Package Body ota_pvt_frm_thread_users_swi As
2 /* $Header: otftuswi.pkb 120.1 2005/08/10 17:51 asud noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'ota_pvt_frm_thread_users_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |----------------------< create_pvt_frm_thread_user >----------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_pvt_frm_thread_user
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_effective_date               in     date
14   ,p_forum_thread_id              in     number
15   ,p_forum_id                     in     number
16   ,p_person_id                    in     number
17   ,p_contact_id                   in     number
18   ,p_business_group_id            in     number
19   ,p_author_person_id             in     number    default null
20   ,p_author_contact_id            in     number    default null
21   ,p_object_version_number           out nocopy number
22   ,p_return_status                   out nocopy varchar2
23   ) is
24   --
25   -- Variables for API Boolean parameters
26   l_validate                      boolean;
27   --
28   -- Variables for IN/OUT parameters
29   --
30   -- Other variables
31   l_proc    varchar2(72) := g_package ||'create_pvt_frm_thread_user';
32 Begin
33   hr_utility.set_location(' Entering:' || l_proc,10);
34   --
35   -- Issue a savepoint
36   --
37   savepoint create_pvt_frm_thread_user_swi;
38   --
39   -- Initialise Multiple Message Detection
40   --
41   hr_multi_message.enable_message_list;
42   --
43   -- Remember IN OUT parameter IN values
44   --
45   --
46   -- Convert constant values to their corresponding boolean value
47   --
48   l_validate :=
49     hr_api.constant_to_boolean
50       (p_constant_value => p_validate);
51   --
52   -- Register Surrogate ID or user key values
53   --
54   --
55   -- Call API
56   --
57   ota_pvt_frm_thread_users_api.create_pvt_frm_thread_user
58     (p_validate                     => l_validate
59     ,p_effective_date               => p_effective_date
60     ,p_forum_thread_id              => p_forum_thread_id
61     ,p_forum_id                     => p_forum_id
62     ,p_person_id                    => p_person_id
63     ,p_contact_id                   => p_contact_id
64     ,p_business_group_id            => p_business_group_id
65     ,p_author_person_id             => p_author_person_id
66     ,p_author_contact_id            => p_author_contact_id
67     ,p_object_version_number        => p_object_version_number
68     );
69   --
70   -- Convert API warning boolean parameter values to specific
71   -- messages and add them to Multiple Message List
72   --
73   --
74   -- Convert API non-warning boolean parameter values
75   --
76   --
77   -- Derive the API return status value based on whether
78   -- messages of any type exist in the Multiple Message List.
79   -- Also disable Multiple Message Detection.
80   --
81   p_return_status := hr_multi_message.get_return_status_disable;
82   hr_utility.set_location(' Leaving:' || l_proc,20);
83   --
84 exception
85   when hr_multi_message.error_message_exist then
86     --
87     -- Catch the Multiple Message List exception which
88     -- indicates API processing has been aborted because
89     -- at least one message exists in the list.
90     --
91     rollback to create_pvt_frm_thread_user_swi;
92     --
93     -- Reset IN OUT parameters and set OUT parameters
94     --
95     p_object_version_number        := null;
96     p_return_status := hr_multi_message.get_return_status_disable;
97     hr_utility.set_location(' Leaving:' || l_proc, 30);
98   when others then
99     --
100     -- When Multiple Message Detection is enabled catch
101     -- any Application specific or other unexpected
102     -- exceptions.  Adding appropriate details to the
103     -- Multiple Message List.  Otherwise re-raise the
104     -- error.
105     --
106     rollback to create_pvt_frm_thread_user_swi;
107     if hr_multi_message.unexpected_error_add(l_proc) then
108        hr_utility.set_location(' Leaving:' || l_proc,40);
109        raise;
110     end if;
111     --
112     -- Reset IN OUT and set OUT parameters
113     --
114     p_object_version_number        := null;
115     p_return_status := hr_multi_message.get_return_status_disable;
116     hr_utility.set_location(' Leaving:' || l_proc,50);
117 end create_pvt_frm_thread_user;
118 --
119 -- ----------------------------------------------------------------------------
120 -- |----------------------< update_pvt_frm_thread_user >----------------------|
121 -- ----------------------------------------------------------------------------
122 PROCEDURE update_pvt_frm_thread_user
123   (p_validate                     in     number    default hr_api.g_false_num
124   ,p_effective_date               in     date
125   ,p_forum_thread_id              in     number
126   ,p_forum_id                     in     number
127   ,p_person_id                    in     number
128   ,p_contact_id                   in     number
129   ,p_business_group_id            in     number
130   ,p_author_person_id             in     number    default null
131   ,p_author_contact_id            in     number    default null
132   ,p_object_version_number        in out nocopy number
133   ,p_return_status                   out nocopy varchar2
134   ) is
135   --
136   -- Variables for API Boolean parameters
137   l_validate                      boolean;
138   --
139   -- Variables for IN/OUT parameters
140   --
141   -- Other variables
142   l_proc    varchar2(72) := g_package ||'update_pvt_frm_thread_user';
143 Begin
144   hr_utility.set_location(' Entering:' || l_proc,10);
145   --
146   -- Issue a savepoint
147   --
148   savepoint update_pvt_frm_thread_user_swi;
149   --
150   -- Initialise Multiple Message Detection
151   --
152   hr_multi_message.enable_message_list;
153   --
154   -- Remember IN OUT parameter IN values
155   --
156   --
157   -- Convert constant values to their corresponding boolean value
158   --
159   l_validate :=
160     hr_api.constant_to_boolean
161       (p_constant_value => p_validate);
162   --
163   --
164   --
165   -- Call API
166   --
167   ota_pvt_frm_thread_users_api.update_pvt_frm_thread_user
168     (p_validate                     => l_validate
169     ,p_effective_date               => p_effective_date
170     ,p_forum_thread_id              => p_forum_thread_id
171     ,p_forum_id                     => p_forum_id
172     ,p_person_id                    => p_person_id
173     ,p_contact_id                   => p_contact_id
174     ,p_business_group_id            => p_business_group_id
175     ,p_author_person_id             => p_author_person_id
176     ,p_author_contact_id            => p_author_contact_id
177     ,p_object_version_number        => p_object_version_number
178     );
179   --
180   -- Convert API warning boolean parameter values to specific
181   -- messages and add them to Multiple Message List
182   --
183   --
184   -- Convert API non-warning boolean parameter values
185   --
186   --
187   -- Derive the API return status value based on whether
188   -- messages of any type exist in the Multiple Message List.
189   -- Also disable Multiple Message Detection.
190   --
191   p_return_status := hr_multi_message.get_return_status_disable;
192   hr_utility.set_location(' Leaving:' || l_proc,20);
193   --
194 exception
195   when hr_multi_message.error_message_exist then
196     --
197     -- Catch the Multiple Message List exception which
198     -- indicates API processing has been aborted because
199     -- at least one message exists in the list.
200     --
201     rollback to update_pvt_frm_thread_user_swi;
202     --
203     -- Reset IN OUT parameters and set OUT parameters
204     --
205     p_object_version_number        := null;
206     p_return_status := hr_multi_message.get_return_status_disable;
207     hr_utility.set_location(' Leaving:' || l_proc, 30);
208   when others then
209     --
210     -- When Multiple Message Detection is enabled catch
211     -- any Application specific or other unexpected
212     -- exceptions.  Adding appropriate details to the
213     -- Multiple Message List.  Otherwise re-raise the
214     -- error.
215     --
216     rollback to update_pvt_frm_thread_user_swi;
217     if hr_multi_message.unexpected_error_add(l_proc) then
218        hr_utility.set_location(' Leaving:' || l_proc,40);
219        raise;
220     end if;
221     --
222     -- Reset IN OUT and set OUT parameters
223     --
224     p_object_version_number        := null;
225     p_return_status := hr_multi_message.get_return_status_disable;
226     hr_utility.set_location(' Leaving:' || l_proc,50);
227 end update_pvt_frm_thread_user;
228 -- ----------------------------------------------------------------------------
229 -- |----------------------< delete_pvt_frm_thread_user >----------------------|
230 -- ----------------------------------------------------------------------------
231 PROCEDURE delete_pvt_frm_thread_user
232   (p_validate                     in     number    default hr_api.g_false_num
233   ,p_forum_thread_id              in     number
234   ,p_forum_id                     in     number
235   ,p_person_id                    in     number
236   ,p_contact_id                   in     number
237   ,p_object_version_number        in     number
238   ,p_return_status                   out nocopy varchar2
239   ) is
240   --
241   -- Variables for API Boolean parameters
242   l_validate                      boolean;
243   --
244   -- Variables for IN/OUT parameters
245   --
246   -- Other variables
247   l_proc    varchar2(72) := g_package ||'delete_pvt_frm_thread_user';
248 Begin
249   hr_utility.set_location(' Entering:' || l_proc,10);
250   --
251   -- Issue a savepoint
252   --
253   savepoint delete_pvt_frm_thread_user_swi;
254   --
255   -- Initialise Multiple Message Detection
256   --
257   hr_multi_message.enable_message_list;
258   --
259   -- Remember IN OUT parameter IN values
260   --
261   --
262   -- Convert constant values to their corresponding boolean value
263   --
264   l_validate :=
265     hr_api.constant_to_boolean
266       (p_constant_value => p_validate);
267   --
268   -- Register Surrogate ID or user key values
269   --
270   --
271   -- Call API
272   --
273   ota_pvt_frm_thread_users_api.delete_pvt_frm_thread_user
274     (p_validate                     => l_validate
275     ,p_forum_thread_id              => p_forum_thread_id
276     ,p_forum_id                     => p_forum_id
277     ,p_person_id                    => p_person_id
278     ,p_contact_id                   => p_contact_id
279     ,p_object_version_number        => p_object_version_number
280     );
281   --
282   -- Convert API warning boolean parameter values to specific
283   -- messages and add them to Multiple Message List
284   --
285   --
286   -- Convert API non-warning boolean parameter values
287   --
288   --
289   -- Derive the API return status value based on whether
290   -- messages of any type exist in the Multiple Message List.
291   -- Also disable Multiple Message Detection.
292   --
293   p_return_status := hr_multi_message.get_return_status_disable;
294   hr_utility.set_location(' Leaving:' || l_proc,20);
295   --
296 exception
297   when hr_multi_message.error_message_exist then
298     --
299     -- Catch the Multiple Message List exception which
300     -- indicates API processing has been aborted because
301     -- at least one message exists in the list.
302     --
303     rollback to delete_pvt_frm_thread_user_swi;
304     --
305     -- Reset IN OUT parameters and set OUT parameters
306     --
307     p_return_status := hr_multi_message.get_return_status_disable;
308     hr_utility.set_location(' Leaving:' || l_proc, 30);
309   when others then
310     --
311     -- When Multiple Message Detection is enabled catch
312     -- any Application specific or other unexpected
313     -- exceptions.  Adding appropriate details to the
314     -- Multiple Message List.  Otherwise re-raise the
315     -- error.
316     --
317     rollback to delete_pvt_frm_thread_user_swi;
318     if hr_multi_message.unexpected_error_add(l_proc) then
319        hr_utility.set_location(' Leaving:' || l_proc,40);
320        raise;
321     end if;
322     --
323     -- Reset IN OUT and set OUT parameters
324     --
325     p_return_status := hr_multi_message.get_return_status_disable;
326     hr_utility.set_location(' Leaving:' || l_proc,50);
327 end delete_pvt_frm_thread_user;
328 end ota_pvt_frm_thread_users_swi;