create or replace package body cdwp is /***************************************************************************************** Purpose Main package, startup screens and main menus in ODWA Provides some basic services (headings, Links to functional report and Images) Usage Called directly from Browser as entry point for ODWA Remarks A number of services in this package should be moved to CDWPBASE Revision history When Who Construct Revision What ------------------------------------------------------------------------------------------ $revision_history$ 13-aug-2993 Kannan Parthasarathy -- B3041207: commented out code for static HTML file generation. 29-sep-2002 Kannan Parthasarathy - Fixed OAC p1 violations. 15-oct-2002 Kannan Parthasarathy - B2529438: Fixed, removed extra ampersand appeaing at the end of the anchor URL. 15-oct-2002 Kannan Parthasarathy - ROB Splash modified. - Added Management icon in navigator bar to the preferences page. 07-oct-2002 Kannan Parthasarathy - Modified start page to remove repeated icons. - Bug 2598061: Fix multiple ALT text generation for images. 26-sep-2002 Kannan Parthasarathy New splash image 29-jan-2002 Sandra Muller 6.17 fixed version number reference for previous change 29-jan-2002 Sandra Muller 6.16 fix for Oracle 9i: use same default values as in package spec 07-aug-2001 Lucas Jellema 6.15 - updated procedure release_banner, show release 6.5.0.16 - August 2001 30-mar-2001 Lucas Jellema 6.14 - update release label - procedure exec_sql: replace dbms_sql with execute immediate 14-mar-2001 Lucas Jellema 6.13 - function is_pac_accessible: if context is WA or CFG, verify folder version with membership of PAC is in the context. 14-mar-2001 Lucas Jellema 6.12 - update release banner to 6.5.0.15 12-mar-2001 Lucas Jellema 6.11 - update release banner to 6.5.0.14 09-mar-2001 Lucas Jellema 6.10 - add value for p_check_access in call to odwabrow.browser_link 09-mar-2001 Lucas Jellema 6.9 - update release label to 6.5.0.13 - fix issue 224 [odwa project/224%] Links displayed to objects in folders not accessible to the user - added public function is_pac_accessible 06-mar-2001 Lucas Jellema 6.8 - update release banner 02-mar-2001 Lucas Jellema 6.7 - update release banner to 6.5.0.11 02-mar-2001 Lucas Jellema 6.6 - update release banner 27-feb-2001 Lucas Jellema 6.5 - update release banner 27-feb-2001 Lucas Jellema 6.4 05-feb-2001 Lucas Jellema 6.3 - improved the interpretation of the {REP_FILE=repository object reference} tag in function cdwp.add_images (now the same syntax can be used as is used in the [object reference] notation - function report_link: correct the link for Type = Diagram, no specific diagram type requested. 02-feb-2001 Lucas Jellema 6.2 Solving issue 105 [odwa project/105%] - reports fail for objects in wastebasket 31-jan-2001 Lucas Jellema 6.1 - function report_link: add boolean parameter p_include_browser_gif; solve issue [odwa project/171%] 30-jan-2001 Lucas Jellema 6.0 Issue 30: bookmark in URL should come at the end (to not confuse IE) 29-jan-2001 Lucas Jellema 5.9 solve ORA-01403: no data found ORA-06512: at "DES6I.JR_NAME", line 3233 ORA-06512: at "ODWA.CDWP", line 2357 ORA-06512: at "ODWA.ODWA_FOL", line 964 ORA-06512: at "ODWA.ODWA_FOL", line 1070 ORA-06512: at line 7 DAD name: odwa6i_ias_nologon PROCEDURE : odwa_fol.inflate_Node USER : lucas URL : http://nlsu108:7777/pls/odwa6i_ias_nologon/odwa_fol.inflate_Node?p_node_index=1&p_node_level=2&p_num_of_nodes=54&p_node_value=635358077545416653517138369164516732&p_node_type={TYPE=WA}&p_entry_point=1&p_session_id=64198&p_root_value=635358077545416653517138369164516732&p_root_classification={TYPE=WA} PARAMETERS : =========== p_node_index: 1 p_node_level: 2 p_num_of_nodes: 54 p_node_value: 635358077545416653517138369164516732 p_node_type: {TYPE=WA} p_entry_point: 1 p_session_id: 64198 p_root_value: 635358077545416653517138369164516732 p_root_classification: {TYPE=WA} 25-jan-2001 Lucas Jellema 5.8 - release banner - report_link use proper name (Issue 18) - use ODWAPREF (image_path) instead of hard-coded c_images_vd = //odwa_images/' 25-jan-2001 Peter Ebell 1.31 -- Various changes to enable self service look and feel -- Expanded the CCS style sheets to cut back on HTML overhead 05-jan-2001 Lucas Jellema 5.6 Changes in report_styles 05-jan-2001 Lucas Jellema 5.5 Change: include_report_styles - take out font_family (for Peter) Include new menu option: Launchpad 02-jan-2001 Lucas Jellema 5.2 New: - public function is_in_wa Changed: - update release banner - include Missing from Workarea icon in REPORT_LINK - Home Icon should go to splash page - on line help system accessible as menu option on splash page 08-dec-2000 Lucas Jellema 5.1 - new splash image (odwa6i_splash.jpg) - new release_banner (6.5.0.4) 22-sep-2000 Lucas Jellema 4.9 Report_link: For Launchpad Link CFG use p_cfg_id - add_images: size of variables increased - add_images: size of variables increased 15-sep-2000 Lucas Jellema 4.8 Function sac_link Function report_link: - link to browser if no ODWA report available - pass on parameter p_target Procedure Startup: update start_menu (no database navigator, Repository Navigator instead of Reports 28-aug-2000 Lucas Jellema 4.7 Report_link: - more parameters : p_app_ivid, p_cf_id, p_wa_id; - type_link to call odwarprt.show_element_instances - launchpad_link for APP, CFG and WA, link to odwalpad instead of app_home Menu_Bar - No more compare_link in menu_bar - Always a VHV link in menu-bar (if a versionable context has been set) 10-aug-2000 Lucas Jellema 4.6 Add icon for VHV to icon bar Allow add_images to use odwagrph.show_graphic for references of type {GRAPHIC=} - added link to Database Navigator in Main Menu - support p_ivid in report_link and link 27-jul-2000 Lucas Jellema 4.5 print_property should use cdwp.tableRowOpen and tableRowClose release_banner prints 6.5.0.0 Alpha Under Construction 25-jul-2000 Lucas Jellema 4.4 Add parameter p_attributes to cdwp.tableDataHeading 24-jul-2000 Lucas Jellema 4.3 Locate bookmark in URL before parameters 24-jul-2000 Lucas Jellema 4.2 - call to odwa_fol.list_application_systems - release_banner included in Specification - all p_static and p_one_file are defaulted using odwactxt - tableOpen and tableClose to set/unset boolean - tableRowOpen and tableRowClose to make use of tableOpen boolean to write width or not - link and report_link deal with p_irid and p_ivid - report_link: recognize element_type APP_DETAILS 10-jul-2000 Lucas Jellema 4.1 Correct autoexpand details 03-jul-2000 Lucas Jellema Release_Banner 4.0 - release 6.5.0.0 03-jul-2000 Lucas Jellema Release_Banner 3.9 - release 6.0.9 function MLT_Link - lowercase bookmark! 03-jul-2000 Lucas Jellema Release_Banner 3.8 - release 6.0.8 function Link - static file for MDE should be called MDE, not GEM - replace in filename the # in element_name with a _ 30-jun-2000 Lucas Jellema Release_Banner 3.7 - release 6.0.7 30-jun-2000 Lucas Jellema Release_Banner 3.6 Use context pac_id and type in static MLT link 29-jun-2000 Lucas Jellema Release_Banner 3.5 - release 6.0.6 Link - prepare for links to static, multiple files 28-jun-2000 Lucas Jellema Release_Banner 3.4 - trials with exists_detail 28-jun-2000 Lucas Jellema Release_Banner 3.3 - Release_Banner: release 6.0.5 28-jun-2000 Lucas Jellema function exists_detail 3.2 - addressed ORA-1000 Max Open Cursors problem 27-jun-2000 Lucas Jellema app_home_link, compare_link 3.1 - removed some layout gargabe Release_Banner: release 6.0.4 20-jun-2000 Lucas Jellema add_images 3.0 - variable l_text too small 20-jun-2000 Lucas Jellema report_link, link 2.9 if type = GEM then act as if it were MDE 19-jun-2000 Lucas Jellema - 2.8 Release_Banner: release 6.0.3 report_link Cater for Reusable Module Component list_element_types Add Reusable Module Components 08-jun-2000 Lucas Jellema - 2.7 Release_Banner: release 6.0.2 08-jun-2000 Lucas Jellema - 2.6 Module_Link from launchpad is fixed Single File Bookmarks to elements with names with spaces did not work 05-jun-2000 Lucas Jellema - 2.5 removed some commented out 31-may-2000 Lucas Jellema procedure list_element_types 2.5 use smaller Launchpad 29-may-2000 Lucas Jellema procedure menu_link 2.4 write static toolbar in static reports function apphome_link; home_link cater for static files procedure bookmark replace Spaces with Underscores procedure list_application_systems default value for parameter p_user 29-may-2000 Lucas Jellema procedure menu_link; procedure write_status 2.3 write legend in static reports function link when p_one_file ='Y' and no bookmark has been supplied, supply one! 28-may-2000 Lucas Jellema procedure startup, procedure list_application_systems 2.2 new function release_banner, corrected text function link changed order of strings in .. if one_file <>'N' then 26-may-2000 Lucas Jellema procedure link 2.1 if parameter p_element_name is null, then pass * (for all elements) 25-may-2000 Lucas Jellema procedure report_link 2.0 improve link to application systems + recognize elements of type GEM/MDE 24-may-2000 Lucas Jellema procedure link 1.9 process references to Bookmarks within documents in a better way procedure report_link process p_bookmark in accordance to changes in procedure link 23-may-2000 Lucas Jellema procedure list_element_types 1.8 present menu of element types in list of CDM FastTrack and CDM Classic Deliverables function report_link new function that will return the proper link for application systems and element type reports package specification new function report_link included procedure TableDataHeading, TableDataValue compress layout information, especially when empty value is processed procedure startup add link to Facilities Management 22-may-2000 Lucas Jellema function LINK 1.7 allow additional parameters for use in URL pacakage spec specification LINK 22-may-2000 Lucas Jellema list_application_systems, find_app_id 1.6 join app query with SDW_ACCESS_RIGHTS for index usage 09-may-2000 Sandra Muller startup 1.5 mentioned beta with release number 08-may-2000 Sandra Muller write_about, startup, list_element_types, list_application_systems 1.4 Moved procedure write_about from odwa_wsf to this package + called it on startup, list_element_types and list_application_systems ruleframe_imagemap Corrected hyperlink to View Definition Report 03-may-2000 Lucas Jellema function add_images 1.3 Rely on odwa_stc to set image_directory correctly 03-may-2000 Lucas Jellema function compare_link 1.2 Correct link to compare report in toolbar 03-may-2000 Lucas Jellema function add_images 1.1 Support odwa_stc.image_directory function get_revision_label procedure startup Added image map on Splash image (to go to Administration menu) 01-mar-2000 Lucas Jellema package body 1.0 Creation from Cherry Pie.cdwp (1997 by Erwin Groenendal) 4.6 - include VHV button in menu bar with proper URL - added link to Database Navigator - support p_ivid in report_link and link 4.2 - call to odwa_fol.list_application_systems - release_banner included in Specification - all p_static and p_one_file are defaulted using odwactxt - tableOpen and tableClose to set/unset boolean - tableRowOpen and tableRowClose to make use of tableOpen boolean to write width or not - link and report_link deal with p_irid and p_ivid - report_link: recognize element_type APP_DETAILS 4.4 - function Link: in dynamic links, place bookmark right after procedure name, but before parameters *****************************************************************************************/ /* $add_to_revision_history $ */ -- -- private constants -- REVISION_LABEL constant varchar2(30) := '$x.y:: 6.17 $'; PACKAGE_NAME constant varchar2(30) := 'CDWP'; g_app_id number(38); g_app_name varchar2(40); g_app_version number(5); g_one_file varchar2(1); g_static boolean; g_first_row_in_table boolean:= false; g_tbl_open number(2):=0; g_images_vd varchar2(2000); -- -- public procedures and functions -- function C_IMAGES_VD return varchar2 is begin return g_images_vd; end; -- c_images_vd function get_revision_label return varchar2 is begin return REVISION_LABEL; end; -- get_revision_label function release_banner return varchar2 is begin return Rob_msg.getMsg(Rob_msg.MSG201_CDWP_COPYRIGHT, htf.nl, '', '', ''); end; procedure exec_sql ( p_command in varchar2 ) is v_cursor_name integer; v_return integer; begin -- 6.14 use Execute Immediate instead of DBMS_SQL execute immediate p_command; end; -- exec_sql function exists_detail ( p_supertype in varchar2 default 'E' -- values are E(lement) or A(ssociation) ,p_type_of in varchar2 ,p_ty in number default null ,p_el_within_id in number default null ,p_el_2nd_within_id in number default null ,p_str_part_of in number default null ,p_str_use_of in number default null ,p_str_method_of_use in varchar2 default null ,p_col1 in varchar2 default null ,p_col1_value in varchar2 default null ,p_col1_type in varchar2 default 'V' -- V(ARCHAR2), D(ate), N(umber) ,p_col2 in varchar2 default null ,p_col2_value in varchar2 default null ,p_col2_type in varchar2 default 'V' -- V(ARCHAR2), D(ate), N(umber) ) return boolean is l_test varchar2(1); l_command varchar2(4000); begin -- 3.2 rewritten to use explicit cursor c_detail_exists instead of select into -- to address ORA-1000 max_open_cursors problem l_command:= ' declare' ||' cursor c_detail_exists' ||' is ' ||' select ''x'' ' ||' from dual ' ||' where exists ' ||' ( select ''x'' ' ; if p_supertype = 'E' then l_command:= l_command ||' from sdd_elements ' ||' where el_type_of = '''||p_type_of||'''' ; if p_ty is not null then l_command:= l_command ||' and el_ty = '||to_char(p_ty) ; end if; if p_el_within_id is not null then l_command:= l_command ||' and el_within_id = '||to_char(p_el_within_id) ; end if; if p_el_2nd_within_id is not null then l_command:= l_command ||' and el_2nd_within_id = '||to_char(p_el_2nd_within_id) ; end if; else l_command:= l_command ||' from sdd_structure_elements ' ||' where str_type_of = '''||p_type_of||'''' ; if p_str_part_of is not null then l_command:= l_command ||' and str_part_of = '||to_char(p_str_part_of) ; end if; if p_str_use_of is not null then l_command:= l_command ||' and str_use_of = '||to_char(p_str_use_of) ; end if; if p_str_method_of_use is not null then l_command:= l_command ||' and str_method_of_use = '''||p_str_method_of_use||'''' ; end if; end if; if p_col1 is not null then if p_col1_type = 'V' then l_command:= l_command ||' and '||p_col1||' = '''||p_col1_value||'''' ; else l_command:= l_command ||' and '||p_col1||' = '||p_col1_value ; end if; end if; if p_col2 is not null then if p_col2_type = 'V' then l_command:= l_command ||' and '||p_col2||' = '''||p_col2_value||'''' ; else l_command:= l_command ||' and '||p_col2||' = '||p_col2_value ; end if; end if; l_command:= l_command ||' )' ||' ;' ||' r_detail_exists c_detail_exists%ROWTYPE;' ||' begin' ||' open c_detail_exists;' ||' fetch c_detail_exists into r_detail_exists;' ||' if c_detail_exists%found ' ||' then' ||' cdwpbase.g_dynamic_boolean_result:= true;' ||' else ' ||' cdwpbase.g_dynamic_boolean_result:= false;' ||' end if;' ||' close c_detail_exists;' ||' end;' ; exec_sql(l_command); return cdwpbase.g_dynamic_boolean_result; exception when no_data_found then return false; when others then return false; end; -- exists_detail -- function exists_mlt ( p_id in number , p_not_include1 in varchar2 default null , p_not_include2 in varchar2 default null , p_not_include3 in varchar2 default null , p_not_include4 in varchar2 default null , p_of_type in varchar2 default null ) return boolean is -- 3.4 replaced select..into with explicit cursor cursor c_mlt ( b_id in number , b_not_include1 in varchar2 default null , b_not_include2 in varchar2 default null , b_not_include3 in varchar2 default null , b_not_include4 in varchar2 default null , b_of_type in varchar2 default null ) is select 'x' from dual where exists ( select 'x' from cdi_text where txt_ref = p_id and txt_type <> nvl( p_not_include1, 'XXX') and txt_type <> nvl( p_not_include2, 'XXX') and txt_type <> nvl( p_not_include3, 'XXX') and txt_type <> nvl( p_not_include4, 'XXX') and txt_type = nvl( p_of_type, txt_type) ) ; r_mlt c_mlt%ROWTYPE; begin open c_mlt ( p_id, p_not_include1,p_not_include2,p_not_include3,p_not_include4,p_of_type ); fetch c_mlt into r_mlt ; if c_mlt%found then close c_mlt; return true; else close c_mlt; return false; end if; end; -- exists_mlt /* Change the font inside a table So you made a table but you would like to change the style of font used in your columns. Instead of inserting font tags inside each of the cells change your font with CSS.
This is some text
This is some text
*/ -- procedure heading ( p_level in number , p_static in boolean default odwactxt.get_static ) is begin htp.p(cdwp.add_images('{heading'||to_char(p_level)||'.gif}')); htp.nl; end; -- to be called from every element report, in the Heading section procedure include_report_styles is begin -- reptitle is the Heading2 used to start any report -- partitle is the Heading 3 used to start new paragraphs htp.p(''); htp.p (' '); end; -- include_report_styles procedure include_stnd_styles is begin htp.p(''); end; function p ( p_string in varchar2 , p_style in varchar2 default null ) return varchar2 is begin return ''||p_string||''; end; -- p procedure p ( p_string in varchar2 , p_style in varchar2 default null ) is begin htp.p( cdwp.p(p_string, p_style)); end; -- p procedure TableDataHeading ( p_heading in varchar2 , p_size in number default 2 , p_attributes in varchar2 default null ) is begin -- 1.8 if p_heading is null then cdwp.tableDataValue (' ' , p_width => cdwpbase.ifThenElse ( g_first_row_in_table or g_tbl_open = 0 , 160 ) , p_attributes => p_attributes ); else if g_first_row_in_table or g_tbl_open = 0 then htp.tableData ( p_heading ,'RIGHT' , cattributes=> p_attributes||' WIDTH="160" VALIGN="TOP" class="t2"' ); else htp.tableData ( p_heading ,'RIGHT' , cattributes=> p_attributes||' class="t2"' ); end if; -- cannot trust styles have been loaded end if; g_first_row_in_table:= false; end;-- TableDataHeading -- -- -- procedure TableDataValue ( p_value in varchar2 , p_size in number default 2 , p_width in number default null , p_colspan in number default 1 , P_ATTRIBUTES IN VARCHAR2 DEFAULT 'summary=""' ) is l_colspan varchar2(30); l_width varchar2(30); -- according to W3org: http://www.w3.org/TR/1999/REC-html401-19991224/struct/tables.html#h-11.3.2.1 -- are VALIGN and ALIGN ineherited from CELL, ROW/COL, TABLE level begin if p_colspan <> 1 then l_colspan:= 'COLSPAN="'||to_char(p_colspan)||'" '; end if; if p_width is not null then l_width:= 'WIDTH="'||to_char(p_width)||'" '; end if; -- 1.8 If no value, less layouting required if p_value is null then htp.tableData('', cattributes=> l_colspan||p_attributes); else if g_first_row_in_table or g_tbl_open = 0 then htp.tableData ( -- cdwpbase.ifThenElse -- ( p_size <> 2 -- , '' -- ) -- || p_value -- ||cdwpbase.ifThenElse -- ( p_size <> 2 -- , hwsf.fontClose -- ) , 'LEFT' , cattributes=>'VALIGN="TOP" '||l_colspan||' '||l_width||p_attributes ); else -- not the first row htp.tableData ( -- cdwpbase.ifThenElse -- ( p_size <> 2 -- , '' -- ) -- || p_value -- ||cdwpbase.ifThenElse -- ( p_size <> 2 -- , hwsf.fontClose -- ) , cattributes=> l_colspan -- valign and align are inherited from first row/table level ||cdwpbase.ifThenElse ( p_width is not null , l_width ) ||p_attributes ); end if; -- g_first_row_in_table ..... end if; -- p_value is null g_first_row_in_table:= false; end; -- tableDataValue procedure tableRowOpen ( p_parameters in varchar2 default '' ) is begin htp.tableRowOpen(cattributes => p_parameters); end; -- rowOpen procedure tableRowClose is begin htp.tableRowClose; g_first_row_in_table:= false; end; -- tableRowClose procedure tableOpen ( p_parameters in varchar2 default 'BORDER="0" SUMMARY=""' ) is begin htp.tableOpen(p_parameters); g_first_row_in_table:= true; g_tbl_open := g_tbl_open + 1; end; -- tableOpen procedure tableClose is begin htp.tableClose; g_tbl_open := g_tbl_open - 1; end; -- tableClose procedure bookmark ( p_target_code in varchar2 ) is begin htp.anchor(null, null, lower(replace(p_target_code,' ','_'))); -- 2.4 end; -- bookmark -- -- L I N K -- -- function to create a hypertext link (anchor) to a detailed element description -- three types of links are supported; -- 1. a link to a static file containing multiple element descriptions -- 2. a link to a static file containing a single element description -- 4. a link to a dynamic file containing a single element description -- function link ( p_app_name in varchar2 default null , p_app_version in number default null , p_one_file in varchar2 default odwactxt.get_one_file , p_static in boolean default odwactxt.get_static , p_element_type in varchar2 , p_procedure in varchar2 , p_element_name in varchar2 , p_text in varchar2 , p_parameters in varchar2 default null -- additional parameters used in URL; -- can also contain # at the end , p_app_irid in number default null , p_irid in number default null , p_ivid in number default null , p_target in varchar2 default '_TOP' -- 6.16 fix for Oracle 9i ) return varchar2 is l_parameters varchar2(2000):= p_parameters; l_bookmark varchar2(2000); -- 1.9 l_element_name varchar2(2000):= p_element_name; begin -- 1.9 if instr(p_element_name, '#') > 0 then l_bookmark := substr(p_element_name, instr(p_element_name, '#')+1); l_element_name:= substr(p_element_name, 1, instr(p_element_name, '#')-1); else -- 2.3 if p_one_file ='Y' then l_bookmark:= replace( p_element_name, ' ','_'); -- 2.6 end if; end if; if instr(p_parameters, '#') > 0 then l_parameters:= substr(p_parameters, 1, instr(p_parameters, '#')-1); l_bookmark := substr(p_parameters, instr(p_parameters, '#')+1); end if; l_bookmark:= lower(l_bookmark); if odwactxt.get_static then if odwactxt.get_one_file = 'Y' then -- one static file (multiple element descriptions) -- __.htm# -- NOW WHEN ELEMENT_NAME already contains a #number, which happens -- for example when it is a link to a Secondary Element in the PAC report, -- this ought to be recognised and dealt with; -- the #number could be decoded to return htf.anchor2 ( curl => lower(p_app_name ||'_' ||to_char(p_app_version) ||'_' ||cdwpbase.ifThenElse ( p_element_type = 'GEM' , 'MDE' ,p_element_type ) ||'.htm' ||cdwpbase.ifThenElse ( l_bookmark is not null , '#'||l_bookmark ) -- 1.9 ) ,ctext => p_text ,ctarget => p_target ); else -- seperate static files (single element description) -- ___.htm return htf.anchor2(lower(p_app_name|| '_'|| to_char(p_app_version)|| '_' ||cdwpbase.ifThenElse ( upper(p_element_type) = 'GEM' -- 3.8 if element_type is GEM, the name should be MDE , 'MDE' ,p_element_type ) ||'_' ||replace(replace(l_element_name, ' ', '_'), '#','_') -- 3.8 replace # in name since that confuses Browsers in thinking the bookmark starts there ||'.htm' ||cdwpbase.ifThenElse( l_bookmark is not null, '#'||l_bookmark) -- 1.9 ) , p_text ,ctarget => p_target ); end if; -- odwactxt.get_one_file = 'Y' else -- dynamic if l_parameters is not null then l_parameters:= chr(38)||l_parameters ; end if; -- separate dynamic file (single element description) -- ?p_app_name=p_app_version= -- p__name= if upper(p_element_type) ='APP' then return htf.anchor2 ( 'odwa_fol.app_home' ||'?p_session_id='||to_char(odwactxt.get_session_id) ||chr(38)||'p_app_id='||to_char(odwactxt.get_folder_irid) ||l_parameters , p_text , ctarget => p_target ); else return htf.anchor2 ( p_procedure ||'?p_session_id='||to_char(odwactxt.get_session_id) ||cdwpbase.ifThenElse ( p_ivid is not null , chr(38)||'p_ivid='||to_char(p_ivid) , cdwpbase.ifThenElse ( p_irid is not null , chr(38)||'p_irid='||to_char(p_irid) , cdwpbase.ifThenElse ( nvl( p_app_irid, odwactxt.get_folder_irid) <> odwactxt.get_folder_irid , chr(38)||'p_app_id='||to_char( p_app_irid) ) ) ) ||l_parameters ||cdwpbase.ifThenElse( l_bookmark is not null, '#'||l_bookmark) -- 6.0 bookmark after the parameters instead of straight after the procedure name (IE crashes otherwise) , p_text , ctarget => p_target ); end if; -- p_element_type ='APP' end if; -- odwactxt.get_static = true end; -- link function MLT_link ( p_app_name in varchar2 default cdwpbase.get_app_name , p_app_version in number default cdwpbase.get_app_version , p_one_file in varchar2 default odwactxt.get_one_file , p_static in boolean default odwactxt.get_static , p_el_id in number , p_txt_type in varchar2 , p_text in varchar2 , p_el_type in varchar2 , p_mlt_prompt in varchar2 , p_irid in number default null , p_ivid in number default null ) return varchar2 is begin if odwactxt.get_static then NULL; /* B3041207: Static HTML generation not supported -- __.htm# return htf.anchor(p_app_name|| '_'|| to_char(p_app_version)|| -- 3.8 '_'||p_el_type '_'||odwa_stc.get_context_pac_type ||'mlt.htm#' ||lower(replace(p_txt_type,' ','+'))||to_char(p_el_id) -- 3.9 lower , p_text ); */ else -- seperate dynamic file (single element description) -- ?p_app_name=p_app_version= -- p__name= return htf.anchor('cdwp_txt.display_full_mlt'|| '?p_session_id='||to_char(odwactxt.get_session_id) ||chr(38) ||'p_el_id='||to_char(p_el_id) ||chr(38) ||'p_ivid='||to_char(odwactxt.get_pac_ivid) ||chr(38) ||'p_txt_type='||replace(p_txt_type,' ','+') ||chr(38) ||'p_mlt_prompt_name='||replace(p_mlt_prompt,' ','+') , p_text ); end if; end; -- MLT_LINK -- -- -- function add_images ( p_text in varchar2 , p_static in boolean default odwactxt.get_static , p_attributes in varchar2 := null ) return varchar2 is /* 1.31 - allow literal curly brackets to be displayed: * {{ is displayed as {, }} is displayed as } * if {} does not contain REP_FILE-, GRAPHIC= or a period (for .gif,tiff,.jpeg, .jpg), it is displayed literally * the closing bracket is looked for from the current opening bracket; if between the current opening bracket and the first closing bracket after it there is another opening bracket, that one is used */ -- -- local variables -- l_position number(22) := 1; l_position_start number(22) := 0; l_position_start2 number(22) := 0; l_position_end number(22) := 0; l_text varchar2(10000); -- 3.0 from 1000 to 5000 l_graphic_ref varchar2(5000); l_ivid number(38); l_safety_catch number(3):=1; l_attributes varchar2(2000); cursor c_grph( b_ivid in number) is select code , category_id , grph_type , description , irid , ivid , filename , url from odwa_graphics where ivid = b_ivid ; r_grph c_grph%rowtype; -- this function will determine the proper values for l_position_start and l_position_end -- starting from the current values and taking into account the following rules: -- \{ is displayed as {, \} is displayed as }; therefore a { found, preceded by \ is not a good find -- if {} does not contain REP_FILE-, GRAPHIC= or a period (for .gif,tiff,.jpeg, .jpg), it is displayed literally; therefore: the function should skip these occurrences -- the closing bracket is looked for from the current opening bracket; if between the current opening bracket and the first closing bracket after it there is another opening bracket, that one is used -- the function returns true if a proper curly pair was found function find_positions ( p_position in number ) return boolean is -- function looks for occurrence of p_char, not preceded by \, starting from position p_pos function get_position ( p_char in varchar2 , p_pos in number , p_reverse in boolean default false ) return number is l_pos number(10); begin if p_reverse then l_pos := nvl( instr(p_text, p_char, -p_pos, 1),0); else l_pos := nvl( instr(p_text, p_char, p_pos, 1),0); end if; if l_pos > p_position then if substr( p_text, l_pos-1,1) = '^' then l_pos:= get_position( p_char, l_pos+cdwpbase.ifThenElse( p_reverse,-1,1), p_reverse); end if; end if; l_safety_catch := l_safety_catch +1; return l_pos; end; -- get_position begin l_position_start := get_position( '{', p_position); l_position_end := get_position( '}', l_position_start); if l_position_start = 0 or l_position_end = 0 then return false; end if; -- check if there is a { after l_position_start but still before l_position_end -- e.g. kjlhasd{dfshkfag {graph.gif} jifdfshfsyu /* currently infite loop it seems; sessions hang on this statement l_position_start2:= get_position('{',l_position_end, true); if l_position_start2 > l_position_start then l_position_start:= l_position_start2; end if; */ l_graphic_ref:= substr ( p_text , l_position_start + 1 , l_position_end - l_position_start - 1 ); l_safety_catch := l_safety_catch +1; if l_graphic_ref ='' or ( instr(l_graphic_ref, '.') = 0 and instr(l_graphic_ref, 'GRAPHIC=') = 0 and instr(l_graphic_ref, 'REP_FILE=') = 0 ) then -- this is not a proper graphic containing bracket pair; move on to the next one return find_positions( l_position_end+1); else return true; end if; end; -- find_positions function object_link ( p_anchor in varchar2 ) return number -- the ivid of the most likely repository object referenced by the p_anchor is l_found number(5); l_crn varchar2(4000); l_tags varchar2(4000); l_type_of varchar2(10); l_type_id number(38); l_vlabel varchar2(50); l_index number(38); l_irid number(38); l_ivid number(38); cursor c_ov( b_ivid in number) is select ov.vlabel , ov.logical_type_id from i$sdd_object_versions ov where ov.ivid = b_ivid ; r_ov c_ov%rowtype; begin if instr( p_anchor, ';') = 0 then l_crn:= p_anchor; else l_crn := substr( p_anchor, 1, instr( p_anchor, ';') -1); l_tags:= substr( p_anchor, instr( p_anchor, ';') +1); end if; -- cater for CFG= and WA= -- if l_crn does not contain a single slash, it is either a root folder -- or a single element IN THE SAME FOLDER/APPLICATION SYSTEM as the current -- context irid!!!! l_type_of:= cdwpbase.get_tag_value ( p_string => l_tags , p_tag => 'TYPE' , p_separator_open => '<' , p_separator_close => '>' ); l_type_id := cdwpbase.short_name_to_type_id( l_type_of); l_vlabel := cdwpbase.get_tag_value ( p_string => l_tags , p_tag => 'VLABEL' , p_separator_open => '<' , p_separator_close => '>' ); if l_crn like 'IVID=%' then return cdwp.report_link ( p_ivid => to_number( substr( l_crn, 6)) , p_text => '{name}' , p_include_browser_gif => false ); end if; -- l_crn like 'IVID=%' if l_crn like 'IRID=%' then return cdwp.report_link ( p_irid => to_number( substr( l_crn, 6)) , p_text => '{name}' , p_include_browser_gif => false ); end if; -- l_crn like 'IRID=%' -- we are dealing with a normal object; if no slash in the name, we assume -- that an object in the same folder as the current Folder/Application System -- is refered to. if instr( l_crn, '/') = 0 then -- add the path of the current object to the l_crn l_crn:= cdwpbase.get_path ( p_path => jr_name.get_path ( id => odwactxt.get_pac_ivid , format => 'NAME' ) ) ||'/' ||l_crn ; end if; -- instr( l_crn, '/') = 0 -- new approach using odwasrch odwasrch.runsearch ( qname => substr( l_crn, instr(l_crn,'/',-1) + 1) -- the last part of the CRN; but what about names containing /? Too bad! , qelementtype => l_type_id , qversionlabel => l_vlabel ); begin if odwasrch.g_ividtab.count = 0 then return ''||p_anchor||'' --||l_crn --||';Name='||substr( l_crn, instr(l_crn,'/',-1) + 1) --||';Type='||to_char(l_type_id) --||';vlabel ='||l_vlabel ; end if; -- l_found = 0 if odwasrch.g_ividtab(1) = -1 then return ''||p_anchor||'' ; end if; -- l_found = 0 for i in 1..odwasrch.g_ividtab.count loop if jr_name.get_path ( id => odwasrch.g_ividtab(i) , format => 'NAME' , seperator => '/' ) = l_crn then if l_vlabel is null then return cdwpbase.get_best_ivid(odwasrch.g_iridtab(i)); else return odwasrch.g_ividtab(i); end if; -- l_vlabel is null end if; -- jr_name.get_path_no_context( odwasrch.g_ividtab(i),'MAIN','NAME','/') = l_crn end loop; -- i in 1..odwasrch.g_ividtab.count return odwasrch.g_ividtab(1); exception when others then return null; end; end; -- object_link begin if p_text is null then return ''; end if; while find_positions( l_position) loop -- curly brackets with at least one character in between, e.g. {x} -- add to l_text the bit of string before the new start position l_text := l_text ||substr(p_text, l_position, l_position_start - l_position) ; if odwactxt.get_static then NULL; /* B3041207: Static HTML generation not supported. l_text := l_text|| htf.img ( odwa_stc.get_image_directory -- 1.3 , 1.1 ||l_graphic_ref , cattributes=>'BORDER="0" '||p_attributes ); */ else l_text := l_text ; if nvl( instr( l_graphic_ref, 'GRAPHIC='),0) >0 then l_text:= l_text ||odwagrph.show_graphic ( p_code => substr( l_graphic_ref, instr( l_graphic_ref, 'GRAPHIC=') + 8) , p_alt_text => '' , p_attributes => p_attributes , p_include_hotspots => true , p_allow_scaling => false ); elsif nvl( instr( l_graphic_ref, 'REP_FILE='),0) >0 then begin l_ivid:= object_link( p_anchor => substr( l_graphic_ref, instr( l_graphic_ref, 'REP_FILE=') + 9)); if l_ivid is null -- no repository object was found then l_text:= l_text||'(ivid not found for '||substr( l_graphic_ref, instr( l_graphic_ref, 'REP_FILE=') + 9)||')'; else -- now check whether there are any GRAPHICS defined for this Repository File; if so, -- show these graphics (effectively bringing in any hotspots as well!) open c_grph( b_ivid => l_ivid); fetch c_grph into r_grph; if c_grph%found then l_text:= l_text ||odwagrph.show_graphic ( p_code => r_grph.code , p_alt_text => r_grph.description , p_attributes => p_attributes , p_include_hotspots => true , p_allow_scaling => true , p_link_to_viewer => true ); else close c_grph; l_text:= l_text ||'' ; end if; -- c_grph%found end if; -- l_ivid is null exception when others then l_text:= l_text ||'Invalid file reference '||substr( l_graphic_ref, instr( l_graphic_ref, 'REP_FILE=') + 9) ||'' ; end; else l_attributes := p_attributes; -- Support for ALT text like {image.gif, ALT='ALT text"} if ( ((instr(l_graphic_ref, 'ALT=') > 0 OR instr(p_attributes,'alt=') > 0) AND instr(l_graphic_ref,',') > 0) )then l_graphic_ref := replace(l_graphic_ref,',','"'); l_graphic_ref := substr(l_graphic_ref,1,length(l_graphic_ref) -1); -- end if; -- Give a default ALT text if none is present else if( ( l_attributes is null OR l_attributes = '' ) ) then l_attributes := 'ALT="'||replace(replace(replace(l_graphic_ref,'.gif',''),'.jpg',''),'_','')||'" '; end if; end if; l_text:= l_text ||'' ; end if; -- nvl( instr( l_graphic_ref, 'GRAPHIC='),0) >0 end if; -- odwactxt.get_static l_position := l_position_end + 1; l_safety_catch := l_safety_catch +1; end loop; -- while (l_position_end - l_position_start) > 1 -- complete the the return string with what is left in the string buffer, starting at l_position l_text := l_text||substr(p_text, l_position); return replace(replace(l_text,'^{','{'),'^}','}'); end; -- add_images function home_link ( p_one_file in varchar2 default odwactxt.get_one_file ,p_static in boolean default odwactxt.get_static ) return varchar2 is l_img varchar2(200):= add_images( p_text => '{sshome.gif}' ,p_static => odwactxt.get_static ,p_attributes=> 'alt = " ' || ROB_msg.getMsg(Rob_msg.DSP101_CDWP_HOME, '', '', '', '')||'"' ); begin -- link to page with all application systems if odwactxt.get_static then -- 2.4 return htf.anchor2('odwa_app_index.htm' , l_img ,ctarget => '_top' ); else -- 5.2 Home should go to splash page return htf.anchor2 ( 'cdwp.startup?p_session_id=' ||to_char(odwactxt.get_session_id) , l_img , ctarget => '_top' ); end if; end; -- home_link function nav_link return varchar2 is l_img varchar2(200):= add_images( p_text => '{ssnav.gif}' ,p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP102_CDWP_RON, '', '', '', '') || '"' ); begin return htf.anchor2 ( 'odwa_fol.list_application_systems?p_session_id=' ||to_char(odwactxt.get_session_id) , l_img , ctarget => '_top' ); end; -- nav_link function browse_link return varchar2 is l_img varchar2(200):= add_images( p_text => '{ssbrowse.gif}' ,p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP103_CDWP_OB, '', '', '', '') || '"' ); begin return htf.anchor2 ( 'odwabrow.object_browser?p_session_id=' ||to_char(odwactxt.get_session_id) , l_img , ctarget => '_top' ); end; -- browse_link function help_link ( p_him_id in number ) return varchar2 is l_img varchar2(200):= add_images( p_text => '{sshelp.gif}' ,p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP104_CDWP_HELP, '', '', '', '') ||'"' ); begin return htf.anchor2 ( 'odwahelp.odwa_help?p_session_id=' || to_char(odwactxt.get_session_id) || chr(38) || 'p_him_id='||to_char(p_him_id) , l_img , ctarget => '_new' ); end; -- help_link function manage_link return varchar2 is l_img varchar2(200):= add_images( p_text => '{ssmanage.gif}' ,p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP105_CDWP_ODWA, '', '', '', '')||'"' ); begin return htf.anchor2 ( 'odwa_mgt.mgt_home' , l_img , ctarget => '_top' ); end; -- help_link function app_home_link ( p_level in number default 2 -- 2 means: start page for Application System, -- 1= List of Application Systems, 0= Cherry Pie start page -- 3 = list of elements of indicated type ,p_app_name in varchar2 default cdwpbase.get_app_name ,p_app_version in number default cdwpbase.get_app_version ,p_el_short_name in varchar2 default null -- required for p_level = 3 ,p_one_file in varchar2 default odwactxt.get_one_file ,p_static in boolean default odwactxt.get_static ) return varchar2 is l_img varchar2(200); begin if odwactxt.get_workarea_irid is not null then l_img:= add_images ( p_text => '{appsysgr.gif}' -- '{ruleframe_small.gif}' , p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP106_CDWP_WORKAREA, '', '', '', '') || '"' ||cdwpbase.get_wa_name ( p_wa_irid => odwactxt.get_workarea_irid) ||'"' ); return cdwp.report_link ( p_app_id => null , p_wa_id => odwactxt.get_workarea_irid , p_text => l_img , p_type_of => 'WA' ); elsif odwactxt.get_cfg_id is not null then l_img:= add_images ( p_text => '{appsysgr.gif}' -- '{ruleframe_small.gif}' , p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP107_CDWP_CONFIG, '', '', '', '') ||'"' ||jr_name.get_descriptor ( el_id => odwactxt.get_cfg_id , el_type => cdwpbase.short_name_to_type_id('CFG') , format => 'VLABEL' ) ||'"' ); return cdwp.report_link ( p_app_id => null , p_wa_id => null , p_cfg_id => odwactxt.get_cfg_id , p_text => l_img , p_type_of => 'CFG' ); else return ''; end if; -- p_app_name is not null end; -- app_home_link function compare_link ( p_app_name in varchar2 default cdwpbase.get_app_name ,p_app_version in number default cdwpbase.get_app_version ,p_el_short_name in varchar2 default null -- required for p_level = 3 ,p_one_file in varchar2 default odwactxt.get_one_file ,p_static in boolean default odwactxt.get_static ,p_el_id in number ) return varchar2 is begin if p_el_id is not null then return htf.anchor2 -- 1.2 ( 'cdwp_cmp.compare_context' ||'?p_left_el_id='||to_char(p_el_id) ||chr(38)||'p_left_app_id='||to_char(cdwpbase.find_app_id( p_app_name, p_app_version)) ||chr(38)||'p_el_type='||to_char(cdwpbase.get_el_type( p_el_id)) , ctext => add_images ( p_text => '{compare.gif}' , p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP108_CDWP_COMPELEMENT, '', '', '', '') ||'"' ) ,ctarget => '_top' ) ; else return htf.anchor2 ( curl => 'cdwp_cmp.compare_main' , ctext => add_images ( p_text => '{compare.gif}' , p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP109_CDWP_COMPRELEMENT, '', '', '', '') ||'"' ) , ctarget => '_top' ) ; end if; -- p_el_id is not null end; -- compare_link function vhv_link ( p_ivid in number default odwactxt.get_pac_ivid , p_irid in number default odwactxt.get_pac_irid , p_js_available in boolean default false ) return varchar2 is begin if not p_js_available then return htf.anchor2 -- 1.2 ( 'odwavrsn.vhv' ||'?p_ivid='||to_char(p_ivid) ||chr(38)||'p_irid='||to_char(p_irid) , ctext => add_images ( p_text => '{versiontreegr.gif}' , p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP110_CDWP_SHOWVERSION, '', '', '', '') || '"' ) ,ctarget => '_top' ); else return htf.anchor2 -- 1.2 ( 'javascript:invokeVhv(''' ||to_char(p_irid) ||''','''||to_char(p_ivid) ||''');' , ctext => add_images ( p_text => '{versiontreegr.gif}' , p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP110_CDWP_SHOWVERSION, '', '', '', '') || '"' ) ); end if; end; -- vhv_link function brw_link ( p_ivid in number default odwactxt.get_pac_ivid ) return varchar2 is begin return htf.anchor2 -- 1.2 ( 'javascript:browse(''' ||to_char(p_ivid) ||''');' , ctext => add_images ( p_text => '{object.gif}' , p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP111_CDWP_OBJBROWSER, '', '', '', '') || '"' ) ); end; -- brw_link -- function returns link top repository search facility function repsearch_link return varchar2 is begin return htf.anchor2 -- 1.2 ( 'odwasrch.rep_search' ||'?p_session_id='||to_char(odwactxt.get_session_id) , ctext => add_images ( p_text => '{sssearch.gif}' , p_attributes=>'alt="'|| ROB_msg.getMsg(Rob_msg.DSP112_CDWP_REPSEARCH, '', '', '', '') ||'"' ) ,ctarget => '_top' ); end; -- repsearch_link function reports_link return varchar2 is begin return htf.anchor2 -- 1.2 ( 'odwalpad.launchpad' ||'?p_session_id='||to_char(odwactxt.get_session_id) , ctext => add_images ( p_text => '{ssreports.gif}' , p_attributes=> 'alt="'|| ROB_msg.getMsg(Rob_msg.DSP113_CDWP_REPORTS, '', '', '', '') || '"' ) ,ctarget => '_top' ); end; -- reports_link function get_tool_help_id ( p_tool in varchar2 ) return number is l_him_id number := null; begin if p_tool = 'navigator' then l_him_id := 400; elsif p_tool = 'browser' then l_him_id := 401; elsif p_tool = 'search' then l_him_id := 402; elsif p_tool = 'reports' then l_him_id := 403; elsif p_tool = 'purge' then l_him_id := 404; elsif p_tool = 'security' then l_him_id := 405; elsif p_tool = 'graphics' then l_him_id := 406; elsif p_tool = 'management' then l_him_id := 407; elsif p_tool = 'history' then l_him_id := 408; elsif p_tool = 'hotspot' then l_him_id := 409; elsif p_tool = 'preferences' then l_him_id := 1700; else l_him_id := 1000; end if; return l_him_id; end; procedure tool_shortcuts ( p_home in boolean default true , p_navigator in boolean default true , p_browser in boolean default true , p_search in boolean default true , p_reports in boolean default true , p_management in boolean default true , p_help in boolean default true , p_him_id in number default 1000 , p_colspan in number default 1 ) is begin htp.tableData ( cdwpbase.ifThenElse(p_home,home_link)||chr(10)|| cdwpbase.ifThenElse(p_management,manage_link)||chr(10)|| cdwpbase.ifThenElse(p_navigator,nav_link)||chr(10)|| cdwpbase.ifThenElse(p_browser,browse_link)||chr(10)|| cdwpbase.ifThenElse(p_search,repsearch_link)||chr(10)|| cdwpbase.ifThenElse(p_reports,reports_link)||chr(10)|| cdwpbase.ifThenElse(p_help,help_link(p_him_id)) , cattributes => 'COLSPAN='||to_char(p_colspan)||' ALIGN="right" NOWRAP' ); end; procedure tool_tab_header ( p_tool in varchar2 , p_tabimage in varchar2 , p_mapname in varchar2 ) is begin cdwp.tableOpen( p_parameters => 'BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" SUMMARY=""'); cdwp.tableRowOpen; htp.tableData ( cdwp.add_images(p_text => '{roblogo.gif}', p_attributes => 'alt=' || Rob_msg.Getmsg(rob_msg.DSP170_ROB,'','','','') ) , cattributes => 'VALIGN="bottom" ROWSPAN=2 CLASS="low"' ); tool_shortcuts ( p_search => (p_tool <> 'search') , p_management => false , p_him_id => get_tool_help_id(p_tool) ); cdwp.tableRowClose; cdwp.tableRowOpen; htp.tableData ( cdwp.add_images ( '{'||p_tabimage||'}' , p_attributes => ' usemap="'||p_mapname||'" ALT=""' ) , cattributes => 'VALIGN="bottom"' ); cdwp.tableRowClose; cdwp.tableRowOpen; htp.tableData ( cdwp.add_images('{bar_'||p_tool||'.jpg}') , cattributes => 'BACKGROUND="'||cdwp.c_images_vd||'bar_body.jpg"' ); htp.tableData ( cdwp.add_images('{bar_tail.jpg}') , cattributes => 'BACKGROUND="'||cdwp.c_images_vd||'bar_body.jpg" WIDTH="100%" ALIGN=right' ); cdwp.tableRowOpen; cdwp.tableClose; end; procedure tool_header ( p_tool in varchar2 ) is l_show_nav_icons boolean := true; begin cdwp.tableOpen( p_parameters => 'BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" SUMMARY=""'); cdwp.tableRowOpen; htp.tableData ( cdwp.add_images(p_text => '{roblogo.gif}', p_attributes => 'alt="' || Rob_msg.Getmsg(rob_msg.DSP170_ROB,'','','','')||'"') , cattributes => 'VALIGN=bottom' ); if p_tool in ('hotspot','history') then l_show_nav_icons := false; end if; tool_shortcuts ( p_home => l_show_nav_icons , p_navigator => (p_tool not in ('navigator','menubar')) and l_show_nav_icons , p_browser => (p_tool not in ('browser','menubar')) and l_show_nav_icons , p_search => (p_tool not in ('search')) and l_show_nav_icons , p_reports => (p_tool not in ('reports','menubar')) and l_show_nav_icons , p_management => (p_tool in ('purge','security','graphics', 'preferences')) , p_him_id => get_tool_help_id(p_tool) ); cdwp.tableRowClose; cdwp.tableRowOpen; htp.tableData ( cdwp.add_images('{bar_'||p_tool||'.jpg}') , cattributes => 'BACKGROUND="'||cdwp.c_images_vd||'bar_body.jpg"' ); htp.tableData ( cdwp.add_images('{bar_tail.jpg}') , cattributes => 'BACKGROUND="'||cdwp.c_images_vd||'bar_body.jpg" WIDTH="100%" ALIGN=right' ); cdwp.tableRowOpen; cdwp.tableClose; end; -- 2.3 procedure write_status_bar is begin htp.p(''); htp.p(''); htp.tabledata ( ' Report Created by '||user ||'
' ||' on '||to_char( sysdate, 'HH24:MI DD MONTH YYYY') ,calign => 'right' ); htp.tableRowClose; htp.tableClose; end; -- write_status_bar procedure menu_bar ( p_level in number default 2 -- 2 means: start page for Application System, -- 1= List of Application Systems, 0= Cherry Pie start page -- 3 = list of elements of indicated type ,p_app_name in varchar2 default cdwpbase.get_app_name ,p_app_version in number default cdwpbase.get_app_version ,p_el_short_name in varchar2 default null -- required for p_level = 3 ,p_one_file in varchar2 default odwactxt.get_one_file ,p_static in boolean default odwactxt.get_static ,p_el_id in number default null -- the internal element_id ) is l_menu_bar varchar2(30000); begin odwavrsn.js_invoke_vhv; odwabrow.js_invoke_browser; -- tool_header('menubar'); htp.p('
'); htp.p(''); l_menu_bar:=add_images ( p_text => '{ft-left.gif}' ) -- ||cdwp.home_link ; l_menu_bar:= l_menu_bar ||cdwp.app_home_link ; if not odwactxt.get_static then l_menu_bar:= l_menu_bar ||brw_link ( p_ivid => nvl( odwactxt.get_pac_ivid, cdwpbase.get_best_ivid(odwactxt.get_pac_irid)) ); l_menu_bar:= l_menu_bar -- ||repsearch_link ||cdwpbase.ifThenElse ( nvl( odwactxt.get_pac_ivid, odwactxt.get_pac_irid) is not null , vhv_link(p_js_available => true) ) --||compare_link( p_app_name => p_app_name -- , p_app_version => p_app_version -- , p_el_short_name=> p_el_short_name -- , p_el_id => p_el_id -- ) ; end if; -- p_static = false htp.tabledata ( cvalue=> l_menu_bar ||add_images ( p_text => '{ft-right.gif}' , p_attributes=> ' Qwidth="25" ' ) -- ||cdwpbase.nbsp -- ||htf.anchor2 -- ( 'odwahelp.odwa_help' -- ||'?p_session_id='||to_char(odwactxt.get_session_id) -- , ctext => add_images -- ( p_text => '{sshelp.gif}' -- , p_attributes=> 'alt="Show On Line Help"' -- ) -- , ctarget => '_new' -- ) ,calign => 'right' ,cattributes => 'Zwidth="400" ABGCOLOR="#cccccc"' ); htp.tableRowClose; htp.tableClose; -- in static reports we do not write the menu bar. However, we do write some status information -- : Date, User if odwactxt.get_static and ( p_el_id is null or p_one_file ='N' -- one file per element instance ) then write_status_bar; htp.nl; htp.nl; htp.nl; htp.nl; htp.nl; end if; end; -- menu_bar function convertYnToCheck ( p_value in varchar2 ) return varchar2 is begin if nvl(p_value,'N') ='N' then return '-'; else return add_images( '{check_mark.gif}'); end if; end; -- convertYnToCheck function convertYnToCheck ( p_static in boolean default odwactxt.get_static ,p_value in varchar2 ) return varchar2 is begin if nvl(p_value,'N') ='N' then return '-'; else return add_images( '{check_mark.gif}'); end if; end; -- convertYnToCheck procedure print_property ( p_property_name in varchar2 ,p_property_value in varchar2 ,p_property_display_value in varchar2 default null ,p_print_if_null in boolean default false ) is begin if p_property_value is not null or p_print_if_null then htp.tableRowOpen; cdwp.TableDataHeading(p_property_name); cdwp.TableDataValue(nvl(p_property_display_value, nvl(p_property_value,'.'))); htp.tableRowClose; end if; end; --print_property procedure print_property ( p_property_name in varchar2 ,p_property_value in number ,p_property_display_value in number default null ,p_print_if_null in boolean default false ) is begin if p_property_value is not null or p_print_if_null then htp.tableRowOpen; cdwp.TableDataHeading(p_property_name); cdwp.TableDataValue(nvl(to_char(p_property_display_value), nvl(to_char(p_property_value),'.'))); htp.tableRowClose; end if; end; --print_property -- -- S T A R T U P -- procedure startup ( p_static in boolean default odwactxt.get_static , p_session_id in number default -1 ) is l_repver varchar2(200); procedure write_shortcut ( p_text in varchar2 , p_descr in varchar2 , p_link in varchar2 ) is begin cdwp.tablerowopen; htp.p ( ''); cdwp.tablerowclose; end; begin -- create session when necessary, refresh session cache, set workarea context -- from here on reference to odwactxt.get_... functions for any context value odwactxt.update_context ( p_session_id => p_session_id , p_package_name => PACKAGE_NAME , p_procedure_name=> 'startup' ); select REPOSITORY_VERSION into l_repver from RM$REPOSITORIES; htp.htmlOpen; htp.headOpen; -- 1.4 write_about(package_name, revision_label); htp.title(Rob_msg.GetMsg(Rob_msg.DSP170_ROB,'','','','')); include_stnd_styles; htp.headClose; htp.bodyOpen(); tool_header('startup'); htp.tableOpen(cattributes=>'BORDER=0 CELLPADDING=4 SUMMARY=""'); htp.tableRowOpen; if odwactxt.get_static then htp.tableData(cdwp.add_images( p_text => '{cherry1.gif}')); else htp.tableData(hwsf.fontOpen(HWS.COMIC_SANS_MS, 6)|| hwsf.fontClose ,cattributes => 'ALIGN=LEFT COLSPAN=2' ); end if; htp.tableData ( '
'||cdwpbase.nbsp(2) || cdwp.add_images ( p_text => '{rob_splash.gif}') ||cdwpbase.nbsp(2)||'
' ||hwsf.fontOpen(HWS.MS_SANS_SERIF, 6) ||Rob_msg.GetMsg(Rob_msg.DSP170_ROB,'','','','') ||hwsf.fontClose||'
' ||hwsf.fontOpen(HWS.COMIC_SANS_MS,Ccolor => 'black', nsize=>2)||release_banner||hwsf.fontClose ||hwsf.fontOpen(HWS.MS_SANS_SERIF, 3) ||'
'||l_repver ||hwsf.fontClose||'
' , cattributes => 'ROWSPAN="8" ALIGN=MIDDLE' -- #BAEDF4 ); htp.tableRowClose; -- Navigator write_shortcut ( p_text => ROB_msg.getMsg(Rob_msg.DSP114_CDWP_RON, '', '', '', '') , p_descr => ROB_msg.getMsg(Rob_msg.MSG202_CDWP_NAVIGATE, '', '', '', '') , p_link => 'odwa_fol.list_application_systems?p_session_id=' ||to_char(odwactxt.get_session_id) ||chr(38) ||'p_workarea_id=' ||to_char(odwactxt.get_workarea_irid) ); -- Launchpad write_shortcut ( p_text => ROB_msg.getMsg(Rob_msg.DSP113_CDWP_REPORTS, '', '', '', '') , p_descr => ROB_msg.getMsg(Rob_msg.MSG203_CDWP_RUNREPORTS, '', '', '', '') , p_link => 'odwalpad.launchpad?p_session_id='||to_char(odwactxt.get_session_id) ); -- Search facility write_shortcut ( p_text => ROB_msg.getMsg(Rob_msg.DSP112_CDWP_REPSEARCH, '', '', '', '') , p_descr => ROB_msg.getMsg(Rob_msg.MSG204_CDWP_SEARCHREPOS, '', '', '', '') , p_link => 'odwasrch.rep_search?p_session_id='||to_char(odwactxt.get_session_id) ); -- Browser facility write_shortcut ( p_text => ROB_msg.getMsg(Rob_msg.DSP103_CDWP_OB, '', '', '', '') , p_descr => ROB_msg.getMsg(Rob_msg.MSG205_CDWP_OBJBROWSER, '', '', '', '') , p_link => 'odwabrow.object_browser?p_session_id='||odwactxt.get_session_id ||chr(38)||'p_ivid='||nvl( odwactxt.get_pac_ivid, cdwpbase.get_best_ivid(odwactxt.get_pac_irid)) ); -- Management facility write_shortcut ( p_text => ROB_msg.getMsg(Rob_msg.CAP052_ODWA_MANAGE, '', '', '', '') , p_descr => ROB_msg.getMsg(Rob_msg.MSG206_CDWP_FACILITY, '', '', '', '') , p_link => 'odwa_mgt.mgt_home' ); -- HELP facility write_shortcut ( p_text => ROB_msg.getMsg(Rob_msg.DSP104_CDWP_HELP, '', '', '', '') , p_descr => ROB_msg.getMsg(Rob_msg.MSG207_CDWP_HELP, '', '', '', '') , p_link => 'odwahelp.odwa_help' ); /* htp.p ( '' ); */ cdwp.tableclose; htp.bodyClose; htp.htmlClose; end; -- startup -- E L E M E N T T Y P E S -- function find_app_id ( p_app_name in varchar2 , p_app_version in number default null ) return number is l_app_id number(38); begin select max(app.id) into l_app_id from ci_application_systems app where app.name = p_app_name ; return l_app_id; exception when no_data_found then return null; end; -- find_app_id procedure find_app_name_version ( p_app_id in number , p_app_name out varchar2 , p_app_version out number ) is begin select app.name , 1 into p_app_name , p_app_version from ci_application_systems app where app.id = p_app_id ; end; -- find_app_name_version -- function indicates whether the specified object version p_ivid exists in the current workarea context function is_in_wa ( p_wa_irid in number default jr_context.workarea , p_ivid in number ) return boolean is cursor c_wac ( b_wa_irid in number , b_ivid in number ) is select 'x' result from i$sdd_wa_context wac where wac.workarea_irid = b_wa_irid and wac.object_ivid = b_ivid ; r_wac c_wac%rowtype; begin open c_wac ( b_wa_irid => p_wa_irid , b_ivid => p_ivid ); fetch c_wac into r_wac; close c_wac; -- if r_wac is not null, it contains a record; that means, the object version is found in the workarea return nvl(r_wac.result,'Y') = 'x'; end; -- is_in_wa -- function indicates whether the specified object p_irid is accessible to the current user. That menas: -- whether it is owned by or short-cut from a folder that the current user (or PUBLIC) has access rights on function is_pac_accessible ( p_irid in number , p_wa_irid in number default null , p_cfg_ivid in number default null ) return boolean is cursor c_acc ( b_irid in number ) is select 'x' result from dual where exists ( select 'x' from i$sdd_folder_members fm , sdw_access_rights acc where fm.member_object = b_irid and fm.folder_reference = acc.object_reference and ( acc.grantee_reference = USER or acc.grantee_reference = 'PUBLIC' ) ) ; cursor c_acc_in_wa ( b_irid in number , b_wa_irid in number ) is select 'x' result from dual where exists ( select 'x' from i$sdd_folder_members fm , sdw_access_rights acc , i$sdd_wa_context wac where fm.member_object = b_irid and fm.parent_ivid = wac.object_ivid and wac.workarea_irid = b_wa_irid and fm.folder_reference = acc.object_reference and ( acc.grantee_reference = USER or acc.grantee_reference = 'PUBLIC' ) ) ; cursor c_acc_in_cfg ( b_irid in number , b_cfg_ivid in number ) is select 'x' result from dual where exists ( select 'x' from i$sdd_folder_members fm , i$sdd_configuration_members cm , sdw_access_rights acc where fm.member_object = b_irid and fm.parent_ivid = cm.object_ivid and cm.config_ivid = b_cfg_ivid and fm.folder_reference = acc.object_reference and ( acc.grantee_reference = USER or acc.grantee_reference = 'PUBLIC' ) ) ; r_acc c_acc%rowtype; begin if p_wa_irid is not null then open c_acc_in_wa ( b_irid => p_irid , b_wa_irid => p_wa_irid ); fetch c_acc_in_wa into r_acc; close c_acc_in_wa; elsif p_cfg_ivid is not null then open c_acc_in_cfg ( b_irid => p_irid , b_cfg_ivid => p_cfg_ivid ); fetch c_acc_in_cfg into r_acc; close c_acc_in_cfg; else open c_acc ( b_irid => p_irid ); fetch c_acc into r_acc; close c_acc; end if; return nvl(r_acc.result,'Y') = 'x'; end; -- is_pac_accessible function inaccessible_gif return varchar2 is begin return cdwp.add_images ( '{noacc.gif}' , p_attributes => ROB_msg.getMsg(rob_msg.MSG209_CDWP_ACCESSDENIED, USER , '', '', '') ); end; -- inaccessible_gif function report_link ( p_el_id in number default null , p_el_name in varchar2 default null , p_app_id in number default null , p_app_name in varchar2 default null , p_app_version in number default null , p_type_of in varchar2 default null , p_static in boolean default odwactxt.get_static , p_one_file in varchar2 default odwactxt.get_one_file , p_parameter in varchar2 default null , p_text in varchar2 default 'STANDARD' , p_bookmark in varchar2 default null -- a bookmark in the indicated HTML document that is the exact destination of the URL; include #! , p_target in varchar2 default null -- target such as _top, _new or frame-name , p_irid in number default null , p_ivid in number default null , p_app_ivid in number default odwactxt.get_folder_ivid , p_wa_id in number default odwactxt.get_workarea_irid , p_cfg_id in number default odwactxt.get_cfg_id , p_include_browser_gif in boolean default true -- when false: if the object has a report, it will only hyperlink to a report; if it does not, it will only link to the browser (but not show the browser icon) , p_fol_owned_by in number default null -- the folder owning the object indicated by p_el_id, p_irid or p_ivid ) return varchar2 -- function that return a URL to the report for the indicated element type -- if p_el_id IS NULL and p_el_name IS NULL then the ROOT procedure is invoked -- else the detail procedure is called -- in p_text the function replaces {gif} with the appropriate gif-file, {name} with the element name -- {plural} the the element type plural display name and {type} with type display name -- STANDARD means: for individual element: {name} -- for root proc : {gif}{name} is l_app_name varchar2(2000) := p_app_name; l_app_version number(3) := p_app_version; l_text varchar2(2000) := p_text; l_procedure varchar2(100) := null; l_where varchar2(500) := null; l_gif_file varchar2(100) := null; l_plural varchar2(100) := null; l_type varchar2(100) := null; l_name varchar2(500) ; l_irid number(38) := nvl( p_el_id, nvl( p_irid, cdwpbase.get_irid( p_ivid))); l_type_of varchar2(100) := nvl( p_type_of , nvl( cdwpbase.get_el_type_of( l_irid) , cdwpbase.get_type_of ( p_ivid => p_ivid) ) ); l_ivid number(38) := nvl( p_ivid, cdwpbase.get_best_ivid( p_irid=> l_irid)); l_app_id number(38) := nvl( p_app_id , nvl( cdwpbase.find_owning_app( l_irid), odwactxt.get_folder_irid) ); l_app_ivid number(38) := cdwpbase.ifThenElse ( cdwpbase.get_irid( p_app_ivid) = l_app_id , p_app_ivid , null ); l_outside_wa boolean := false; -- 5.2 to indicate whether the link is to an object outside the WA context; if so, a gif should be displayed l_in_wastebasket boolean := false; -- 6.2 to indicate whether the link is to an object that is currently in the waste basket; if it is, the name and the wastebasket icon are shown but no link is available l_accessible boolean; -- 6.9 to indicate whether object l_irid/l_ivid is accessible to the current user function launchpad_link return varchar2 is begin if odwactxt.get_static then -- one static file (multiple element descriptions) -- __.htm# -- NOW WHEN ELEMENT_NAME already contains a #number, which happens -- for example when it is a link to a Secondary Element in the PAC report, -- this ought to be recognised and dealt with; -- the #number could be decoded to /* return htf.anchor2(curl => lower(translate(l_app_name,' ','_')|| '_'|| to_char(l_app_version)|| '.htm' ||p_bookmark ) ,ctext => l_text ,ctarget => p_target ); */ return 'to de done'; else -- dynamic -- separate dynamic file (single element description) -- ?p_app_name=p_app_version= -- p__name= /* return htf.anchor2 ( 'odwa_fol.app_home' ||'?p_session_id='||to_char(odwactxt.get_session_id) ||chr(38)||'p_app_id='||to_char(l_app_id) ||p_parameter ||p_bookmark , l_text , ctarget => p_target ); */ if l_type_of in ('APP','FOL') then return l_text; else return htf.anchor2 ( 'odwalpad.launchpad' ||'?p_session_id='||to_char(odwactxt.get_session_id) ||chr(38)||'p_app_id='||cdwpbase.ifThenElse( l_type_of in ('APP','FOL'), to_char(l_irid),to_char(l_app_id)) ||chr(38)||'p_app_ivid='||cdwpbase.ifThenElse( l_type_of in ('APP','FOL'), to_char(l_ivid),to_char(l_app_ivid)) ||chr(38)||'p_wa_id='||cdwpbase.ifThenElse( l_type_of ='WA', to_char(p_wa_id)) ||chr(38)||'p_cfg_id='||cdwpbase.ifThenElse( l_type_of ='CFG', to_char(p_cfg_id)) ||chr(38)||'p_ctxt_type=' ||cdwpbase.ifThenElse ( l_type_of in ('APP','FOL') , l_type_of ||cdwpbase.ifThenElse ( nvl( p_cfg_id, p_wa_id) is not null , '_IN_' ) ) ||cdwpbase.ifThenElse ( p_cfg_id is not null , 'CFG' ) ||cdwpbase.ifThenElse ( p_wa_id is not null , 'WA' ) ||p_parameter ||p_bookmark , l_text , ctarget => p_target ); end if; -- l_type_of in ('APP','FOL') end if; -- odwactxt.get_static = true end; -- launchpad_link function app_details_link return varchar2 is begin if odwactxt.get_static then return htf.anchor2 ( curl => lower ( translate(l_app_name,' ','_') ||'_' ||to_char(l_app_version) ||'_' ||'details' ||'.htm' ) , ctext => l_text , ctarget => p_target ); else -- dynamic -- separate dynamic file (single element description) -- ?p_app_name=p_app_version= -- p__name= return htf.anchor2 ( 'odwa_app.app_details' ||'?p_session_id='||to_char(odwactxt.get_session_id) ||chr(38)||'p_app_id='||to_char(l_app_id) ||chr(38)||'p_app_ivid='||to_char(l_app_ivid) ||chr(38)||'p_wa_id='||to_char(p_wa_id) ||chr(38)||'p_cfg_id='||to_char(p_cfg_id) ||p_parameter ||p_bookmark , l_text , ctarget => p_target ); end if; -- p_static = true end; -- app_details_link function type_link return varchar2 is begin return htf.anchor2 ( curl => 'odwarprt.short_list_of_type_instances?p_session_id='||to_char(odwactxt.get_session_id) ||chr(38)||'p_el_type_of='||l_type_of ||chr(38)||'p_app_irid='||to_char(l_app_id) ||chr(38)||'p_app_ivid='||to_char( l_app_ivid) ||chr(38)||'p_wa_id='||to_char(p_wa_id) ||chr(38)||'p_cfg_id='||to_char(p_cfg_id) ||chr(38)||'p_where='||l_where ||chr(38)||'p_ctxt_type=' ||cdwpbase.ifThenElse ( l_app_id is not null , cdwpbase.get_el_type_of( l_app_id) ||cdwpbase.ifThenElse ( nvl( p_cfg_id, p_wa_id) is not null , '_IN_' ) ) ||cdwpbase.ifThenElse ( p_cfg_id is not null , 'CFG' ) ||cdwpbase.ifThenElse ( p_wa_id is not null , 'WA' ) , ctext => cdwp.add_images ( '{' ||nvl( l_gif_file, cdwpbase.get_icon( p_el_type_of => p_type_of)) ||'}') ||nvl( l_plural , cdwpbase.get_nls_type_plural ( cdwpbase.short_name_to_type_id( p_type_of) ) ) , ctarget => p_target ); end; -- type_link procedure set_procedure ( p_type_of in varchar2 ) is begin select decode ( nvl( p_el_name , nvl( to_char(l_irid) , to_char(l_ivid) ) ) , null, ROOT_PROCEDURE , DETAIL_PROCEDURE ) , gif_file , plural , display_name into l_procedure , l_gif_file , l_plural , l_type from pie_element_types pie where pie.short_name = p_type_of ; exception when no_data_found then if p_type_of = 'GEM' -- 2.0 then set_procedure( 'MDE'); elsif p_type_of = 'MDE' -- 2.0 then set_procedure( 'GEM'); elsif p_type_of in ('RMC', 'RLV') -- Reusable Module Component (MCO) now implemented -- through sub-types RLV and RMC then set_procedure( 'MCO'); else l_procedure:= 'unknown'; l_gif_file := cdwpbase.get_icon ( cdwpbase.short_name_to_type_id ( p_type_short_name => p_type_of) ); l_plural := ''; l_type := p_type_of; end if; end; -- set_procedure -- PACs only! Workarea context should be set! function get_el_name ( p_el_id in number ) return varchar2 is l_name varchar2(500); -- 3.5 cursor c_el_name( b_el_id in number) is select name el_name from i$sdd_object_versions -- 4.9 to find names outside of current WA context where irid = b_el_id ; r_el_name c_el_name%rowtype; begin open c_el_name( b_el_id => p_el_id); fetch c_el_name into r_el_name ; if c_el_name%found then l_name:= r_el_name.el_name; else l_name:= ''; end if; close c_el_name; return l_name; end; -- get_el_name begin -- 5.2 if WA is set and the referenced object l_irid is not in the current workarea -- we should add the outside_workarea gif to the link if odwactxt.get_workarea_irid is not null and l_ivid is not null then l_outside_wa := NOT is_in_wa(p_wa_irid => odwactxt.get_workarea_irid, p_ivid => l_ivid); else l_outside_wa := false; end if; if l_ivid is not null then l_in_wastebasket := odwavrsn.is_in_wastebasket(p_ivid => l_ivid); end if; if l_type_of = 'FUN' and cdwp_chk_fun_is_business_rule ( l_irid , get_el_name(l_irid) , null ) = 'Y' then l_type_of := 'BR'; end if; -- 2.9 if l_type_of = 'GEM' then l_type_of := 'MDE'; end if; -- 2.0 if l_type_of = 'PLM' and cdwp_chk_plm_is_brdd ( p_plm_irid => l_irid , p_plm_ivid => l_ivid ) = 'Y' then l_type_of := 'BRDD'; end if; -- 2.0 relocated if p_text = 'STANDARD' then if l_irid is null and l_ivid is null then l_text:= '{gif}{plural}'; else l_text:= '{gif}{name}'; end if; end if; -- p_text = 'STANDARD' if l_type_of in ('APP','FOL', 'CFG','WA') then l_gif_file := cdwpbase.get_icon ( p_el_type_of => l_type_of); l_plural := cdwpbase.get_nls_type_plural ( cdwpbase.short_name_to_type_id( l_type_of) ); l_type := cdwpbase.get_nls_type_name ( cdwpbase.short_name_to_type_id( l_type_of) ); if l_type_of ='WA' then l_name:= cdwpbase.ifThenElse ( p_wa_id is not null , cdwpbase.get_wa_name ( p_wa_irid => p_wa_id ) ); l_text:= replace(l_text,'{name}', l_name); else l_name:= cdwpbase.ifThenElse ( l_type_of in ('APP','FOL') , jr_name.get_path ( id => nvl( p_app_ivid, cdwpbase.get_best_ivid( p_app_id)) , format => 'NAME' ) ) ||cdwpbase.ifThenElse ( l_type_of = 'CFG' , jr_name.get_descriptor ( el_id => p_cfg_id , el_type => cdwpbase.short_name_to_type_id('CFG') , format => 'VLABEL' ) ) ||cdwpbase.ifThenElse ( l_type_of = 'WA' , cdwpbase.get_wa_name ( p_wa_irid => p_wa_id ) ) ; l_text:= replace(l_text,'{name}' , l_name); end if; -- l_type_of ='WA' else set_procedure( l_type_of); begin l_name:= jr_name.get_crn_from_ivid(i_ivid => l_ivid,format => 'NAME'); -- 5.8 to solve issue 18; deal with name changes exception when no_data_found then l_name:= cdwpbase.get_el_name_for_ivid(p_el_ivid => l_ivid); end; end if; -- l_type_of in ('APP','FOL', 'CFG','WA') if l_type_of = 'DIA' then if nvl( l_irid, l_ivid) is null then if instr( p_parameter, 'p_dia_type=') > 0 then l_type_of := substr( p_parameter, instr( p_parameter, 'p_dia_type=')+11 , 3); l_gif_file:= cdwp_dia.get_diagram_gif ( p_dia_type => l_type_of ); l_plural:= cdwp_dia.get_diagram_plural ( p_dia_type => l_type_of ); l_where:= ' ascii( substr( ci.diagram_type,1,1)) = '||to_char(ascii(substr(l_type_of,1,1))) ||'AND ascii( substr( ci.diagram_type,2,1)) = '||to_char(ascii(substr(l_type_of,2,1))) -- cannot pass quotes in URL, so ci.diagram_type = '''||l_type_of||'''' does not work ; l_where:= ' ci.diagram_type = kwoot'||l_type_of||'kwoot' ; l_where:= replace( replace( l_where, ' ','+'), '=','IZZZ'); else null; end if; else l_type_of := cdwp_dia.get_dia_type( p_irid => l_irid); l_gif_file:= cdwp_dia.get_diagram_gif ( p_dia_type => l_type_of ); l_plural:= cdwp_dia.get_diagram_plural ( p_dia_type => l_type_of ); end if; l_type_of := 'DIA'; end if; -- l_type_of='DIA' l_text:= replace( l_text, '{gif}' , cdwp.add_images('{'||l_gif_file||'}')); l_text:= replace( l_text, '{name}', l_name); l_text:= replace( l_text, '{type}', l_type); l_text:= replace( l_text, '{plural}', l_plural); if l_type_of in ( 'WA','CFG') then return launchpad_link ; elsif l_type_of in ( 'APP', 'FOL') then return odwabrow.browser_link ( p_session_id => odwactxt.get_session_id , p_ivid => l_ivid , p_target => p_target , p_text => nvl(l_text, cdwp.add_images ( '{browsesmall.jpg}' , p_attributes => 'ALT="'|| ROB_msg.getMsg(Rob_msg.DSP103_CDWP_OB, '', '', '', '')||'"' ) ) ) ; elsif l_type_of = 'APP_DETAILS' then return app_details_link; elsif nvl( p_el_name , nvl( to_char(l_irid) , to_char(l_ivid) ) ) is null then return type_link; elsif l_procedure ='unknown' then return l_text ||cdwpbase.ifthenelse ( is_pac_accessible ( p_irid => l_irid , p_wa_irid => odwactxt.get_workarea_irid , p_cfg_ivid => odwactxt.get_cfg_id ) , odwabrow.browser_link ( p_session_id => odwactxt.get_session_id , p_ivid => l_ivid , p_target => p_target , p_text => cdwp.add_images ( '{browsesmall.jpg}' , p_attributes => 'ALT="'||ROB_msg.getMsg(Rob_msg.DSP103_CDWP_OB, '', '', '', '')||'"' ) , p_check_access => false ) , inaccessible_gif ) ||cdwpbase.ifThenElse -- $%x.y to display outside workarea gif when required ( l_outside_wa , cdwp.add_images(p_text => '{outside_workarea.gif}', p_attributes =>ROB_msg.getMsg(Rob_msg.DSP115_CDWP_NOWORKAREA, '', '', '', '')) ) ; -- return l_text; else -- 6.2 if in wastebasket do not provide link if l_in_wastebasket then return l_text||cdwp.add_images('{wastebasket.gif}', p_attributes => ROB_msg.getMsg(Rob_msg.DSP116_CDWP_WASTEBASKET, '', '', '', '')); end if; -- 6.9 determine accessibility of the object l_accessible:= is_pac_accessible ( p_irid => l_irid , p_wa_irid => odwactxt.get_workarea_irid , p_cfg_ivid => odwactxt.get_cfg_id ); -- 1.9 if l_procedure is not null then return cdwpbase.ifThenElse ( l_accessible , cdwp.link ( p_app_name => '' , p_app_version => '' , p_element_type => l_type_of , p_procedure => l_procedure , p_element_name => replace(nvl( p_el_name , cdwpbase.ifThenElse ( l_type_of in ('MDE','GEM') , get_el_name( l_irid) , l_name ) ),' ','_') -- 1.9, 2.0 Spaces are not allowed in parameter values , p_text => l_text , p_parameters => p_parameter ||cdwpbase.ifThenElse ( p_bookmark is not null , cdwpbase.ifThenElse ( instr(p_bookmark, '#') = 0 , '#' ) ) ||p_bookmark , p_app_irid => p_app_id , p_irid => l_irid , p_ivid => l_ivid , p_target => p_target ) ||cdwpbase.ifThenElse ( p_include_browser_gif , odwabrow.browser_link ( p_session_id => odwactxt.get_session_id , p_ivid => l_ivid , p_target => p_target , p_text => cdwp.add_images ( '{browsesmall.jpg}' , p_attributes => 'ALT="'||ROB_msg.getMsg(Rob_msg.DSP103_CDWP_OB, '', '', '', '')||'"' ) , p_check_access => false ) ) , l_text||inaccessible_gif ) ||cdwpbase.ifThenElse -- to display outside workarea gif when required ( l_outside_wa , cdwp.add_images(p_text => '{outside_workarea.gif}', p_attributes => ROB_msg.getMsg(Rob_msg.DSP115_CDWP_NOWORKAREA, '', '', '', '')) ) ; end if; -- l_procedure is not null end if; -- l_type_of ='APP' end; -- report_link -- this procedure will automatically execute the appropriate procedure for p_ivid -- where available it will run the Repositgory Report; where not, it will run the Browser procedure go_link ( p_ivid in number ) is l_procedure varchar2(100) := null; l_irid number(38) := cdwpbase.get_irid( p_ivid); l_type_of varchar2(100) := cdwpbase.get_type_of ( p_ivid => p_ivid); l_in_wastebasket boolean := false; -- 6.2 to indicate whether the link is to an object that is currently in the waste basket; if it is, the name and the wastebasket icon are shown but no link is available function get_procedure ( p_type_of in varchar2 ) return varchar2 is cursor c_prc( b_type_of in varchar2) is select DETAIL_PROCEDURE from pie_element_types pie where pie.short_name = b_type_of ; r_prc c_prc%rowtype; begin open c_prc( b_type_of => p_type_of); fetch c_prc into r_prc ; close c_prc; return r_prc.detail_procedure; end; -- get_procedure begin l_in_wastebasket := odwavrsn.is_in_wastebasket(p_ivid => p_ivid); if l_in_wastebasket then odwa_fol.wastebasket_report(p_ivid); else if is_pac_accessible( p_irid => l_irid) then l_procedure := get_procedure( p_type_of => l_type_of); if l_procedure is not null then execute immediate ' begin ' ||' '||l_procedure ||' ( p_session_id => '||nvl(to_char(odwactxt.get_session_id),'null') ||' , p_irid => '||nvl( to_char(l_irid), 'null') ||' , p_ivid => '||to_char(p_ivid) ||' );' ||' end;' ; else odwabrow.object_browser ( p_session_id => odwactxt.get_session_id , p_ivid => p_ivid ); end if; --l_procedure is not null else odwa_fol.inaccessible_report(p_ivid); end if; -- is_pac_accessible( p_irid => l_irid) end if; -- end; -- go_link function sac_link ( p_sac_irid in number default null , p_sac_ivid in number default null , p_sac_name in varchar2 default null , p_sac_type_id in number default null , p_sac_type_of in varchar2 default null , p_pac_irid in number default null , p_pac_ivid in number default null , p_pac_type_id in number default null , p_pac_type_of in varchar2 default null , p_bookmark in varchar2 default null -- default: # , p_text in varchar2 default '{sacgif}{name}.{sacname}' , p_target in varchar2 default null -- target such as _top, _new or frame-name , p_app_ivid in number default odwactxt.get_folder_ivid , p_wa_id in number default odwactxt.get_workarea_irid , p_cfg_id in number default odwactxt.get_cfg_id ) return varchar2 -- function that return a URL to the report for the indicated SAC element within the -- report for the PAC that owns the SAC is l_text varchar2(2000) := p_text; l_pac_type_of varchar2(10); begin -- initialize the SAC cache cdwpbase.get_sac ( p_ivid => p_sac_ivid , p_irid => p_sac_irid , p_type_id => p_sac_type_id , p_type_of => p_sac_type_of ); -- if {sacgif} in l_text, replace it with the proper icon l_text:= replace ( l_text , '{sacgif}' , cdwp.add_images ( '{' ||cdwpbase.get_icon( nvl( p_sac_type_id, cdwpbase.short_name_to_type_id( p_sac_type_of))) ||'}' ) ); -- if {sacname} in l_text, replace it with the proper value l_text:= replace ( l_text , '{sacname}' , cdwpbase.get_sac_name( p_ivid => p_sac_ivid, p_irid => p_sac_irid, p_type_id => p_sac_type_id, p_type_of => p_sac_type_of) ); -- if {sactype} in l_text, replace it with the proper value l_text:= replace ( l_text , '{sactype}' , cdwpbase.get_nls_type_name( p_type_id => nvl( p_sac_type_id, cdwpbase.short_name_to_type_id( p_sac_type_of))) ); l_pac_type_of:= cdwpbase.get_el_type_of ( cdwpbase.get_sac_pac_irid( p_ivid => p_sac_ivid, p_irid => p_sac_irid, p_type_id => p_sac_type_id, p_type_of => p_sac_type_of) ); return report_link ( p_irid => nvl( p_pac_irid , cdwpbase.get_sac_pac_irid( p_ivid => p_sac_ivid, p_irid => p_sac_irid, p_type_id => p_sac_type_id, p_type_of => p_sac_type_of) ) , p_type_of => l_pac_type_of , p_bookmark => nvl( replace ( p_bookmark , '{pacirid}' , to_char( nvl( p_pac_irid , cdwpbase.get_sac_pac_irid( p_ivid => p_sac_ivid, p_irid => p_sac_irid, p_type_id => p_sac_type_id, p_type_of => p_sac_type_of) ) ) ) , '#'||nvl( p_sac_type_of, cdwpbase.get_el_type_of(p_sac_type_id)) ||to_char( nvl(p_sac_irid, cdwpbase.g_irid)) ) , p_text => l_text , p_target => p_target , p_app_ivid => p_app_ivid , p_wa_id => p_wa_id , p_cfg_id => p_cfg_id , p_include_browser_gif => true ); end; -- sac_link procedure list_element_types ( p_app_id in number := null , p_app_name in varchar2 , p_app_version in number , p_app_display_title in varchar2 default null , p_one_file in varchar2 default odwactxt.get_one_file , p_static in boolean default odwactxt.get_static ) is begin null; end; procedure write_about -- Purpose: write package name and revision in HTML source text, for debugging -- it is not visible when running the HTML in browser -- -- Usage: Call it directly after htp.htmlopen and htp.headopen -- ( p_package_name in varchar2 , p_revision_label in varchar2 ) is begin htp.meta ( chttp_equiv => '' -- values such as Refresh, Expires, Content-Type, Pragma , cname => 'Author' -- values such as no-cache, generator, keywords, description, author , ccontent => 'User '||user||' using the Repository Object Browser' ); htp.meta ( chttp_equiv => '' -- values such as Refresh, Expires, Content-Type, Pragma , cname => 'Description' -- values such as no-cache, generator, keywords, description, author , ccontent => 'Package Name = '||p_package_name ||'; Revision Label = '||p_revision_label ); htp.meta ( chttp_equiv => 'Content-Type' , cname => '' , ccontent => 'text/html; charset= '|| odwapref.get_value('charset') ); end write_about; procedure odwa_user_home is begin null; end; begin g_images_vd := odwapref.get_value(p_preference_name => 'image_path'); end cdwp; /
' || htf.anchor ( p_link , ''||p_text||'' ) ); htp.p ( '
'||p_descr||'
' ||cdwp.add_images( p_text => '{db.gif}') ||'' ||'' ||htf.anchor ( curl => 'odwa_dba.db_navigator?p_session_id=1' , ctext => 'Database Navigator' ) ||'
Navigate the physical database.