[Home] [Help]
PACKAGE BODY: APPS.UIUTIL
Source
1 package body uiutil
2 as
3
4 FUNCTION el_image(c_el_type IN varchar2)
5 return VARCHAR2
6 is
7 return_string varchar2(512);
8
9 begin
10 if c_el_type = 'APP' then
11 return_string := ' <img src="/images/app_sys.gif" alt="Application">';
12 elsif c_el_type = 'CLUSTER' then
13 return_string := ' <img src="/images/cluster.gif" alt="Cluster">';
14 elsif c_el_type = 'CONTEXT' then
15 return_string := ' <img src="/images/context_mapping.gif" alt="Context">';
16 elsif ((c_el_type = 'TBL') OR (c_el_type = 'TABLE')) then
17 return_string := ' <img src="/images/table_defn.gif" alt="Table">';
18 elsif ((c_el_type = 'VIEW') OR (c_el_type = 'VIEW ')) then
19 return_string := ' <img src="/images/view_defn.gif" alt="View">';
20 elsif c_el_type = 'NONE' then
21 return_string := '';
22 elsif c_el_type = 'DATABASE LINK' then
23 return_string := ' <img src="/images/db_link.gif" alt="Database Link">';
24 elsif c_el_type = 'SEQUENCE' then
25 return_string := ' <img src="/images/sequence.gif" alt="Sequence">';
26 elsif c_el_type = 'EXCEPTION' then
27 return_string := ' <img src="/images/exception.gif" alt="Exception">';
28 elsif c_el_type = 'SCHEMA' then
29 return_string := ' <img src="/images/schema.gif" alt="Schema">';
30 elsif c_el_type = 'FUNCTION' then
31 return_string := ' <img src="/images/function.gif" alt="Function">';
32 elsif c_el_type = 'PROCEDURE' then
33 return_string := ' <img src="/images/plsql_procedure.gif" alt="Procedure">';
34 elsif c_el_type = 'PACKAGE' then
35 return_string := ' <img src="/images/plsql_package.gif" alt="PL/SQL Package">';
36 elsif c_el_type = 'INDEX' then
37 return_string := ' <img src="/images/index.gif" alt="Index">';
38 elsif c_el_type = 'INDEX PARTITION' then
39 return_string := ' <img src="/images/index_partition.gif" alt="Index Partition">';
40 elsif c_el_type = 'INDEXTYPE' then
41 return_string := ' <img src="/images/index_storage.gif" alt="Index Type">';
42 elsif c_el_type = 'LOB' then
43 return_string := ' <img src="/images/lob.gif" alt="Lob">';
44 elsif c_el_type = 'FILE' then
45 return_string := ' <img src="/images/file.gif" alt="File">';
46 elsif c_el_type = 'QUEUE' then
47 return_string := ' <img src="/images/queue_p_implementation.gif" alt="Queue">';
48 elsif c_el_type = 'SYNONYM' then
49 return_string := ' <img src="/images/synonym.gif" alt="Synonym">';
50 elsif c_el_type = 'TABLE PARTITION' then
51 return_string := ' <img src="/images/table_partition.gif" alt="Table Partition">';
52 elsif c_el_type = 'TRIGGER' then
53 return_string := ' <img src="/images/trigger_module.gif" alt="Trigger">';
54 elsif c_el_type = 'PACKAGE BODY' then
55 return_string := ' <img src="/images/plsql.gif" alt="Package Body">';
56 elsif c_el_type = 'FK' then
57 return_string := ' <img src="/images/relationship_end.gif" alt="FK Joins to">';
58 elsif c_el_type = 'COL' then
59 return_string := ' <img src="/images/column.gif" alt="Column">';
60 elsif c_el_type = 'CONCURRENT' then
61 return_string := ' <img src="/images/general_module.gif" alt="Concurrent Program">';
62 elsif c_el_type = 'TS' then
63 return_string := ' <img src="/images/tablespace.gif" alt="Tablespace">';
64 elsif c_el_type = 'LOOKUP' then
65 return_string := ' <img src="/images/lov.gif" alt="Lookup">';
66 elsif c_el_type = 'ROOT' then
67 return_string := ' <img src="/images/repository.gif" alt="Root">';
68 elsif c_el_type = 'WORK' then
69 return_string := ' <img src="/images/workarea.gif" alt="Workarea">';
70 elsif c_el_type = 'EVENT' then
71 return_string := ' <img src="/images/event.gif" alt="Event">';
72 elsif c_el_type like 'TYPE%' then
73 return_string := ' <img src="/images/type_attribute.gif" alt="'||FND_CSS_PKG.Encode(c_el_type)||'">';
74 elsif c_el_type like 'JAVA%' then
75 return_string := ' <img src="/images/java_module.gif" alt="'||FND_CSS_PKG.Encode(c_el_type)||'">';
76 elsif c_el_type like 'MENU%' then
77 return_string := ' <img src="/images/menu.gif" alt="'||FND_CSS_PKG.Encode(c_el_type)||'">';
78 elsif c_el_type = 'MATERIALIZED VIEW' then
79 return_string := ' <img src="/images/snapshot.gif" alt="Materialized View">';
80 else
81 return_string := ' <img src="/images/datastruct_item.gif" alt="'||FND_CSS_PKG.Encode(c_el_type)||'">';
82 end if;
83 return return_string;
84 end el_image;
85
86 function db2url(c_text in varchar2) return varchar2 is
87
88 r_value varchar2(32767);
89 begin
90 r_value := c_text;
91 -- convert % first
92 r_value := replace(r_value, '%', '%25');
93
94 r_value := replace(r_value, ' ', '%20');
95 r_value := replace(r_value, '!', '%21');
96 r_value := replace(r_value, '''', '%22');
97 r_value := replace(r_value, '#', '%23');
98 r_value := replace(r_value, '$', '%24');
99 r_value := replace(r_value, '&', '%26');
100 r_value := replace(r_value, '(', '%28');
101 r_value := replace(r_value, ')', '%29');
102 r_value := replace(r_value, '*', '%2a');
103 r_value := replace(r_value, '+', '%2b');
104 r_value := replace(r_value, ',', '%2c');
105 r_value := replace(r_value, '-', '%2d');
106 r_value := replace(r_value, '.', '%2e');
107 r_value := replace(r_value, '/', '%2f');
108 r_value := replace(r_value, ':', '%3a');
109 r_value := replace(r_value, ';', '%3b');
110 r_value := replace(r_value, '<', '%3c');
111 r_value := replace(r_value, '=', '%3d');
112 r_value := replace(r_value, '>', '%3e');
113 r_value := replace(r_value, '?', '%3f');
114 r_value := replace(r_value, '@', '%40');
115 r_value := replace(r_value, '[', '%5b');
116 r_value := replace(r_value, '\', '%5c');
117 r_value := replace(r_value, ']', '%5d');
118 r_value := replace(r_value, '^', '%5e');
119 r_value := replace(r_value, '_', '%5f');
120 r_value := replace(r_value, '{', '%7b');
121 r_value := replace(r_value, '|', '%7c');
122 r_value := replace(r_value, '}', '%7d');
123 r_value := replace(r_value, '~', '%7e');
124 return r_value;
125
126 end db2url;
127
128 function url2db(c_text in varchar2) return varchar2 is
129
130 r_value varchar2(32767);
131 begin
132 r_value := c_text;
133
134 r_value := replace(r_value, '%20', ' ');
135 r_value := replace(r_value, '%21', '!');
136 r_value := replace(r_value, '%22', '''');
137 r_value := replace(r_value, '%23', '#');
138 r_value := replace(r_value, '%24', '$');
139 r_value := replace(r_value, '%26', '&');
140 r_value := replace(r_value, '%28', '(');
141 r_value := replace(r_value, '%29', ')');
142 r_value := replace(r_value, '%2a', '*');
143 r_value := replace(r_value, '%2b', '+');
144 r_value := replace(r_value, '%2c', ',');
145 r_value := replace(r_value, '%2d', '-');
146 r_value := replace(r_value, '%2e', '.');
147 r_value := replace(r_value, '%2f', '/');
148 r_value := replace(r_value, '%3a', ':');
149 r_value := replace(r_value, '%3b', ';');
150 r_value := replace(r_value, '%3c', '<');
151 r_value := replace(r_value, '%3d', '=');
152 r_value := replace(r_value, '%3e', '>');
153 r_value := replace(r_value, '%3f', '?');
154 r_value := replace(r_value, '%40', '@');
155 r_value := replace(r_value, '%5b', '[');
156 r_value := replace(r_value, '%5c', '\');
157 r_value := replace(r_value, '%5d', ']');
158 r_value := replace(r_value, '%5e', '^');
159 r_value := replace(r_value, '%5f', '_');
160 r_value := replace(r_value, '%7b', '{');
161 r_value := replace(r_value, '%7c', '|');
162 r_value := replace(r_value, '%7d', '}');
163 r_value := replace(r_value, '%7e', '~');
164
165 -- convert % last
166 r_value := replace(r_value, '%25', '%');
167 return r_value;
168
169 end url2db;
170
171 procedure txt_prn(c_string in varchar2)
172 -- formats as a paragraph
173 is
174 v_text varchar2(32000);
175 begin
176 v_text := c_string;
177
178 v_text := replace(v_text, chr(10), '<br>');
179 v_text := replace(v_text, chr(12), '<br>');
180 v_text := replace(v_text, chr(13), '<br>');
181 v_text := replace(v_text, '<br><br>', '<br>');
182 v_text := replace(v_text, '<br>', '<br>'||chr(10));
183 htp.p('<p> ');
184 htp.prn(v_text);
185 htp.p(' </p>');
186 end txt_prn;
187
188 procedure txt_prn1(c_string in varchar2)
189 -- does not format in a paragraph
190 is
191 v_text varchar2(32000);
192 begin
193 v_text := c_string;
194
195 v_text := replace(v_text, chr(10), '<br>');
196 v_text := replace(v_text, chr(12), '<br>');
197 v_text := replace(v_text, chr(13), '<br>');
198 v_text := replace(v_text, '<br><br>', '<br>');
199 v_text := replace(v_text, '<br>', '<br>'||chr(10));
200 htp.prn(v_text);
201 end txt_prn1;
202
203 procedure txt_p(c_string in varchar2)
204 is
205 v_text varchar2(32000);
206 begin
207 v_text := c_string;
208 v_text := replace(v_text, '<', '<');
209 v_text := replace(v_text, '>', '>');
210 -- v_text := replace(v_text, chr(10), '<br>');
211 -- v_text := replace(v_text, chr(12), '<br>');
212 -- v_text := replace(v_text, chr(13), '<br>');
213 -- v_text := replace(v_text, '<br><br>', '<br>');
214 -- v_text := replace(v_text, '<br>', '<br>'||chr(10));
215
216 htp.prn(v_text);
217
218 end txt_p;
219
220 procedure clob_prn(c_clob in clob)
221 is
222
223 buffer varchar2(32767);
224 amount binary_integer := 32767;
225 position integer := 1;
226 chunksize integer;
227 lob_bytes_remaining number(10);
228 v_clob clob;
229
230 begin
231
232 v_clob := c_clob;
233 lob_bytes_remaining := dbms_lob.getLength(v_clob);
234 chunksize := dbms_lob.getchunksize(v_clob);
235 if (chunksize < 32767) then
236 amount := (32767 / chunksize) * chunksize;
237 end if;
238
239 dbms_lob.open(v_clob, DBMS_LOB.LOB_READONLY);
240
241 while (lob_bytes_remaining > 0) loop
242 if (lob_bytes_remaining < amount) then
243 amount := lob_bytes_remaining;
244 end if;
245 dbms_lob.read(v_clob, amount, position, buffer);
246 htp.prn(buffer);
247 position := position + amount;
248 lob_bytes_remaining := lob_bytes_remaining - amount;
249 end loop;
250 dbms_lob.close(v_clob);
251
252 end clob_prn;
253
254 procedure cabo1(c_title in varchar2 := 'Oracle eTRM') is
255 begin
256 htp.p('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
257 htp.p('<html lang="en-US">');
258 htp.p('<head>');
259 htp.p('<title>'||FND_CSS_PKG.Encode(c_title)||'</title>');
260 htp.p('<style type="text/css">');
261 htp.p('<!-- hide from old browsers');
262 htp.p(' body { font: 10pt Arial; ');
263 htp.p(' background-color: #ffffff;}');
264 htp.p('');
265 htp.p(' div, p, li, dt, dd { font: 10pt Arial;}');
266 htp.p('');
267 htp.p(' img, td, tr { font: 10pt Arial;');
268 htp.p(' border-width: 0;');
269 htp.p(' vertical-align:top;}');
270 htp.p('');
271 htp.p(' ul.version {list-style-image: url("/images/workarea.gif") }');
272
273
274 htp.p('');
275 htp.p('th {text-align: left;');
276 htp.p(' vertical-align:top;}');
277 htp.p('');
278 htp.p(' td.bottom { font: 10pt Arial;');
279 htp.p(' border-width: 0;');
280 htp.p(' text-align: right;');
281 htp.p(' vertical-align:bottom;}');
282 htp.p('');
283 htp.p(' td.x_repeat { font: 10pt Arial;');
284 htp.p(' border-width: 0;');
285 htp.p(' text-align: left;');
286 htp.p(' background-repeat: repeat-x;');
287 htp.p(' vertical-align:bottom;}');
288 htp.p('');
289 htp.p(' .rightAligned { font: 10pt Arial;');
290 htp.p(' border-width: 0;');
291 htp.p(' text-align: right;');
292 htp.p(' vertical-align:top;}');
293 htp.p('');
294 htp.p(' .100_table {text-align:left; ');
295 htp.p(' padding:0;');
296 htp.p(' border-width: 0;');
297 htp.p(' border-style: none;');
298 htp.p(' border: none;');
299 htp.p(' margin:none;');
300 htp.p(' white-space: none;');
301 htp.p(' width:100%;');
302 htp.p(' vertical-align:top;}');
303 htp.p('');
304 htp.p(' .actTab { background-color: #336699;');
305 htp.p(' color: #99ccff; ');
306 htp.p(' font-family:Arial, Helvetica, Geneva, sans-serif; ');
307 htp.p(' color:#99ccff; ');
308 htp.p(' font-size:11pt; ');
309 htp.p(' font-weight: bold; ');
310 htp.p(' vertical-align:bottom;}');
311 htp.p('');
315 htp.p(' font-size:10pt; ');
312 htp.p(' .inactTab { background-color: #cccc99;');
313 htp.p(' color: #336699;');
314 htp.p(' font-weight: bold;');
316 htp.p(' cursor: hand;');
317 htp.p(' vertical-align:bottom;}');
318 htp.p('');
319 htp.p(' .disabledTab { background-color: #cccc99;');
320 htp.p(' color: #99ccff; ');
321 htp.p(' font-family:Arial, Helvetica, Geneva, sans-serif; ');
322 htp.p(' color:#ffffcc; ');
323 htp.p(' font-size:10pt; ');
324 htp.p(' font-weight: normal; ');
325 htp.p(' vertical-align:bottom;}');
326 htp.p('');
327
328 htp.p(' a { color: #663300; }');
329 htp.p('');
330 htp.p(' a.actTab {color: #99ccff; ');
331 htp.p(' font-family:Arial, Helvetica, Geneva, sans-serif; ');
332 htp.p(' font-size:11pt; ');
333 htp.p(' text-decoration: none; ');
334 htp.p(' font-weight: bold; }');
335 htp.p('');
336 htp.p(' a.inactTab { font-family:Arial, Helvetica, Geneva, sans-serif; ');
337 htp.p(' color:#003366; ');
338 htp.p(' font-weight: normal; ');
339 htp.p(' text-decoration: none; ');
340 htp.p(' font-size:11pt; }');
341 htp.p('');
342 htp.p(' h1 {font-family:Arial, Helvetica, Geneva, sans-serif;');
343 htp.p(' color:#336699;');
344 htp.p(' font-size:16pt}');
345 htp.p('');
346 htp.p(' h2 {font-family:Arial, Helvetica, Geneva, sans-serif;');
347 htp.p(' color:#336699;');
348 htp.p(' font-size:15pt}');
349 htp.p('');
350 htp.p(' h3 {font-family:Arial, Helvetica, Geneva, sans-serif;');
351 htp.p(' font-weight:bold;');
352 htp.p(' color:#336699;');
353 htp.p(' font-size:14pt}');
354 htp.p('');
355 htp.p(' h4 {font-family:Arial, Helvetica, Geneva, sans-serif;');
356 htp.p(' color:#336699;');
357 htp.p(' font-size:12pt}');
358 htp.p('');
359 htp.p(' h5 {font-family:Arial, Helvetica, Geneva, sans-serif;');
360 htp.p(' font-weight:bold;');
361 htp.p(' color:#336699;');
362 htp.p(' font-size:11pt }');
363 htp.p('');
364 htp.p(' b {font-family:Arial, Helvetica, Geneva, sans-serif;');
365 htp.p(' font-weight:bold;');
366 htp.p(' color:#336699;');
367 htp.p(' font-size:10pt }');
368 htp.p('');
369 htp.p(' h5.errorText {font-family:Arial, Helvetica, Geneva, sans-serif;');
370 htp.p(' font-weight:bold;');
371 htp.p(' color:#ff0000;');
372 htp.p(' font-size:11pt }');
373 htp.p('');
374
375 htp.p(' b.errorText {font-family:Arial, Helvetica, Geneva, sans-serif;');
376 htp.p(' font-weight:bold;');
377 htp.p(' font-style:italic;');
378 htp.p(' color:#ff0000;');
379 htp.p(' font-size:10pt }');
380
381
382 htp.p(' .TableColumnHeader {background-color:#cccc99;');
383 htp.p(' font-family:arial, helvetica, geneva, sans-serif;');
384 htp.p(' font-weight:bold; ');
385 htp.p(' color:#336699;');
386 htp.p(' font-size:10pt; ');
387 htp.p(' text-align:left; ');
388 htp.p(' border:#336699;');
389 htp.p(' width:100;');
390 htp.p(' text-indent:1}');
391
392 htp.p(' .TableCellText {background-color:#f7f7e7;');
393 htp.p(' font-family:arial, helvetica, geneva, sans-serif;');
394 htp.p(' color:black;');
395 htp.p(' font-size:10pt;');
396 htp.p(' border:#336699;');
397 htp.p(' width:100;');
398 htp.p(' text-indent:1}');
399
400 htp.p('<!-- The following styles can be removed and referenced from a central style sheet if required -->');
401 -- e.g.
402 -- htp.p('<link rel="stylesheet" href="/includes/crmweb.css">');
403 htp.p('');
404 htp.p(' .OraLightHeader {font-family:Arial, Helvetica, Geneva, sans-serif; ');
405 htp.p(' font-size:16pt; ');
406 htp.p(' font-weight:normal; ');
407 htp.p(' color:#6699cc}');
408
409 htp.p('');
410 htp.p(' .OraPrivacy {font-family:Arial, Helvetica, Geneva, sans-serif; ');
411 htp.p(' font-size:8pt; ');
412 htp.p(' font-weight:normal; ');
413 htp.p(' text-align:right; ');
414 htp.p(' color:#663300}');
415 htp.p('');
416
417 htp.p('');
418 htp.p(' .OraLegal {font-family:Arial, Helvetica, Geneva, sans-serif; ');
419 htp.p(' font-size:8pt; ');
423 htp.p('');
420 htp.p(' font-weight:normal; ');
421 htp.p(' text-align:center; ');
422 htp.p(' color:#663300}');
424
425
426 htp.p(' .OraCopyright {font-family:Arial, Helvetica, Geneva, sans-serif; ');
427 htp.p(' font-size:8pt; ');
428 htp.p(' font-weight:normal; ');
429 htp.p(' text-align:left; ');
430 htp.p(' color:black}');
431 htp.p('');
432
433 htp.p(' .OraTableColumnHeader {background-color:#cccc99;');
434 htp.p(' font-family:arial, helvetica, geneva, sans-serif;');
435 htp.p(' font-weight:bold; ');
436 htp.p(' color:#336699;');
437 htp.p(' font-size:10pt; ');
438 htp.p(' text-align:left; ');
439 htp.p(' text-indent:1}');
440
441 htp.p(' .OraTableRowHeader {background-color:#cccc99;');
442 htp.p(' font-family:arial, helvetica, geneva, sans-serif;');
443 htp.p(' font-weight:bold;');
444 htp.p(' color:#336699;');
445 htp.p(' font-size:10pt;');
446 htp.p(' text-align:right;');
447 htp.p(' text-indent:1}');
448
449 htp.p(' .OraTableCellText {background-color:#f7f7e7;');
450 htp.p(' font-family:arial, helvetica, geneva, sans-serif;');
451 htp.p(' color:black;');
452 htp.p(' font-size:10pt;');
453 htp.p(' text-indent:1}');
454
455 htp.p(' .OraTableCellTextBand {background-color:white;');
456 htp.p(' font-family:arial, helvetica, geneva, sans-serif;');
457 htp.p(' color:black;');
458 htp.p(' font-size:10pt;');
459 htp.p(' text-indent:1}');
460
461 htp.p(' .OraTableCellNumber {background-color:#f7f7e7;');
462 htp.p(' font-family:arial, helvetica, geneva, sans-serif; ');
463 htp.p(' color:black; font-size:10pt; ');
464 htp.p(' text-align:right; ');
465 htp.p(' text-indent:1}');
466
467 htp.p(' .OraTableCellNumberBand {background-color:white; ');
468 htp.p(' font-family:arial, helvetica, geneva, sans-serif; ');
469 htp.p(' color:black; ');
470 htp.p(' font-size:10pt;');
471 htp.p(' text-align:right;');
472 htp.p(' text-indent:1}');
473
474 htp.p(' .OraTableCellSelect {background-color:#f7f7e7;');
475 htp.p(' font-family:arial, helvetica, geneva, sans-serif;');
476 htp.p(' color:black;');
477 htp.p(' font-size:10pt;');
478 htp.p(' text-align:center;');
479 htp.p(' text-indent:1}');
480
481 htp.p(' .OraTableCellSelectBand {background-color:white;');
482 htp.p(' font-family:arial, helvetica, geneva, sans-serif;');
483 htp.p(' color:black;');
484 htp.p(' font-size:10pt;');
485 htp.p(' text-align:center;');
486 htp.p(' text-indent:1}');
487
488 htp.p('-->');
489 htp.p('</style>');
490 htp.p('</head>');
491 htp.p('<script type="text/javascript" language="JavaScript">');
492 htp.p(' function etrm_window(the_url)');
493 htp.p(' {');
494 htp.p(' etrm_main_view = window.open(the_url, "etrm_main_view", "scrollbars,resizable,toolbar,status");');
495 htp.p(' }');
496 htp.p('</script>');
497
498 htp.p('<noscript>');
499 htp.p('<p>eTRM uses javascript that opens and focuses a separate window to display reports.');
500 htp.p('Your browser does not appear to support javascript. This should not prevent you from using');
501 htp.p('eTRM but it does mean the window focus feature will not work. Please check the contents of');
502 htp.p('other windows on your desktop if you click on a link that does not appear to do anything.</p>');
503 htp.p('</noscript>');
504 end cabo1;
505
506
507
508
509 procedure cabo2 is
510 begin
511
512
513 htp.p('<body bgcolor="ffffff" onload="javascript:window.focus();">');
514 htp.p('<img src="/images/oraclelogo.gif" alt="Oracle" border="0">');
515 htp.p(' ');
516 htp.p('<table border="0" class="100_table" cellpadding=0 cellspacing=0 summary="">');
517 htp.p('<!-- Outer table which contains everything except the Oracle logo.');
518 htp.p('This table has 2 columns and 2 rows. The left column includes the site image and menu');
519 htp.p('The right one contains the tabs, select area and main report -->');
520 htp.p(' ');
521 htp.p('<tr> <!-- Row1 image + tabs -->');
522 htp.p(' <td>');
523 htp.p(' <img src="/images/etrm_cabo.gif" alt="eTRM Technical Reference" border="0" >');
524 htp.p(' </td>');
525 htp.p(' <td class="bottom">');
526 htp.p(' <table border="0" class="bottom" cellpadding=0 cellspacing=0 summary="">');
527 htp.p(' <!-- This table contains the tabs in a single row -->');
531 procedure cabo2a is
528 htp.p(' <tr class="bottom">');
529 end cabo2;
530
532 begin
533 htp.p('<body bgcolor="ffffff" onload="javascript:window.focus();">');
534 htp.p('<table width="750" summary="">');
535 htp.p('<tr>');
536 htp.p('<td>');
537 htp.p('<img src="/images/oraclelogo.gif" alt="Oracle" border="0">');
538 htp.p('</td><td class="OraTableCellNumberBand">');
539 end cabo2a;
540
541 procedure cabo2b is
542 begin
543 htp.p('</td>');
544 htp.p('</tr>');
545 htp.p('</table>');
546 htp.p('<table border="0" class="100_table" cellpadding=0 cellspacing=0 summary="">');
547 htp.p('<!-- Outer table which contains everything except the Oracle logo.');
548 htp.p('This table has 2 columns and 2 rows. The left column includes the site image and menu');
549 htp.p('The right one contains the tabs, select area and main report -->');
550 htp.p(' ');
551 htp.p('<tr> <!-- Row1 image + tabs -->');
552 htp.p(' <td>');
553 htp.p(' <img src="/images/etrm_cabo.gif" alt="eTRM Technical Reference" border="0" >');
554 htp.p(' </td>');
555 htp.p(' <td class="bottom">');
556 htp.p(' <table border="0" class="bottom" cellpadding=0 cellspacing=0 summary="">');
557 htp.p(' <!-- This table contains the tabs in a single row -->');
558 htp.p(' <tr class="bottom">');
559 end cabo2b;
560
561 --------------------------------> Draw tabs
562 procedure cabo3 is
563 begin
564 htp.p(' </tr>');
565 htp.p(' </table> <!-- end of tabs -->');
566 htp.p(' </td>');
567 htp.p('</tr>');
568 htp.p(' ');
569 htp.p('<tr> <!-- Row 2 everything else-->');
570 htp.p(' <td> <!-- Left side of screen -->');
571 htp.p(' <table border="0" cellpadding="0" cellspacing="0" class="100_table" summary="">');
572 htp.p(' <tr> <!-- top left -->');
573 htp.p(' <td width=10 class="rightAligned" >');
574 htp.p(' <img src="/images/top_left.gif" alt="" width=10>');
575 htp.p(' </td>');
576 htp.p(' <td background="/images/top_mid.gif" width="100%" class="100_table" > ');
577 htp.p(' <img src="/images/top_left2.gif" alt="" width=29 height=44 >');
578 htp.p(' </td>');
579 htp.p(' <td width=27>');
580 htp.p(' <img src="/images/top_right1.gif" alt="">');
581 htp.p(' </td>');
582 htp.p(' </tr>');
583 -- body left
584 htp.p(' <tr> <!-- body left (menu) -->');
585 htp.p(' <td class="rightAligned" background="/images/left.leftside.gif" width=10 >');
586 htp.p(' </td>');
587 htp.p(' <td bgcolor="#cccc99" background="/images/menu_background.gif" valign="top" width="100%" class="100_table" > <!-- menu -->');
588
589 end cabo3;
590 ---------------------------- > Draw menu
591 procedure cabo4 is
592 begin
593
594 htp.p(' </td> <!-- end of menu -->');
595 htp.p(' <td background="/images/left_rightside.gif" width=27 >');
596 htp.p(' <img src="/images/left.searchoverlap1.gif" alt="" width=27 height=35 >');
597 htp.p(' </td>');
598 htp.p(' </tr>');
599 htp.p(' <tr> <!-- bottom of menu -->');
600 htp.p(' <td width=11 background="/images/left.leftside.gif" align=right class="rightAligned">');
601 htp.p(' <img src="/images/left.leftside.gif" alt="">');
602 htp.p(' </td>');
603 htp.p(' <td class="rightAligned" background="/images/left_bottom2.gif">');
604 htp.p(' <img src="/images/left_bottom2.gif" alt="">');
605 htp.p(' </td>');
606 htp.p(' <td width=27>');
607 htp.p(' <img src="/images/left_bottom_r.gif" alt="" width=27 height=20>');
608 htp.p(' </td>');
609 htp.p(' </tr>');
610 htp.p(' </table>');
611 htp.p(' </td> <!-- end of left side -->');
612 htp.p(' ');
613 htp.p(' <td> <!-- right side of screen-->');
614 -- top right blue line
615 htp.p(' <table border="0" cellpadding=0 cellspacing=0 class="100_table" summary="">');
616 htp.p(' <tr> <!-- top right (blue line)-->');
617 htp.p(' <td background="/images/top.rightback.gif" class="rightAligned" nowrap>');
618 htp.p(' <img src="/images/top.rightend.gif" alt="" class="rightAligned" width=13 height=40 >');
619 htp.p(' </td>');
620 htp.p(' </tr> ');
621 htp.p(' <tr> <!-- search/select area + main body -->');
622 -- body right
623 htp.p(' <td >');
624 htp.p(' <table border="0" cellpadding=0 cellspacing=0 summary="">');
625 htp.p(' <tr class="OraLightHeader">');
626 htp.p(' <td width="100%" background="/images/search.back.gif" class="x_repeat"> <!-- search area -->');
627 end cabo4;
628
629 --------------------------- > draw search
630 procedure cabo5 is
631 begin
632 htp.p(' </td> <!-- end of search area -->');
633 htp.p(' <td >');
634 htp.p(' <img src="/images/search.end.gif" alt="">');
635 htp.p(' </td>');
636 htp.p(' </tr>');
637 htp.p(' <tr>');
638 htp.p(' <td> <!-- form/page -->');
639 end cabo5;
640 --------------- > draw form/page;
641 procedure cabo6 is
642 begin
643 htp.p(' </td> <!-- end of form/page -->');
644 htp.p(' </tr>');
645 htp.p(' </table>');
646 uiutil.prn_copyright;
647 htp.p('</body>');
648 htp.p('</html>');
649 end cabo6;
650
651 procedure prn_copyright
652 is
653 begin
654
655 htp.p(' <table border="0" cellpadding=0 cellspacing=0 width=600 summary="">');
659 htp.p(' </td>');
656 htp.p(' <tr>');
657 htp.p(' <td>');
658 htp.p(' <hr size=1 noshade>');
660 htp.p(' <td>');
661 htp.p(' <hr size=1 noshade>');
662 htp.p(' </td>');
663 htp.p(' </tr>');
664 htp.p(' <tr>');
665 htp.p(' <td class="OraCopyright">');
666 htp.p(' ');
667 htp.p(' </td>');
668 htp.p(' <td class="OraLegal">');
669 htp.p(' </td> ');
670 htp.p(' <td class="OraPrivacy">');
671 htp.p(' <a href="uiutil.copyright_notice">');
672 htp.p(' </a>');
673 htp.p(' </td>');
674 htp.p(' </tr>');
675 htp.p(' </table>');
676 htp.p(' </td>');
677 htp.p(' </tr>');
678 htp.p(' </table>');
679 htp.p(' </td> <!-- end of right side -->');
680 htp.p('</tr>');
681 htp.p('</table>');
682 end prn_copyright;
683
684 procedure render_action(c_url IN varchar2
685 , c_title IN varchar2
686 , c_position IN varchar2 default 'MID'
687 , c_state IN varchar2 default 'ENABLED')
688 is
689
690 v_class varchar2(30);
691 v_img varchar2(60);
692
693 begin
694 if c_position = 'RIGHT'
695 then v_img := '/images/top.divider.gif';
696 else
697 v_img := '/images/top.seperators.gif';
698 end if;
699
700 if c_state = 'DISABLED'
701 then
702 htp.p(' <td class="OraNav2Disabled" nowrap> ');
703 htp.p(FND_CSS_PKG.Encode(c_title) ||' </td>');
704 htp.p(' <td><img src="'||v_img||'" alt="" border="0"></td>');
705 elsif
706 c_state = 'SELECTED'
707 then
708 htp.p(' <td class="OraNav2Selected" nowrap> ');
709 htp.p(FND_CSS_PKG.Encode(c_title) ||' </td>');
710 htp.p(' <td><img src="'||v_img||'" alt="" border="0"></td>');
711 else
712 htp.p(' <td class="OraNav2Enabled" nowrap> ');
713 htp.p('<a class="OraNav2Enabled" href="'||utl_url.escape(c_url)||'">'|| FND_CSS_PKG.Encode(c_title) ||'</a> </td>');
714 htp.p(' <td><img src="'||v_img||'" alt="" border="0"></td>');
715 end if;
716 end render_action;
717
718 procedure render_tab(c_url IN varchar2
719 , c_title IN varchar2
720 , c_position IN varchar2 default 'MID'
721 , c_state IN varchar2 default 'ENABLED'
722 , b_prior_selected boolean default FALSE)
723 is
724
725 v_class varchar2(30);
726 v_left_img varchar2(80);
727 v_right_img varchar2(80);
728
729 begin
730 if upper(c_position) = 'LEFT'
731 then
732 if upper(c_state) = 'SELECTED'
733 then
734 v_class := ' class="actTab" ';
735 v_left_img := '<td><img src="/images/tabs.on.leftend.gif" alt="" border="0"></td>';
736 v_right_img := ' ';
737 -- v_right_img := '<td><img src="/images/tabs.on.rightmid.gif" alt="" border="0"></td>';
738 else
739 v_class := ' class="inactTab" ';
740 v_left_img := '<td><img src="/images/tabs.off.leftend.gif" alt="" border="0"></td>';
741 v_right_img := ' ';
742 -- v_right_img := '<td><img src="/images/tabs.off.mid.gif" alt="" border="0"></td>';
743 end if;
744 elsif upper(c_position) = 'RIGHT'
745 then
746 if upper(c_state) = 'SELECTED'
747 then
748 v_class := ' class="actTab" ';
749 v_left_img := '<td><img src="/images/tabs.on.leftmid.gif" alt="" border="0"></td>';
750 v_right_img := '<td><img src="/images/tabs.on.rightend.gif" alt="" border="0"></td>';
751 else
752 v_class := ' class="inactTab" ';
753 if b_prior_selected
754 then
755 v_left_img := '<td><img src="/images/tabs.on.rightmid.gif" alt="" border="0"></td>';
756 else
757 v_left_img := '<td><img src="/images/tabs.off.mid.gif" alt="" border="0"></td>';
758 end if;
759 v_right_img := '<td><img src="/images/tabs.off.rightend.gif" alt="" border="0"></td>';
760 end if;
761 else if upper(c_state) = 'SELECTED'
762 then
763 v_class := ' class="actTab" ';
764 v_left_img := '<td><img src="/images/tabs.on.leftmid.gif" alt="" border="0"></td>';
765 v_right_img := ' ';
766 else
767 v_class := ' class="inactTab" ';
768 if b_prior_selected
769 then
770 v_left_img := '<td><img src="/images/tabs.on.rightmid.gif" alt="" border="0"></td>';
771 else
772 v_left_img := '<td><img src="/images/tabs.off.mid.gif" alt="" border="0"></td>';
773 end if;
774 v_right_img := '';
775 end if;
776 end if;
777
778 if upper(c_state) = 'DISABLED'
779 then
780 v_class := ' class="disabledTab" ';
781 end if;
782
783 htp.p(v_left_img);
784 htp.p('<td'||v_class||'nowrap>');
788 htp.p(' '||FND_CSS_PKG.Encode(c_title)||' ');
785 if (upper(c_state) = 'DISABLED'
786 or upper(c_state) = 'SELECTED')
787 then
789 else
790 htp.p(' <a'||v_class||'href="'||c_url||'">'||FND_CSS_PKG.Encode(c_title)||'</a> ');
791 end if;
792 htp.p('</td>');
793 htp.p(v_right_img);
794 end render_tab;
795
796 PROCEDURE a_href_gen(c_type in user_objects.object_type%type := 'NONE'
797 , c_link in varchar2
798 , c_display in varchar2)
799
800 is
801 v_link varchar2(2000);
802 begin
803 v_link := replace(c_link, ' ', '%20');
804 v_link := replace(v_link, '#', '%23');
805 if c_type = 'NONE'
806 then null;
807 else
808 htp.prn(uiutil.el_image(FND_CSS_PKG.Encode(c_type)));
809 end if;
810 htp.p('<A HREF="'
811 || v_link
812 ||'">'
813 || c_display
814 ||'</a>');
815 END a_href_gen;
816
817 PROCEDURE a_javascript_gen(c_type in user_objects.object_type%type := 'NONE'
818 , c_link in varchar2
819 , c_display in varchar2)
820
821 is
822 v_link varchar2(2000);
823 begin
824 v_link := replace(c_link, ' ', '%20');
825 v_link := replace(v_link, '#', '%23');
826 if c_type = 'NONE'
827 then null;
828 else
829 htp.prn(uiutil.el_image(FND_CSS_PKG.Encode(c_type)));
830 end if;
831
832 htp.p('<A HREF="'
833 || v_link
834 ||'"target="etrm_main_view"onClick="etrm_window('''
835 || v_link
836 ||''');">'
837 || FND_CSS_PKG.Encode(c_display)
838 ||'</a>');
839 END a_javascript_gen;
840
841
842 FUNCTION byte_format(n_bytes IN number)
843 return VARCHAR2
844 IS
845 return_string varchar2(64);
846 begin
847 if n_bytes < 1024 then
848 return_string := n_bytes || ' bytes';
849 elsif
850 n_bytes < 1048576 then
851 return_string := round((n_bytes/1024),3) || ' KBytes';
852 elsif
853 n_bytes < 1073741824 then
854 return_string := round((n_bytes/1048576),3) || ' MBytes';
855 else
856 return_string := round((n_bytes/1073741824),3) || ' Gigabytes';
857 end if;
858 return return_string;
859 end byte_format;
860
861
862 function d2k_header(s_text in varchar2
863 , m_text in varchar2) return char
864 is
865 begin
866 -- uiutil.cabo1;
867 uiutil.cabo2;
868 uiutil.cabo3;
869 -- htp.p(m_text);
870 uiutil.prn_url(c_url => m_text
871 , c_relative => 'Y');
872 uiutil.cabo4;
873 htp.p(FND_CSS_PKG.Encode(s_text));
874 uiutil.cabo5;
875 return(' ');
876 end d2k_header;
877
878 function d2k_footer return char
879 is
880 begin
881 uiutil.cabo6;
882 return(' ');
883 end d2k_footer;
884
885 procedure prn_url (c_url in varchar2
886 , c_relative in varchar2 := 'N') is
887
888 v_pieces utl_http.html_pieces;
889 v_url varchar2(512);
890
891 begin
892 if upper(c_relative) = 'N' then
893 v_url := c_url;
894 else
895 v_url := etrm_static.base_url || c_url;
896 end if;
897 v_pieces := utl_http.request_pieces(v_url);
898 for i in 1 .. v_pieces.count loop
899 htp.prn(utl_url.escape(v_pieces(i)));
900 end loop;
901 end prn_url;
902
903
904 procedure file_header(c_filename in varchar2
905 , c_type in varchar2 := 'application/octet-stream') is
906 begin
907 htp.p('Content-type: '||FND_CSS_PKG.Encode(c_type));
908 htp.p('Content-disposition: attachment; filename='||c_filename);
909 htp.p('Content-Transfer-Encoding: base64');
910 htp.p('');
911 end file_header;
912
913 procedure copyright_notice
914 is
915 begin
916
917 uiutil.cabo1(c_title => 'eTRM Copyright Notice');
918 htp.p('<body bgcolor="ffffff" onload="javascript:window.focus();">');
919 htp.p('<img src="/images/oraclelogo.gif" alt="Oracle" border="0">
920 <hr size="2" width="100%" noshade align="left">');
921
922 htp.p(etrm_static.legal_text);
923
924 htp.p('</body>');
925 htp.p('</html>');
926 end copyright_notice;
927
928
929 end uiutil;