1 package body jtf_tplcategory_grp_w as
2 /* $Header: JTFGRTGB.pls 115.6 2004/07/09 18:51:06 applrt 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 function rosetta_g_miss_num_map(n number) return number as
7 a number := fnd_api.g_miss_num;
8 b number := 0-1962.0724;
9 begin
10 if n=a then return b; end if;
11 if n=b then return a; end if;
12 return n;
13 end;
14
15 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
16 function rosetta_g_miss_date_in_map(d date) return date as
17 begin
18 if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
19 return d;
20 end;
21
22 procedure rosetta_table_copy_in_p2(t out jtf_tplcategory_grp.category_id_tbl_type, a0 JTF_NUMBER_TABLE) as
23 ddindx binary_integer; indx binary_integer;
24 begin
25 if a0 is not null and a0.count > 0 then
26 if a0.count > 0 then
27 indx := a0.first;
28 ddindx := 1;
29 while true loop
30 t(ddindx) := a0(indx);
31 ddindx := ddindx+1;
32 if a0.last =indx
33 then exit;
34 end if;
35 indx := a0.next(indx);
36 end loop;
37 end if;
38 end if;
39 end rosetta_table_copy_in_p2;
40 procedure rosetta_table_copy_out_p2(t jtf_tplcategory_grp.category_id_tbl_type, a0 out JTF_NUMBER_TABLE) as
41 ddindx binary_integer; indx binary_integer;
42 begin
43 if t is null or t.count = 0 then
44 a0 := JTF_NUMBER_TABLE();
45 else
46 a0 := JTF_NUMBER_TABLE();
47 if t.count > 0 then
48 a0.extend(t.count);
49 ddindx := t.first;
50 indx := 1;
51 while true loop
52 a0(indx) := t(ddindx);
53 indx := indx+1;
54 if t.last =ddindx
55 then exit;
56 end if;
57 ddindx := t.next(ddindx);
58 end loop;
59 end if;
60 end if;
61 end rosetta_table_copy_out_p2;
62
63 procedure rosetta_table_copy_in_p3(t out jtf_tplcategory_grp.template_id_tbl_type, a0 JTF_NUMBER_TABLE) as
64 ddindx binary_integer; indx binary_integer;
65 begin
66 if a0 is not null and a0.count > 0 then
67 if a0.count > 0 then
68 indx := a0.first;
69 ddindx := 1;
70 while true loop
71 t(ddindx) := a0(indx);
72 ddindx := ddindx+1;
73 if a0.last =indx
74 then exit;
75 end if;
76 indx := a0.next(indx);
77 end loop;
78 end if;
79 end if;
80 end rosetta_table_copy_in_p3;
81 procedure rosetta_table_copy_out_p3(t jtf_tplcategory_grp.template_id_tbl_type, a0 out JTF_NUMBER_TABLE) as
82 ddindx binary_integer; indx binary_integer;
83 begin
84 if t is null or t.count = 0 then
85 a0 := JTF_NUMBER_TABLE();
86 else
87 a0 := JTF_NUMBER_TABLE();
88 if t.count > 0 then
89 a0.extend(t.count);
90 ddindx := t.first;
91 indx := 1;
92 while true loop
93 a0(indx) := t(ddindx);
94 indx := indx+1;
95 if t.last =ddindx
96 then exit;
97 end if;
98 ddindx := t.next(ddindx);
99 end loop;
100 end if;
101 end if;
102 end rosetta_table_copy_out_p3;
103
104 procedure rosetta_table_copy_in_p4(t out jtf_tplcategory_grp.tpl_ctg_id_tbl_type, a0 JTF_NUMBER_TABLE) as
105 ddindx binary_integer; indx binary_integer;
106 begin
107 if a0 is not null and a0.count > 0 then
108 if a0.count > 0 then
109 indx := a0.first;
110 ddindx := 1;
111 while true loop
112 t(ddindx) := a0(indx);
113 ddindx := ddindx+1;
114 if a0.last =indx
115 then exit;
116 end if;
117 indx := a0.next(indx);
118 end loop;
119 end if;
120 end if;
121 end rosetta_table_copy_in_p4;
122 procedure rosetta_table_copy_out_p4(t jtf_tplcategory_grp.tpl_ctg_id_tbl_type, a0 out JTF_NUMBER_TABLE) as
123 ddindx binary_integer; indx binary_integer;
124 begin
125 if t is null or t.count = 0 then
126 a0 := JTF_NUMBER_TABLE();
127 else
128 a0 := JTF_NUMBER_TABLE();
129 if t.count > 0 then
130 a0.extend(t.count);
131 ddindx := t.first;
132 indx := 1;
133 while true loop
134 a0(indx) := t(ddindx);
135 indx := indx+1;
136 if t.last =ddindx
137 then exit;
138 end if;
139 ddindx := t.next(ddindx);
140 end loop;
141 end if;
142 end if;
143 end rosetta_table_copy_out_p4;
144
145 procedure add_tpl_ctg(p_api_version NUMBER
146 , p_init_msg_list VARCHAR2
147 , p_commit VARCHAR2
148 , x_return_status out VARCHAR2
149 , x_msg_count out NUMBER
150 , x_msg_data out VARCHAR2
151 , p_template_id NUMBER
152 , p_category_id_tbl JTF_NUMBER_TABLE
153 )
154 as
155 ddp_category_id_tbl jtf_tplcategory_grp.category_id_tbl_type;
156 ddindx binary_integer; indx binary_integer;
157 begin
158
159 -- copy data to the local IN or IN-OUT args, if any
160
161
162
163
164
165
166
167 jtf_tplcategory_grp_w.rosetta_table_copy_in_p2(ddp_category_id_tbl, p_category_id_tbl);
168
169 -- here's the delegated call to the old PL/SQL routine
170 jtf_tplcategory_grp.add_tpl_ctg(p_api_version,
171 p_init_msg_list,
172 p_commit,
173 x_return_status,
174 x_msg_count,
175 x_msg_data,
176 p_template_id,
177 ddp_category_id_tbl);
178
179 -- copy data back from the local OUT or IN-OUT args, if any
180
181
182
183
184
185
186
187 end;
188
189 procedure delete_tpl_ctg_relation(p_api_version NUMBER
190 , p_init_msg_list VARCHAR2
191 , p_commit VARCHAR2
192 , x_return_status out VARCHAR2
193 , x_msg_count out NUMBER
194 , x_msg_data out VARCHAR2
195 , p_tpl_ctg_id_tbl JTF_NUMBER_TABLE
196 )
197 as
198 ddp_tpl_ctg_id_tbl jtf_tplcategory_grp.tpl_ctg_id_tbl_type;
199 ddindx binary_integer; indx binary_integer;
200 begin
201
202 -- copy data to the local IN or IN-OUT args, if any
203
204
205
206
207
208
209 jtf_tplcategory_grp_w.rosetta_table_copy_in_p4(ddp_tpl_ctg_id_tbl, p_tpl_ctg_id_tbl);
210
211 -- here's the delegated call to the old PL/SQL routine
212 jtf_tplcategory_grp.delete_tpl_ctg_relation(p_api_version,
213 p_init_msg_list,
214 p_commit,
215 x_return_status,
216 x_msg_count,
217 x_msg_data,
218 ddp_tpl_ctg_id_tbl);
219
220 -- copy data back from the local OUT or IN-OUT args, if any
221
222
223
224
225
226
227 end;
228
229 procedure add_ctg_tpl(p_api_version NUMBER
230 , p_init_msg_list VARCHAR2
231 , p_commit VARCHAR2
232 , x_return_status out VARCHAR2
233 , x_msg_count out NUMBER
234 , x_msg_data out VARCHAR2
235 , p_category_id NUMBER
236 , p_template_id_tbl JTF_NUMBER_TABLE
237 )
238 as
239 ddp_template_id_tbl jtf_tplcategory_grp.template_id_tbl_type;
240 ddindx binary_integer; indx binary_integer;
241 begin
242
243 -- copy data to the local IN or IN-OUT args, if any
244
245
246
247
248
249
250
251 jtf_tplcategory_grp_w.rosetta_table_copy_in_p3(ddp_template_id_tbl, p_template_id_tbl);
252
253 -- here's the delegated call to the old PL/SQL routine
254 jtf_tplcategory_grp.add_ctg_tpl(p_api_version,
255 p_init_msg_list,
256 p_commit,
257 x_return_status,
258 x_msg_count,
259 x_msg_data,
260 p_category_id,
261 ddp_template_id_tbl);
262
263 -- copy data back from the local OUT or IN-OUT args, if any
264
265
266
267
268
269
270
271 end;
272
273 end jtf_tplcategory_grp_w;