create or replace package body cdwp_ter is /***************************************************************************************** Purpose HTML Report of Business Terminology for ODWA Usage Remarks Revision history When Who Construct Revision What ------------------------------------------------------------------------------------------ $REVISION_HISTORY$ 02-feb-2001 SANDRA MULLER 3.3 fix for issue 169 12-sep-2000 Lucas Jellema 3.2 Tune queries, version resolve all 26-jul-2000 MARC VAHSEN 3.1 Add folder name (via cdwpbase.get_el_name) in htp.title - usage of cdwpbase.g_ividTab: main cursor builds based on ivid only, this list of ivids is built up in a PL/SQL table which is looped through afterwards to fetch the details - make use of generic short_list_ procedure - use odwarprt.show_anchor instead of local procedure show_anchor, init icon bar with odwarprt.init_short_cut_bar 24-jul-2000 MARC VAHSEN 3.0 Upgrade to 6i - cursor c_ter, context specified by irid/ivid - procedure short_list_ter spec updated - procedure short_list_ter spec updated - calls to odwactxt.update_context added - calls to cdwp.include_report_styles added - changed hard-coded gif filenames if possible - replace call to cdwp.link in call to cdwp.report_link - deleted calls to cdwpbase.reset_context to do - check for p_body_only usage in short_list_ter (after dependency analysis) 29-may-2000 Lucas Jellema list_TER_definitions 2.1 + write menu_bar (status bar) for one_file = 'Y' 29-may-2000 Lucas Jellema short_list_ter and list_terms 2.0 + all functional improvements, such as + write_not_found + write_about + use report_link for hyperjumps + app_summary + icon bar + set_context and set_app + set_base_url and local_link 12-may-2000 Sandra Muller short_list_ter, list ter 1.3 extra newline between heading and content, both in list and details 11-may-2000 Sandra Muller list_ter 1.2 Added multi line text display 09-may-2000 Sandra Muller 1.1 06-apr-2000 Lucas Jellema 1.0 Creation 3.0 - cursor c_ter, context specified by irid/ivid - procedure short_list_ter spec updated - procedure short_list_ter spec updated - calls to odwactxt.update_context added - calls to cdwp.include_report_styles added - changed hard-coded gif filenames if possible - replace call to cdwp.link in call to cdwp.report_link - deleted calls to cdwpbase.reset_context to do - check for p_body_only usage in short_list_ter (after dependency analysis) 3.1 - usage of cdwpbase.g_ividTab: main cursor builds based on ivid only, this list of ivids is built up in a PL/SQL table which is looped through afterwards to fetch the details - make use of generic short_list_ procedure - use odwarprt.show_anchor instead of local procedure show_anchor, init icon bar with odwarprt.init_short_cut_bar *****************************************************************************************/ -- -- private constants -- REVISION_LABEL constant varchar2(30) := '$x.y::3.3 $'; PACKAGE_NAME constant varchar2(30) := 'CDWP_TER'; g_ter_name varchar2(100); g_ter_id number(38); -- -- cursor c_ter ( b_ter_ivid in number ) is select ter.id ter_id , ter.irid ter_irid , ter.ivid ter_ivid , ter.name ter_name , ter.remark ter_remark , ter.glossary_grouping_character , appter.folder_reference appter_id , appter.ownership_flag appter_ownership_flag from ci_terms ter , sdd_folder_members appter where appter.member_object = ter.id and ter.ivid = b_ter_ivid ; r_ter c_ter%rowtype; procedure short_list_ter ( p_session_id in number ) is begin odwactxt.update_context ( p_session_id => p_session_id , p_package_name => PACKAGE_NAME , p_procedure_name=> 'short_list_ter' ); odwarprt.short_list_of_type_instances ( p_session_id => p_session_id , p_el_type_of => 'TER' , p_app_irid => odwactxt.get_folder_irid , p_view_name => 'CI_TERMS' , p_plural_name => 'Business Terminology' , p_order_by => 'NAME' , p_descriptor_column => 'NAME' ); end; -- short_list_table_definitions procedure icon_bar -- Purpose Show shortcuts to SAC's etc with their icons -- if they exist ( p_ter_id in number ) is begin -- icon_bar odwarprt.init_short_cut_bar; cdwp.tableOpen('BORDER="0"'); cdwp.tableRowOpen; if odwaxist.exists_detail ( p_pac_irid => p_ter_id , p_el_type_of => 'SYN' , p_ref_column => 'term_reference' ) then odwarprt.show_anchor ( p_anchor_name => 'SYN'||to_char(p_ter_id) , p_gif => cdwpbase.get_icon('SYN') , p_title => ROB_msg.getMsg(Rob_msg.DSP255_CDWP_SYN, '', '', '', '') ); end if; if cdwp.exists_mlt( p_id => g_ter_id) then odwarprt.show_anchor ( p_anchor_name => 'ter_mlt'||to_char(p_ter_id) , p_gif => 'mlt.gif' , p_title =>ROB_msg.getMsg(Rob_msg.DSP131_CDWP_MLT, '', '', '', '') ); end if; cdwp.tableRowClose; cdwp.tableClose; htp.nl; end icon_bar; procedure list_ter ( p_session_id in number , p_irid in number default null , p_ivid in number default null ) -- Purpose List details of one or more business terms is -- -- cursor to select synonyms of a specific term -- cursor c_syn ( b_ter_id number ) is select syn.name from ci_synonyms syn where syn.term_reference = b_ter_id order by syn.name; -- local variables l_first boolean; begin -- list_ter -- if an ivid is passed in, that suggests we are going outside the workarea -- so in updating the context, the workarea id should be reset odwactxt.update_context ( p_session_id => p_session_id , p_package_name => PACKAGE_NAME , p_procedure_name=> 'list_ter' , p_pac_irid => p_irid , p_pac_ivid => p_ivid , p_pac_type_id => 4994 ); htp.htmlOpen; -- -- title -- htp.headOpen; cdwp.include_report_styles; cdwp.write_about(package_name, revision_label); if odwactxt.get_one_file = 'Y' then htp.title ( cdwpbase.get_el_name ( p_el_id => odwactxt.get_folder_irid , p_el_type_of => 'APP' ) ||ROB_msg.getMsg(Rob_msg.DSP256_CDWP_BUSINESSTERM, '', '', '', '') ); else htp.title ( cdwpbase.get_el_name ( p_el_id => odwactxt.get_folder_irid , p_el_type_of => 'APP' ) ||ROB_msg.getMsg(Rob_msg.DSP256_CDWP_BUSINESSTERM, '', '', '', '') ||cdwpbase.get_el_name ( p_el_id => nvl( p_irid, cdwpbase.get_irid( p_ivid)) , p_el_type_of => 'TER' ) ); end if; htp.headClose; htp.bodyOpen; -- -- Heading at top of HTML text -- if odwactxt.get_one_file = 'Y' then -- 2.1 cdwp.menu_bar ( p_level => 2 , p_el_short_name=> 'TER' , p_el_id => null ); cdwp.heading(2); htp.bold('Business Terminology'); htp.nl; htp.nl; cdwp.tableOpen; cdwpbase.get_ivid_list ( p_app_id => odwactxt.get_folder_irid , p_ci_view_name => 'CI_TERMS' , p_order_by => 'NAME' , p_descriptor_column => 'NAME' ); for i in 1..cdwpbase.g_ividTab.count loop cdwp.tableRowOpen; cdwp.TableDataHeading(null); cdwp.TableDataValue ( cdwpbase.local_link ( p_bookmark => cdwpbase.g_nameTab(i) , p_text => '{gif}'||cdwpbase.g_nameTab(i) , p_el_id => cdwpbase.g_iridTab(i) , p_type_of => 'TER' ) ); cdwp.tableRowClose; end loop; -- i in 1..cdwpbase.g_ividTab.count cdwp.tableClose; htp.nl; htp.nl; else cdwpbase.get_ivid_list ( p_ivid => nvl( p_ivid, cdwpbase.get_ivid( p_irid)) ); end if; -- odwactxt.get_one_file = 'Y' -- -- detailed terminology definition(s) -- for i in 1..cdwpbase.g_ividTab.count loop open c_ter( b_ter_ivid => cdwpbase.g_ividTab(i)); fetch c_ter into r_ter; close c_ter; odwactxt.update_context ( p_pac_irid => r_ter.ter_irid , p_pac_ivid => r_ter.ter_ivid , p_new_request => false ); g_ter_name := r_ter.ter_name; g_ter_id := r_ter.ter_id; cdwp.bookmark(lower(r_ter.ter_name)); -- 2.0 cdwp.menu_bar ( p_level => 2 , p_el_short_name => 'TER' , p_el_id => r_ter.ter_id ); cdwp.heading(3); cdwp.p (cdwp.add_images('{'||cdwpbase.get_icon('TER')||'}') ||r_ter.ter_name , p_style => 'partitle' ); htp.nl; icon_bar ( p_ter_id => r_ter.ter_id ); htp.nl; cdwp.tableOpen('BORDER="0"'); odwavrsn.version_status; -- 2.0 cdwpbase.app_summary ( p_el_id => r_ter.ter_id ); cdwp.tableRowOpen; cdwp.print_property ( p_property_name => 'Comment' , p_property_value => r_ter.ter_remark ); cdwp.print_property ( p_property_name => ROB_msg.getMsg(Rob_msg.CAP028_CDWP_GGC, '', '', '', '') , p_property_value => r_ter.glossary_grouping_character ); cdwp.tableRowClose; cdwp.tableClose; htp.print(''); cdwp.tableRowClose; cdwp.tableOpen('BORDER="0"'); cdwp.tableRowOpen; -- Synonyms -- l_first := true; <> for r_syn in c_syn(g_ter_id) loop if l_first then cdwp.bookmark('SYN'||to_char(r_ter.ter_id)); -- BOOKMARK cdwp.tableOpen('BORDER="0"'); cdwp.tableRowOpen; cdwp.TableDataHeading(cdwp.add_images('{'||cdwpbase.get_icon('SYN')||'}') ||ROB_msg.getMsg(Rob_msg.DSP255_CDWP_SYN, '', '', '', '')); l_first := false; else cdwp.tableRowOpen; cdwp.TableDataHeading(null); end if; cdwp.TableDataValue(r_syn.name); cdwp.tableRowClose; end loop syn; if not l_first then cdwp.tableClose; htp.print(''); cdwp.tableRowClose; end if; -- Multiline text if cdwp.exists_mlt( p_id => g_ter_id) then htp.nl; htp.nl; cdwp.bookmark('TER_MLT'||to_char(r_ter.ter_id)); -- BOOKMARK hwsp.fontOpen('Book Antiqua'); htp.bold(cdwp.add_images('{mlt.gif}') ||ROB_msg.getMsg(Rob_msg.DSP259_CDWP_MLTF, g_ter_name, '', '', '')); hwsp.fontClose; htp.nl; htp.nl; cdwp.tableOpen('BORDER="0"'); cdwp.tableRowOpen; cdwp_txt.display_all_mlt (p_el_id => r_ter.ter_id ,p_max_lines => null ,p_el_type => 'TER' ); cdwp.tableRowClose; cdwp.tableClose; end if; -- exists mlt end loop; -- ter htp.bodyClose; htp.htmlClose; end list_ter; begin -- Initialization null; end cdwp_ter; /