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