[Home] [Help]
PACKAGE BODY: APPS.AMV_PERSPECTIVE_PVT_W
Source
1 package body amv_perspective_pvt_w as
2 /* $Header: amvwpspb.pls 120.2 2005/06/30 08:30 appldev ship $ */
3 rosetta_g_mistake_date date := to_date('01/01/+4713', 'MM/DD/SYYYY');
4 rosetta_g_miss_date date := to_date('01/01/-4712', 'MM/DD/SYYYY');
5
6 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
7 function rosetta_g_miss_date_in_map(d date) return date as
8 begin
9 if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
10 return d;
11 end;
12
13 function rosetta_g_miss_num_map(n number) return number as
14 a number := fnd_api.g_miss_num;
15 b number := 0-1962.0724;
16 begin
17 if n=a then return b; end if;
18 if n=b then return a; end if;
19 return n;
20 end;
21
22 procedure rosetta_table_copy_in_p1(t out nocopy amv_perspective_pvt.amv_number_varray_type, a0 JTF_NUMBER_TABLE) as
23 ddindx binary_integer; indx binary_integer;
24 begin
25 if a0 is null then
26 t := null;
27 elsif a0.count = 0 then
28 t := amv_perspective_pvt.amv_number_varray_type();
29 else
30 if a0.count > 0 then
31 t := amv_perspective_pvt.amv_number_varray_type();
32 t.extend(a0.count);
33 indx := a0.first;
34 ddindx := 1;
35 while true loop
36 t(ddindx) := rosetta_g_miss_num_map(a0(indx));
37 ddindx := ddindx+1;
38 if a0.last =indx
39 then exit;
40 end if;
41 indx := a0.next(indx);
42 end loop;
43 end if;
44 end if;
45 end rosetta_table_copy_in_p1;
46 procedure rosetta_table_copy_out_p1(t amv_perspective_pvt.amv_number_varray_type, a0 out nocopy JTF_NUMBER_TABLE) as
47 ddindx binary_integer; indx binary_integer;
48 begin
49 if t is null then
50 a0 := null;
51 elsif t.count = 0 then
52 a0 := JTF_NUMBER_TABLE();
53 else
54 a0 := JTF_NUMBER_TABLE();
55 if t.count > 0 then
56 a0.extend(t.count);
57 ddindx := t.first;
58 indx := 1;
59 while true loop
60 a0(indx) := rosetta_g_miss_num_map(t(ddindx));
61 indx := indx+1;
62 if t.last =ddindx
63 then exit;
64 end if;
65 ddindx := t.next(ddindx);
66 end loop;
67 end if;
68 end if;
69 end rosetta_table_copy_out_p1;
70
71 procedure rosetta_table_copy_in_p5(t out nocopy amv_perspective_pvt.amv_perspective_obj_varray, a0 JTF_NUMBER_TABLE
72 , a1 JTF_NUMBER_TABLE
73 , a2 JTF_VARCHAR2_TABLE_100
74 , a3 JTF_VARCHAR2_TABLE_2000
75 , a4 JTF_VARCHAR2_TABLE_100
76 , a5 JTF_VARCHAR2_TABLE_100
77 , a6 JTF_DATE_TABLE
78 , a7 JTF_NUMBER_TABLE
79 , a8 JTF_DATE_TABLE
80 , a9 JTF_NUMBER_TABLE
81 , a10 JTF_NUMBER_TABLE
82 ) as
83 ddindx binary_integer; indx binary_integer;
84 begin
85 if a0 is not null and a0.count=0 then
86 t := amv_perspective_pvt.amv_perspective_obj_varray();
87 elsif a0 is not null and a0.count > 0 then
88 if a0.count > 0 then
89 t := amv_perspective_pvt.amv_perspective_obj_varray();
90 t.extend(a0.count);
91 indx := a0.first;
92 ddindx := 1;
93 while true loop
94 t(ddindx).perspective_id := rosetta_g_miss_num_map(a0(indx));
95 t(ddindx).object_version_number := rosetta_g_miss_num_map(a1(indx));
96 t(ddindx).perspective_name := a2(indx);
97 t(ddindx).description := a3(indx);
98 t(ddindx).language := a4(indx);
99 t(ddindx).source_lang := a5(indx);
100 t(ddindx).creation_date := rosetta_g_miss_date_in_map(a6(indx));
101 t(ddindx).created_by := rosetta_g_miss_num_map(a7(indx));
102 t(ddindx).last_update_date := rosetta_g_miss_date_in_map(a8(indx));
103 t(ddindx).last_updated_by := rosetta_g_miss_num_map(a9(indx));
104 t(ddindx).last_update_login := rosetta_g_miss_num_map(a10(indx));
105 ddindx := ddindx+1;
106 if a0.last =indx
107 then exit;
108 end if;
109 indx := a0.next(indx);
110 end loop;
111 end if;
112 end if;
113 end rosetta_table_copy_in_p5;
114 procedure rosetta_table_copy_out_p5(t amv_perspective_pvt.amv_perspective_obj_varray, a0 out nocopy JTF_NUMBER_TABLE
115 , a1 out nocopy JTF_NUMBER_TABLE
116 , a2 out nocopy JTF_VARCHAR2_TABLE_100
117 , a3 out nocopy JTF_VARCHAR2_TABLE_2000
118 , a4 out nocopy JTF_VARCHAR2_TABLE_100
119 , a5 out nocopy JTF_VARCHAR2_TABLE_100
120 , a6 out nocopy JTF_DATE_TABLE
121 , a7 out nocopy JTF_NUMBER_TABLE
122 , a8 out nocopy JTF_DATE_TABLE
123 , a9 out nocopy JTF_NUMBER_TABLE
124 , a10 out nocopy JTF_NUMBER_TABLE
125 ) as
126 ddindx binary_integer; indx binary_integer;
127 begin
128 if t is null then
129 a0 := null;
130 a1 := null;
131 a2 := null;
132 a3 := null;
133 a4 := null;
134 a5 := null;
135 a6 := null;
136 a7 := null;
137 a8 := null;
138 a9 := null;
139 a10 := null;
140 elsif t.count = 0 then
141 a0 := JTF_NUMBER_TABLE();
142 a1 := JTF_NUMBER_TABLE();
143 a2 := JTF_VARCHAR2_TABLE_100();
144 a3 := JTF_VARCHAR2_TABLE_2000();
145 a4 := JTF_VARCHAR2_TABLE_100();
146 a5 := JTF_VARCHAR2_TABLE_100();
147 a6 := JTF_DATE_TABLE();
148 a7 := JTF_NUMBER_TABLE();
149 a8 := JTF_DATE_TABLE();
150 a9 := JTF_NUMBER_TABLE();
151 a10 := JTF_NUMBER_TABLE();
152 else
153 a0 := JTF_NUMBER_TABLE();
154 a1 := JTF_NUMBER_TABLE();
155 a2 := JTF_VARCHAR2_TABLE_100();
156 a3 := JTF_VARCHAR2_TABLE_2000();
157 a4 := JTF_VARCHAR2_TABLE_100();
158 a5 := JTF_VARCHAR2_TABLE_100();
159 a6 := JTF_DATE_TABLE();
160 a7 := JTF_NUMBER_TABLE();
161 a8 := JTF_DATE_TABLE();
162 a9 := JTF_NUMBER_TABLE();
163 a10 := JTF_NUMBER_TABLE();
164 if t.count > 0 then
165 a0.extend(t.count);
166 a1.extend(t.count);
167 a2.extend(t.count);
168 a3.extend(t.count);
169 a4.extend(t.count);
170 a5.extend(t.count);
171 a6.extend(t.count);
172 a7.extend(t.count);
173 a8.extend(t.count);
174 a9.extend(t.count);
175 a10.extend(t.count);
176 ddindx := t.first;
177 indx := 1;
178 while true loop
179 a0(indx) := rosetta_g_miss_num_map(t(ddindx).perspective_id);
180 a1(indx) := rosetta_g_miss_num_map(t(ddindx).object_version_number);
181 a2(indx) := t(ddindx).perspective_name;
182 a3(indx) := t(ddindx).description;
183 a4(indx) := t(ddindx).language;
184 a5(indx) := t(ddindx).source_lang;
185 a6(indx) := t(ddindx).creation_date;
186 a7(indx) := rosetta_g_miss_num_map(t(ddindx).created_by);
187 a8(indx) := t(ddindx).last_update_date;
188 a9(indx) := rosetta_g_miss_num_map(t(ddindx).last_updated_by);
189 a10(indx) := rosetta_g_miss_num_map(t(ddindx).last_update_login);
190 indx := indx+1;
191 if t.last =ddindx
192 then exit;
193 end if;
194 ddindx := t.next(ddindx);
195 end loop;
196 end if;
197 end if;
198 end rosetta_table_copy_out_p5;
199
200 procedure get_perspective(p_api_version NUMBER
201 , p_init_msg_list VARCHAR2
202 , p_validation_level NUMBER
203 , x_return_status out nocopy VARCHAR2
204 , x_msg_count out nocopy NUMBER
205 , x_msg_data out nocopy VARCHAR2
206 , p_check_login_user VARCHAR2
207 , p_perspective_id NUMBER
208 , p_perspective_name VARCHAR2
209 , p9_a0 out nocopy NUMBER
210 , p9_a1 out nocopy NUMBER
211 , p9_a2 out nocopy VARCHAR2
212 , p9_a3 out nocopy VARCHAR2
213 , p9_a4 out nocopy VARCHAR2
214 , p9_a5 out nocopy VARCHAR2
215 , p9_a6 out nocopy DATE
216 , p9_a7 out nocopy NUMBER
217 , p9_a8 out nocopy DATE
218 , p9_a9 out nocopy NUMBER
219 , p9_a10 out nocopy NUMBER
220 )
221
222 as
223 ddx_perspective_obj amv_perspective_pvt.amv_perspective_obj_type;
224 ddindx binary_integer; indx binary_integer;
225 begin
226
227 -- copy data to the local IN or IN-OUT args, if any
228
229
230
231
232
233
234
235
236
237
238 -- here's the delegated call to the old PL/SQL routine
239 amv_perspective_pvt.get_perspective(p_api_version,
240 p_init_msg_list,
241 p_validation_level,
242 x_return_status,
243 x_msg_count,
244 x_msg_data,
245 p_check_login_user,
246 p_perspective_id,
247 p_perspective_name,
248 ddx_perspective_obj);
249
250 -- copy data back from the local variables to OUT or IN-OUT args, if any
251
252
253
254
255
256
257
258
259
260 p9_a0 := rosetta_g_miss_num_map(ddx_perspective_obj.perspective_id);
261 p9_a1 := rosetta_g_miss_num_map(ddx_perspective_obj.object_version_number);
262 p9_a2 := ddx_perspective_obj.perspective_name;
263 p9_a3 := ddx_perspective_obj.description;
264 p9_a4 := ddx_perspective_obj.language;
265 p9_a5 := ddx_perspective_obj.source_lang;
266 p9_a6 := ddx_perspective_obj.creation_date;
267 p9_a7 := rosetta_g_miss_num_map(ddx_perspective_obj.created_by);
268 p9_a8 := ddx_perspective_obj.last_update_date;
269 p9_a9 := rosetta_g_miss_num_map(ddx_perspective_obj.last_updated_by);
270 p9_a10 := rosetta_g_miss_num_map(ddx_perspective_obj.last_update_login);
271 end;
272
273 procedure find_perspective(p_api_version NUMBER
274 , p_init_msg_list VARCHAR2
275 , p_validation_level NUMBER
276 , x_return_status out nocopy VARCHAR2
277 , x_msg_count out nocopy NUMBER
278 , x_msg_data out nocopy VARCHAR2
279 , p_check_login_user VARCHAR2
280 , p_perspective_name VARCHAR2
281 , p_persp_description VARCHAR2
282 , p10_a0 out nocopy NUMBER
283 , p10_a1 out nocopy NUMBER
284 , p10_a2 out nocopy NUMBER
285 , p11_a0 out nocopy JTF_NUMBER_TABLE
286 , p11_a1 out nocopy JTF_NUMBER_TABLE
287 , p11_a2 out nocopy JTF_VARCHAR2_TABLE_100
288 , p11_a3 out nocopy JTF_VARCHAR2_TABLE_2000
289 , p11_a4 out nocopy JTF_VARCHAR2_TABLE_100
290 , p11_a5 out nocopy JTF_VARCHAR2_TABLE_100
291 , p11_a6 out nocopy JTF_DATE_TABLE
292 , p11_a7 out nocopy JTF_NUMBER_TABLE
293 , p11_a8 out nocopy JTF_DATE_TABLE
294 , p11_a9 out nocopy JTF_NUMBER_TABLE
295 , p11_a10 out nocopy JTF_NUMBER_TABLE
296 , p9_a0 NUMBER := 0-1962.0724
297 , p9_a1 NUMBER := 0-1962.0724
298 , p9_a2 VARCHAR2 := fnd_api.g_miss_char
299 )
300
301 as
302 ddp_subset_request_obj amv_perspective_pvt.amv_request_obj_type;
303 ddx_subset_return_obj amv_perspective_pvt.amv_return_obj_type;
304 ddx_perspective_obj_varray amv_perspective_pvt.amv_perspective_obj_varray;
305 ddindx binary_integer; indx binary_integer;
306 begin
307
308 -- copy data to the local IN or IN-OUT args, if any
309
310
311
312
313
314
315
316
317
318 ddp_subset_request_obj.records_requested := rosetta_g_miss_num_map(p9_a0);
319 ddp_subset_request_obj.start_record_position := rosetta_g_miss_num_map(p9_a1);
320 ddp_subset_request_obj.return_total_count_flag := p9_a2;
321
322
323
324 -- here's the delegated call to the old PL/SQL routine
325 amv_perspective_pvt.find_perspective(p_api_version,
326 p_init_msg_list,
327 p_validation_level,
328 x_return_status,
329 x_msg_count,
330 x_msg_data,
331 p_check_login_user,
332 p_perspective_name,
333 p_persp_description,
334 ddp_subset_request_obj,
335 ddx_subset_return_obj,
336 ddx_perspective_obj_varray);
337
338 -- copy data back from the local variables to OUT or IN-OUT args, if any
339
340
341
342
343
344
345
346
347
348
349 p10_a0 := rosetta_g_miss_num_map(ddx_subset_return_obj.returned_record_count);
350 p10_a1 := rosetta_g_miss_num_map(ddx_subset_return_obj.next_record_position);
351 p10_a2 := rosetta_g_miss_num_map(ddx_subset_return_obj.total_record_count);
352
353 amv_perspective_pvt_w.rosetta_table_copy_out_p5(ddx_perspective_obj_varray, p11_a0
354 , p11_a1
355 , p11_a2
356 , p11_a3
357 , p11_a4
358 , p11_a5
359 , p11_a6
360 , p11_a7
361 , p11_a8
362 , p11_a9
363 , p11_a10
364 );
365 end;
366
367 procedure add_itempersps(p_api_version NUMBER
368 , p_init_msg_list VARCHAR2
369 , p_commit VARCHAR2
370 , p_validation_level NUMBER
371 , x_return_status out nocopy VARCHAR2
372 , x_msg_count out nocopy NUMBER
373 , x_msg_data out nocopy VARCHAR2
374 , p_check_login_user VARCHAR2
375 , p_item_id NUMBER
376 , p_perspective_array JTF_NUMBER_TABLE
377 )
378
379 as
380 ddp_perspective_array amv_perspective_pvt.amv_number_varray_type;
381 ddindx binary_integer; indx binary_integer;
382 begin
383
384 -- copy data to the local IN or IN-OUT args, if any
385
386
387
388
389
390
391
392
393
394 amv_perspective_pvt_w.rosetta_table_copy_in_p1(ddp_perspective_array, p_perspective_array);
395
396 -- here's the delegated call to the old PL/SQL routine
397 amv_perspective_pvt.add_itempersps(p_api_version,
398 p_init_msg_list,
399 p_commit,
400 p_validation_level,
401 x_return_status,
402 x_msg_count,
403 x_msg_data,
404 p_check_login_user,
405 p_item_id,
406 ddp_perspective_array);
407
408 -- copy data back from the local variables to OUT or IN-OUT args, if any
409
410
411
412
413
414
415
416
417
418 end;
419
420 procedure delete_itempersps(p_api_version NUMBER
421 , p_init_msg_list VARCHAR2
422 , p_commit VARCHAR2
423 , p_validation_level NUMBER
424 , x_return_status out nocopy VARCHAR2
425 , x_msg_count out nocopy NUMBER
426 , x_msg_data out nocopy VARCHAR2
427 , p_check_login_user VARCHAR2
428 , p_item_id NUMBER
429 , p_perspective_array JTF_NUMBER_TABLE
430 )
431
432 as
433 ddp_perspective_array amv_perspective_pvt.amv_number_varray_type;
434 ddindx binary_integer; indx binary_integer;
435 begin
436
437 -- copy data to the local IN or IN-OUT args, if any
438
439
440
441
442
443
444
445
446
447 amv_perspective_pvt_w.rosetta_table_copy_in_p1(ddp_perspective_array, p_perspective_array);
448
449 -- here's the delegated call to the old PL/SQL routine
450 amv_perspective_pvt.delete_itempersps(p_api_version,
451 p_init_msg_list,
452 p_commit,
453 p_validation_level,
454 x_return_status,
455 x_msg_count,
456 x_msg_data,
457 p_check_login_user,
458 p_item_id,
459 ddp_perspective_array);
460
461 -- copy data back from the local variables to OUT or IN-OUT args, if any
462
463
464
465
466
467
468
469
470
471 end;
472
473 procedure update_itempersps(p_api_version NUMBER
474 , p_init_msg_list VARCHAR2
475 , p_commit VARCHAR2
476 , p_validation_level NUMBER
477 , x_return_status out nocopy VARCHAR2
478 , x_msg_count out nocopy NUMBER
479 , x_msg_data out nocopy VARCHAR2
480 , p_check_login_user VARCHAR2
481 , p_item_id NUMBER
482 , p_perspective_array JTF_NUMBER_TABLE
483 )
484
485 as
486 ddp_perspective_array amv_perspective_pvt.amv_number_varray_type;
487 ddindx binary_integer; indx binary_integer;
488 begin
489
490 -- copy data to the local IN or IN-OUT args, if any
491
492
493
494
495
496
497
498
499
500 amv_perspective_pvt_w.rosetta_table_copy_in_p1(ddp_perspective_array, p_perspective_array);
501
502 -- here's the delegated call to the old PL/SQL routine
503 amv_perspective_pvt.update_itempersps(p_api_version,
504 p_init_msg_list,
505 p_commit,
506 p_validation_level,
507 x_return_status,
508 x_msg_count,
509 x_msg_data,
510 p_check_login_user,
511 p_item_id,
512 ddp_perspective_array);
513
514 -- copy data back from the local variables to OUT or IN-OUT args, if any
515
516
517
518
519
520
521
522
523
524 end;
525
526 procedure get_itempersps(p_api_version NUMBER
527 , p_init_msg_list VARCHAR2
528 , p_validation_level NUMBER
529 , x_return_status out nocopy VARCHAR2
530 , x_msg_count out nocopy NUMBER
531 , x_msg_data out nocopy VARCHAR2
532 , p_check_login_user VARCHAR2
533 , p_item_id NUMBER
534 , p8_a0 out nocopy JTF_NUMBER_TABLE
535 , p8_a1 out nocopy JTF_NUMBER_TABLE
536 , p8_a2 out nocopy JTF_VARCHAR2_TABLE_100
537 , p8_a3 out nocopy JTF_VARCHAR2_TABLE_2000
538 , p8_a4 out nocopy JTF_VARCHAR2_TABLE_100
539 , p8_a5 out nocopy JTF_VARCHAR2_TABLE_100
540 , p8_a6 out nocopy JTF_DATE_TABLE
541 , p8_a7 out nocopy JTF_NUMBER_TABLE
542 , p8_a8 out nocopy JTF_DATE_TABLE
543 , p8_a9 out nocopy JTF_NUMBER_TABLE
544 , p8_a10 out nocopy JTF_NUMBER_TABLE
545 )
546
547 as
548 ddx_perspective_obj_varray amv_perspective_pvt.amv_perspective_obj_varray;
549 ddindx binary_integer; indx binary_integer;
550 begin
551
552 -- copy data to the local IN or IN-OUT args, if any
553
554
555
556
557
558
559
560
561
562 -- here's the delegated call to the old PL/SQL routine
563 amv_perspective_pvt.get_itempersps(p_api_version,
564 p_init_msg_list,
565 p_validation_level,
566 x_return_status,
567 x_msg_count,
568 x_msg_data,
569 p_check_login_user,
570 p_item_id,
571 ddx_perspective_obj_varray);
572
573 -- copy data back from the local variables to OUT or IN-OUT args, if any
574
575
576
577
578
579
580
581
582 amv_perspective_pvt_w.rosetta_table_copy_out_p5(ddx_perspective_obj_varray, p8_a0
583 , p8_a1
584 , p8_a2
585 , p8_a3
586 , p8_a4
587 , p8_a5
588 , p8_a6
589 , p8_a7
590 , p8_a8
591 , p8_a9
592 , p8_a10
593 );
594 end;
595
596 end amv_perspective_pvt_w;