DBA Data[Home] [Help]

PACKAGE BODY: APPS.ORACLEON

Source


1 package body OracleON as
2 /* $Header: ICXONXB.pls 120.0 2005/10/07 12:17:11 gjimenez noship $ */
3 
4 procedure IC(Z in varchar2) is
5 begin
6 	IC(Y => icx_call.encrypt2(icx_call.decrypt(Z)));
7 end;
8 
9 procedure IC(Y      in      varchar2,
10 	    a_1     in      varchar2,
11             a_2     in      varchar2,
12             a_3     in      varchar2,
13             a_4     in      varchar2,
14             a_5     in      varchar2,
15             c_1     in      varchar2,
16             c_2     in      varchar2,
17             c_3     in      varchar2,
18             c_4     in      varchar2,
19             c_5     in      varchar2,
20             i_1     in      varchar2,
21             i_2     in      varchar2,
22             i_3     in      varchar2,
23             i_4     in      varchar2,
24             i_5     in      varchar2,
25             o       in      varchar2,
26 	    m	    in      varchar2,
27             p_start_row in  varchar2,
28             p_end_row   in  varchar2,
29             p_where     in  varchar2,
30             p_hidden    in  varchar2) is
31 
32 l_attributes 	icx_on_utilities.v80_table;
33 l_conditions 	icx_on_utilities.v80_table;
34 l_inputs     	icx_on_utilities.v80_table;
35 
36 l_message	varchar2(2000);
37 l_err_mesg	varchar2(240);
38 l_err_num	number;
39 l_web_user_date_format varchar2(240);
40 
41 l_timer		number;
42 
43 begin
44 
45 -- select HSECS into l_timer from v$timer;htp.p('BEGIN = '||l_timer);htp.nl;-
46 
47 -- dbms_session.set_sql_trace(TRUE);
48 
49 if Y is null
50 then
51 	icx_on_utilities.unpack_parameters(icx_call.decrypt2(p_hidden),icx_on_utilities.g_on_parameters);
52 	icx_on_utilities.g_on_parameters(6) := p_start_row;
53 	icx_on_utilities.g_on_parameters(7) := p_end_row;
54 	icx_on_utilities.g_on_parameters(9) := p_where;
55 else
56 	icx_on_utilities.unpack_parameters(icx_call.decrypt2(Y),icx_on_utilities.g_on_parameters);
57 end if;
58 
59 for i in icx_on_utilities.g_on_parameters.count..22 loop
60         icx_on_utilities.g_on_parameters(i) := '';
61 end loop;
62 
63 if icx_on_utilities.g_on_parameters(22) is null
64 then
65     -- Set display HTML headers and footers
66     icx_on_utilities.g_on_parameters(22) := 'Y';
67 end if;
68 
69 /*
70 for i in 1..22 loop
71         htp.p(i||' = '||nvl(icx_on_utilities.g_on_parameters(i),'NULL'));htp.nl;
72 end loop;
73 */
74 
75 if icx_sec.validateSession
76 then
77 	l_attributes(1) := a_1;
78 	l_attributes(2) := a_2;
79 	l_attributes(3) := a_3;
80 	l_attributes(4) := a_4;
81 	l_attributes(5) := a_5;
82 	l_attributes(6) := '';
83         l_conditions(1) := c_1;
84         l_conditions(2) := c_2;
85         l_conditions(3) := c_3;
86         l_conditions(4) := c_4;
87         l_conditions(5) := c_5;
88         l_conditions(6) := '';
89 	l_inputs(1) := i_1;
90 	l_inputs(2) := i_2;
91 	l_inputs(3) := i_3;
92 	l_inputs(4) := i_4;
93 	l_inputs(5) := i_5;
94 	l_inputs(6) := '';
95 
96 	icx_on.get_page(l_attributes,l_conditions,l_inputs,m,o);
97 end if;
98 
99 -- dbms_session.set_sql_trace(FALSE);
100 
101 -- select HSECS into l_timer from v$timer;htp.p('END = '||l_timer);htp.nl;
102 
103 exception
104     when others then
105         l_err_num := SQLCODE;
106         l_message := SQLERRM;
107         select substr(l_message,12,512) into l_err_mesg from dual;
108 	if (abs(l_err_num) between 1800 and 1899)
109 	then
110 	    fnd_message.set_name('ICX','ICX_USE_DATE_FORMAT');
111 	    l_web_user_date_format := icx_sec.getID(icx_sec.pv_date_format);
112 	    fnd_message.set_token('FORMAT_MASK_TOKEN',nvl(l_web_user_date_format,'DD/MM/YYYY'));
113 	    l_message := l_err_mesg||'<br>'||fnd_message.get;
114             icx_util.add_error(l_message) ;
115             icx_admin_sig.error_screen(l_err_mesg);
116 	else
117 	    icx_util.add_error(l_err_mesg);
118 	    icx_admin_sig.error_screen(l_err_mesg);
119 	end if;
120 end;
121 
122 procedure Find(X in varchar2) is
123 
124 l_message varchar2(2000);
125 l_l_err_mesg varchar2(240);
126 l_l_err_num number;
127 
128 begin
129 
130 if icx_sec.validateSession
131 then
132 
133         icx_on_utilities.unpack_parameters(icx_call.decrypt2(X),icx_on_utilities.g_on_parameters);
134 
135         icx_on_utilities.FindPage(icx_on_utilities.g_on_parameters(13),icx_on_utilities.g_on_parameters(14),icx_on_utilities.g_on_parameters(15),icx_on_utilities.g_on_parameters(16),
136 	icx_on_utilities.g_on_parameters(1),icx_on_utilities.g_on_parameters(2),icx_on_utilities.g_on_parameters(3),icx_on_utilities.g_on_parameters(4),icx_on_utilities.g_on_parameters(5),
137 	icx_on_utilities.g_on_parameters(6),icx_on_utilities.g_on_parameters(7),icx_on_utilities.g_on_parameters(8),icx_on_utilities.g_on_parameters(9),icx_on_utilities.g_on_parameters(10));
138 
139 end if;
140 
141 exception
142     when others then
143         l_l_err_num := SQLCODE;
144         l_message := SQLERRM;
145         select substr(l_message,12,512) into l_l_err_mesg from dual;
146         icx_util.add_error(l_l_err_mesg);
147         icx_admin_sig.error_screen(l_l_err_mesg);
148 end;
149 
150 procedure FindForm(X in varchar2) is
151 
152 l_message varchar2(2000);
153 l_l_err_mesg varchar2(240);
154 l_l_err_num number;
155 
156 begin
157 
158 if icx_sec.validateSession
159 then
160 
161         icx_on_utilities.unpack_parameters(icx_call.decrypt2(X),icx_on_utilities
162 .g_on_parameters);
163 
164         icx_on_cabo.FindForm(
165           p_flow_appl_id => icx_on_utilities.g_on_parameters(1),
166           p_flow_code => icx_on_utilities.g_on_parameters(2),
167           p_page_appl_id => icx_on_utilities.g_on_parameters(3),
168           p_page_code => icx_on_utilities.g_on_parameters(4),
169           p_region_appl_id => icx_on_utilities.g_on_parameters(5),
170           p_region_code => icx_on_utilities.g_on_parameters(6),
171           p_lines_now => icx_on_utilities.g_on_parameters(7),
172           p_lines_next => icx_on_utilities.g_on_parameters(8),
173           p_hidden_name => icx_on_utilities.g_on_parameters(9),
174           p_hidden_value => icx_on_utilities.g_on_parameters(10),
175           p_help_url => icx_on_utilities.g_on_parameters(11));
176 
177 end if;
178 
179 exception
180     when others then
181         l_l_err_num := SQLCODE;
182         l_message := SQLERRM;
183         select substr(l_message,12,512) into l_l_err_mesg from dual;
184         icx_util.add_error(l_l_err_mesg);
185         icx_admin_sig.error_screen(l_l_err_mesg);
186 end;
187 
188 procedure DisplayWhere(X in varchar2) is
189 
190 l_message varchar2(2000);
191 l_l_err_mesg varchar2(240);
192 l_l_err_num number;
193 l_count number;
194 
195 begin
196 
197 if icx_sec.validateSession
198 then
199 
200     icx_on_utilities.unpack_parameters(icx_call.decrypt2(X),icx_on_utilities
201 .g_on_parameters);
202 
203     for i in icx_on_utilities.g_on_parameters.count..22 loop
204         icx_on_utilities.g_on_parameters(i) := '';
205     end loop;
206 
207 -- 2093780 nlbarlow, multiple region first page
208     select  count(*)
209     into    l_count
210     from    AK_FLOW_PAGE_REGIONS
211     where   PAGE_CODE = icx_on_utilities.g_on_parameters(5)
212     and     PAGE_APPLICATION_ID = icx_on_utilities.g_on_parameters(4)
213     and     FLOW_CODE = icx_on_utilities.g_on_parameters(3)
214     and     FLOW_APPLICATION_ID = icx_on_utilities.g_on_parameters(2);
215 
216     if l_count > 1
217     then
218       icx_on_utilities.g_on_parameters(1) := 'W';
219     else
220       icx_on_utilities.g_on_parameters(1) := 'DQ';
221     end if;
222 
223     icx_on_utilities.g_on_parameters(21) := 'W';
224 
225     icx_on_utilities.getRegions(icx_call.decrypt2(icx_on_utilities.g_on_parameters(9),icx_sec.g_session_id));
226 
227     icx_on_cabo.displayPage;
228 
229 end if;
230 
231 exception
232     when others then
233         l_l_err_num := SQLCODE;
234         l_message := SQLERRM;
235         select substr(l_message,12,512) into l_l_err_mesg from dual;
236         icx_util.add_error(l_l_err_mesg);
237         icx_admin_sig.error_screen(l_l_err_mesg);
238 end;
239 
240 
241 procedure IC(X in varchar2) is
242 c_name varchar2(30);
243 c_flow_appl_id number;
244 c_flow_code varchar2(30);
245 c_page_appl_id number;
246 c_page_code varchar2(30);
247 l_parameters icx_on_utilities.v240_table;
248 c_level         number;
249 c_displayed     display;
250 l_message varchar2(2000);
251 l_language_code varchar2(30);
252 
253 begin
254 
255 if icx_sec.validateSession
256 then
257 	icx_on_utilities.unpack_parameters(icx_call.decrypt2(X),l_parameters);
258 
259 	l_language_code := icx_sec.getID(icx_sec.pv_language_code);
260 
261 	c_flow_appl_id := l_parameters(1);
262 	c_flow_code := l_parameters(2);
263 	c_page_appl_id := l_parameters(3);
264 	c_page_code := l_parameters(4);
265 
266         htp.bodyOpen(icx_admin_sig.background(l_language_code));
267 
268 	fnd_message.set_name('ICX',l_parameters(5));
269 	l_message := fnd_message.get;
270 	htp.p(l_message);htp.nl;htp.nl;
271 
272 	c_level := 0;
273 	c_displayed(1) := '';
274 
275 	getPages(c_flow_appl_id,c_flow_code,c_page_appl_id,c_page_code,c_level,c_displayed);
276         htp.bodyClose;
277 end if;
278 
279 exception
280         when others then
281                 htp.p(SQLERRM);
282 end;
283 
284 procedure csv(S in varchar2) is
285 
286 l_message varchar2(2000);
287 l_err_mesg varchar2(240);
288 l_err_num number;
289 
290 begin
291 
292 if icx_sec.validateSession
293 then
294 	icx_on.create_file(S,',');
295 end if;
296 
297 exception
298     when others then
299         l_err_num := SQLCODE;
300         l_message := SQLERRM;
301 	l_err_mesg := substr(l_message,12,512);
302         icx_util.add_error(l_err_mesg);
303         icx_admin_sig.error_screen(l_err_mesg);
304 end;
305 
306 procedure getPages(c_flow_appl_id in number,
307                    c_flow_code in varchar2,
308                    c_page_appl_id in number,
309                    c_page_code in varchar2,
310                    c_level in number,
311                    c_displayed in out NOCOPY display) is
312 c_name varchar2(80);
313 c_description varchar2(240);
314 c_region_code   varchar2(30);
315 c_to_page_code  varchar2(30);
316 c_to_region_code varchar2(30);
317 
318 begin
319 
320 select  PRIMARY_REGION_CODE,NAME,DESCRIPTION
321 into    c_region_code,c_name,c_description
322 from    AK_FLOW_PAGES_VL
323 where   FLOW_CODE = c_flow_code
324 and	FLOW_APPLICATION_ID = c_flow_appl_id
325 and     PAGE_CODE = c_page_code
326 and	PAGE_APPLICATION_ID = c_page_appl_id;
327 
328 for i in 1..c_level loop
329 	htp.p(' -');
330 end loop;
331 
332 htp.p(c_name);htp.nl;
333 
334 getRegions(c_flow_appl_id,c_flow_code,c_page_appl_id,c_page_code,c_level,c_displayed);
335 
336 exception
337     when others then
338 	htp.p('');
339 
340 end;
341 
342 procedure getRegions(c_flow_appl_id in number,
343 		     c_flow_code in varchar2,
344 		     c_page_appl_id in number,
345                      c_page_code in varchar2,
346                      c_level in number,
347                      c_displayed in out NOCOPY display) is
348 l_region_appl_id number;
349 l_region_code varchar2(30);
350 c_do_it varchar2(1);
351 c_loop number;
352 c_name varchar2(30);
353 
354 cursor regions is
355         select  REGION_APPLICATION_ID,REGION_CODE
356         from    AK_FLOW_PAGE_REGIONS
357         where   PAGE_APPLICATION_ID = c_page_appl_id
358 	and	PAGE_CODE = c_page_code
359 	and	FLOW_APPLICATION_ID = c_flow_appl_id
360         and     FLOW_CODE = c_flow_code
361         order by DISPLAY_SEQUENCE;
362 
363 cursor items is
364         select  c.TO_PAGE_APPL_ID,c.TO_PAGE_CODE,a.ATTRIBUTE_CODE,a.ATTRIBUTE_LABEL_LONG
365         from    AK_REGION_ITEMS_VL a,
366                 AK_FLOW_PAGE_REGION_ITEMS c
367         where   a.REGION_CODE = l_region_code
368 	and	a.REGION_APPLICATION_ID = l_region_appl_id
369         and     c.FLOW_CODE = c_flow_code
370 	and	c.FLOW_APPLICATION_ID = c_flow_appl_id
371         and     c.PAGE_CODE = c_page_code
372 	and	c.PAGE_APPLICATION_ID = c_page_appl_id
373         and     c.REGION_CODE = a.REGION_CODE
374 	and	c.REGION_APPLICATION_ID = a.REGION_APPLICATION_ID
375         and     c.ATTRIBUTE_CODE = a.ATTRIBUTE_CODE
376 	and	c.TO_PAGE_CODE is not null
377         order by DISPLAY_SEQUENCE;
378 
379 begin
380 
381 if c_level < 20
382 then
383 
384 for r in regions loop
385 
386 l_region_appl_id := r.REGION_APPLICATION_ID;
387 l_region_code := r.REGION_CODE;
388 
389 c_do_it := 'Y';
390 c_loop := 1;
391 while c_displayed(c_loop) is not null loop
392         if c_displayed(c_loop) = c_flow_code||'.'||c_page_code||'.'||l_region_code
393         then
394                 c_do_it := 'N';
395         end if;
396         c_loop := c_loop + 1;
397 end loop;
398 
399 if c_do_it = 'Y'
400 then
401         c_displayed(c_loop) := c_flow_code||'.'||c_page_code||'.'||l_region_code;
402         c_displayed(c_loop+1) := '';
403 
404 for i in items loop
405         getPages(c_flow_appl_id,c_flow_code,i.TO_PAGE_APPL_ID,i.TO_PAGE_CODE,c_level+1,c_displayed);
406 end loop;
407 
408 end if;
409 
410 end loop;
411 
412 end if;
413 
414 exception
415     when others then
416         htp.p('');
417 end;
418 
419 end OracleON;