DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_FORUM_SWI

Source


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