134 lines
3.8 KiB
Plaintext
134 lines
3.8 KiB
Plaintext
CREATE OR REPLACE PACKAGE BODY EFT_NOM.wsgmc_output2 IS
|
|
-- make sure we don't keep this around after a call
|
|
PRAGMA SERIALLY_REUSABLE;
|
|
|
|
-- This package formats the context items from the object cache as
|
|
-- an HTML table like;
|
|
-- <component tile>|<1st context item value>
|
|
-- |<2nd context item value>
|
|
-- '->|<component tile> |<1st context item value>
|
|
-- | '-> |<2nd context item value>
|
|
--
|
|
-- titles are output in H1 style.
|
|
|
|
PROCEDURE BEFORE(pref IN wsgoc.component_ref
|
|
,pdepth IN NUMBER) IS
|
|
l_comps wsgoc.component_ref_list;
|
|
l_items wsgoc.item_ref_list;
|
|
l_tableopen BOOLEAN := FALSE;
|
|
l_firstvalue BOOLEAN;
|
|
l_rows INTEGER := 0;
|
|
l_value VARCHAR2(1000);
|
|
BEGIN
|
|
-- Now we wish to output this as if in HTML;
|
|
-- First get the maximum depth
|
|
|
|
-- loop down through the components
|
|
FOR lev IN REVERSE 0 .. pdepth LOOP
|
|
|
|
-- get comps at this level
|
|
l_comps := wsgoc.get_components(pdepth => lev);
|
|
FOR c IN 1 .. l_comps.COUNT() LOOP
|
|
|
|
-- if the table is not open then open it now
|
|
IF (NOT l_tableopen) THEN
|
|
|
|
htp.p('<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 >');
|
|
l_tableopen := TRUE;
|
|
|
|
END IF;
|
|
|
|
-- Open the table row
|
|
htp.p('<TR VALIGN=BASELINE>');
|
|
l_rows := l_rows + 1;
|
|
|
|
-- output padding cells
|
|
FOR p IN 1 .. (l_rows - 1) LOOP
|
|
|
|
htp.p('<TD>');
|
|
|
|
-- The last cell should have the image in it
|
|
IF p = (l_rows - 1) THEN
|
|
|
|
/*htp.p( '<DIV ALIGN=right><IMG SRC="'
|
|
|| WSGOC.Get_SystemImagePath(l_comps(c))
|
|
|| 'cg_into.gif" HEIGHT=32 WIDTH=32></DIV>'
|
|
);*/
|
|
htp.p('<DIV ALIGN=right><IMG SRC="' || '/images/' ||
|
|
'cg_into.gif" HEIGHT=32 WIDTH=32></DIV>');
|
|
END IF;
|
|
|
|
htp.p('</TD>');
|
|
|
|
END LOOP;
|
|
|
|
-- Output the component title
|
|
htp.p('<TD><H1>' || wsgl.gettext(wsgoc.get_title(l_comps(c))) ||
|
|
'</H1></TD>');
|
|
|
|
-- if component is current one then don't show values
|
|
IF (NOT wsgoc.is_same(l_comps(c)
|
|
,pref)) THEN
|
|
|
|
-- Output the item values for context items
|
|
htp.p('<TD COLSPAN="10">');
|
|
l_firstvalue := TRUE;
|
|
l_items := wsgoc.get_items(l_comps(c));
|
|
FOR i IN 1 .. l_items.COUNT() LOOP
|
|
|
|
-- only look at context items
|
|
IF (wsgoc.get_iscontext(l_items(i))) THEN
|
|
|
|
l_value := wsgoc.get_value(l_items(i));
|
|
IF (l_value IS NOT NULL) THEN
|
|
|
|
-- finally surpress image call errors
|
|
IF ('<!-- ERROR' != substr(l_value
|
|
,1
|
|
,10) AND
|
|
'<!-- NULL image source -->' != l_value) THEN
|
|
|
|
IF (NOT l_firstvalue) THEN
|
|
htp.br;
|
|
ELSE
|
|
l_firstvalue := FALSE;
|
|
END IF;
|
|
|
|
htp.p(' ' || l_value);
|
|
END IF;
|
|
END IF;
|
|
END IF;
|
|
END LOOP;
|
|
|
|
-- close the cell
|
|
htp.p('</TD>');
|
|
|
|
END IF; -- master context component
|
|
|
|
-- close the row
|
|
htp.p('</TR>');
|
|
|
|
END LOOP; -- thru comps at this level
|
|
END LOOP; -- thru levels
|
|
|
|
-- close the table
|
|
IF l_tableopen THEN
|
|
htp.p('</TABLE>');
|
|
END IF;
|
|
|
|
-- if there is any before text then show it
|
|
htp.p(wsgoc.get_beforetext(pref));
|
|
htp.para;
|
|
|
|
END;
|
|
|
|
PROCEDURE AFTER(pref IN wsgoc.component_ref
|
|
,pdepth IN NUMBER) IS
|
|
BEGIN
|
|
htp.p(wsgoc.get_aftertext(pref));
|
|
END;
|
|
|
|
END;
|
|
/
|
|
|