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