1 package body pv_pg_notif_utility_pvt_w as
2 /* $Header: pvxwpnub.pls 115.8 2003/12/01 19:18:31 pukken 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 procedure rosetta_table_copy_in_p6(t out nocopy pv_pg_notif_utility_pvt.user_notify_rec_tbl_type, a0 JTF_NUMBER_TABLE
14 , a1 JTF_VARCHAR2_TABLE_400
15 , a2 JTF_NUMBER_TABLE
16 ) as
17 ddindx binary_integer; indx binary_integer;
18 begin
19 if a0 is not null and a0.count > 0 then
20 if a0.count > 0 then
21 indx := a0.first;
22 ddindx := 1;
23 while true loop
24 t(ddindx).user_id := a0(indx);
25 t(ddindx).user_name := a1(indx);
26 t(ddindx).user_resource_id := a2(indx);
27 ddindx := ddindx+1;
28 if a0.last =indx
29 then exit;
30 end if;
31 indx := a0.next(indx);
32 end loop;
33 end if;
34 end if;
35 end rosetta_table_copy_in_p6;
36 procedure rosetta_table_copy_out_p6(t pv_pg_notif_utility_pvt.user_notify_rec_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
37 , a1 out nocopy JTF_VARCHAR2_TABLE_400
38 , a2 out nocopy JTF_NUMBER_TABLE
39 ) as
40 ddindx binary_integer; indx binary_integer;
41 begin
42 if t is null or t.count = 0 then
43 a0 := JTF_NUMBER_TABLE();
44 a1 := JTF_VARCHAR2_TABLE_400();
45 a2 := JTF_NUMBER_TABLE();
46 else
47 a0 := JTF_NUMBER_TABLE();
48 a1 := JTF_VARCHAR2_TABLE_400();
49 a2 := JTF_NUMBER_TABLE();
50 if t.count > 0 then
51 a0.extend(t.count);
52 a1.extend(t.count);
53 a2.extend(t.count);
54 ddindx := t.first;
55 indx := 1;
56 while true loop
57 a0(indx) := t(ddindx).user_id;
58 a1(indx) := t(ddindx).user_name;
59 a2(indx) := t(ddindx).user_resource_id;
60 indx := indx+1;
61 if t.last =ddindx
62 then exit;
63 end if;
64 ddindx := t.next(ddindx);
65 end loop;
66 end if;
67 end if;
68 end rosetta_table_copy_out_p6;
69
70 procedure get_users_list(p_partner_id NUMBER
71 , p1_a0 out nocopy JTF_NUMBER_TABLE
72 , p1_a1 out nocopy JTF_VARCHAR2_TABLE_400
73 , p1_a2 out nocopy JTF_NUMBER_TABLE
74 , x_user_count out nocopy NUMBER
75 , x_return_status out nocopy VARCHAR2
76 )
77
78 as
79 ddx_user_notify_rec_tbl pv_pg_notif_utility_pvt.user_notify_rec_tbl_type;
80 ddindx binary_integer; indx binary_integer;
81 begin
82
83 -- copy data to the local IN or IN-OUT args, if any
84
85
86
87
88 -- here's the delegated call to the old PL/SQL routine
89 pv_pg_notif_utility_pvt.get_users_list(p_partner_id,
90 ddx_user_notify_rec_tbl,
91 x_user_count,
92 x_return_status);
93
94 -- copy data back from the local variables to OUT or IN-OUT args, if any
95
96 pv_pg_notif_utility_pvt_w.rosetta_table_copy_out_p6(ddx_user_notify_rec_tbl, p1_a0
97 , p1_a1
98 , p1_a2
99 );
100
101
102 end;
103
104 procedure set_pgp_notif(p_notif_id NUMBER
105 , p_object_version NUMBER
106 , p_partner_id NUMBER
107 , p_user_id NUMBER
108 , p_arc_notif_for_entity_code VARCHAR2
109 , p_notif_for_entity_id NUMBER
110 , p_notif_type_code VARCHAR2
111 , x_return_status out nocopy VARCHAR2
112 , p8_a0 out nocopy NUMBER
113 , p8_a1 out nocopy NUMBER
114 , p8_a2 out nocopy NUMBER
115 , p8_a3 out nocopy NUMBER
116 , p8_a4 out nocopy NUMBER
117 , p8_a5 out nocopy NUMBER
118 , p8_a6 out nocopy VARCHAR2
119 , p8_a7 out nocopy VARCHAR2
120 , p8_a8 out nocopy NUMBER
121 , p8_a9 out nocopy DATE
122 , p8_a10 out nocopy NUMBER
123 , p8_a11 out nocopy DATE
124 , p8_a12 out nocopy NUMBER
125 )
126
127 as
128 ddx_pgp_notif_rec pv_ge_party_notif_pvt.pgp_notif_rec_type;
129 ddindx binary_integer; indx binary_integer;
130 begin
131
132 -- copy data to the local IN or IN-OUT args, if any
133
134
135
136
137
138
139
140
141
142 -- here's the delegated call to the old PL/SQL routine
143 pv_pg_notif_utility_pvt.set_pgp_notif(p_notif_id,
144 p_object_version,
145 p_partner_id,
146 p_user_id,
147 p_arc_notif_for_entity_code,
148 p_notif_for_entity_id,
149 p_notif_type_code,
150 x_return_status,
151 ddx_pgp_notif_rec);
152
153 -- copy data back from the local variables to OUT or IN-OUT args, if any
154
155
156
157
158
159
160
161
162 p8_a0 := ddx_pgp_notif_rec.party_notification_id;
163 p8_a1 := ddx_pgp_notif_rec.notification_id;
164 p8_a2 := ddx_pgp_notif_rec.object_version_number;
165 p8_a3 := ddx_pgp_notif_rec.partner_id;
166 p8_a4 := ddx_pgp_notif_rec.recipient_user_id;
167 p8_a5 := ddx_pgp_notif_rec.notif_for_entity_id;
168 p8_a6 := ddx_pgp_notif_rec.arc_notif_for_entity_code;
169 p8_a7 := ddx_pgp_notif_rec.notif_type_code;
170 p8_a8 := ddx_pgp_notif_rec.created_by;
171 p8_a9 := ddx_pgp_notif_rec.creation_date;
172 p8_a10 := ddx_pgp_notif_rec.last_updated_by;
173 p8_a11 := ddx_pgp_notif_rec.last_update_date;
174 p8_a12 := ddx_pgp_notif_rec.last_update_login;
175 end;
176
177 procedure send_mbrship_chng_notif(p_api_version NUMBER
178 , p_init_msg_list VARCHAR2
179 , p_commit VARCHAR2
180 , p_validation_level NUMBER
181 , x_return_status out nocopy VARCHAR2
182 , x_msg_count out nocopy NUMBER
183 , x_msg_data out nocopy VARCHAR2
184 , p7_a0 NUMBER
185 , p7_a1 NUMBER
186 , p7_a2 NUMBER
187 , p7_a3 VARCHAR2
188 , p7_a4 VARCHAR2
189 , p7_a5 VARCHAR2
190 )
191
192 as
193 ddp_mbrship_chng_rec pv_pg_notif_utility_pvt.mbrship_chng_rec_type;
194 ddindx binary_integer; indx binary_integer;
195 begin
196
197 -- copy data to the local IN or IN-OUT args, if any
198
199
200
201
202
203
204
205 ddp_mbrship_chng_rec.id := p7_a0;
206 ddp_mbrship_chng_rec.partner_id := p7_a1;
207 ddp_mbrship_chng_rec.resource_id := p7_a2;
208 ddp_mbrship_chng_rec.notif_type := p7_a3;
209 ddp_mbrship_chng_rec.message_subj := p7_a4;
210 ddp_mbrship_chng_rec.message_body := p7_a5;
211
212 -- here's the delegated call to the old PL/SQL routine
213 pv_pg_notif_utility_pvt.send_mbrship_chng_notif(p_api_version,
214 p_init_msg_list,
215 p_commit,
216 p_validation_level,
217 x_return_status,
218 x_msg_count,
219 x_msg_data,
220 ddp_mbrship_chng_rec);
221
222 -- copy data back from the local variables to OUT or IN-OUT args, if any
223
224
225
226
227
228
229
230 end;
231
232 procedure send_invitations(p_api_version_number NUMBER
233 , p_init_msg_list VARCHAR2
234 , p_commit VARCHAR2
235 , p_validation_level NUMBER
236 , p_partner_id NUMBER
237 , p_invite_header_id NUMBER
238 , p_from_program_id NUMBER
239 , p_notif_event_code VARCHAR2
240 , p_discount_value VARCHAR2
241 , p_discount_unit VARCHAR2
242 , p_currency VARCHAR2
243 , p_end_date date
244 , x_return_status out nocopy VARCHAR2
245 , x_msg_count out nocopy NUMBER
246 , x_msg_data out nocopy VARCHAR2
247 )
248
249 as
250 ddp_end_date date;
251 ddindx binary_integer; indx binary_integer;
252 begin
253
254 -- copy data to the local IN or IN-OUT args, if any
255
256
257
258
259
260
261
262
263
264
265
266 ddp_end_date := rosetta_g_miss_date_in_map(p_end_date);
267
268
269
270
271 -- here's the delegated call to the old PL/SQL routine
272 pv_pg_notif_utility_pvt.send_invitations(p_api_version_number,
273 p_init_msg_list,
274 p_commit,
275 p_validation_level,
276 p_partner_id,
277 p_invite_header_id,
278 p_from_program_id,
279 p_notif_event_code,
280 p_discount_value,
281 p_discount_unit,
282 p_currency,
283 ddp_end_date,
284 x_return_status,
285 x_msg_count,
286 x_msg_data);
287
288 -- copy data back from the local variables to OUT or IN-OUT args, if any
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303 end;
304
305 end pv_pg_notif_utility_pvt_w;