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; -- |<1st context item value> -- |<2nd context item value> -- '->| |<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(''); l_tableopen := TRUE; END IF; -- Open the table row htp.p(''); l_rows := l_rows + 1; -- output padding cells FOR p IN 1 .. (l_rows - 1) LOOP htp.p(''); END LOOP; -- Output the component title htp.p(''); -- 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(''); END IF; -- master context component -- close the row htp.p(''); END LOOP; -- thru comps at this level END LOOP; -- thru levels -- close the table IF l_tableopen THEN htp.p('
'); -- The last cell should have the image in it IF p = (l_rows - 1) THEN /*htp.p( '
' );*/ htp.p('
'); END IF; htp.p('

' || wsgl.gettext(wsgoc.get_title(l_comps(c))) || '

'); 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 ('' != 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('
'); 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; /