/***************************************************************************************** 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 Revision history When Who Construct Revision What ------------------------------------------------------------------------------------------ 29-sep-2002 Kannan Parthasarathy - Fixed OAC p1 violations. *****************************************************************************************/ create or replace package cdwp is C_LIST_DOM_PROC varchar2(200) default 'cdwp_dom.list_domains'; C_SLIST_DOM_PROC varchar2(200) default 'cdwp_dom.short_list_domains'; C_LIST_ENT_PROC varchar2(200) default 'cdwp_ent.list_entities'; C_SLIST_ENT_PROC varchar2(200) default 'cdwp_ent.short_list_entities'; C_LIST_FUN_PROC varchar2(200) default 'cdwp_fun.list_business_functions'; C_SLIST_FUN_PROC varchar2(200) default 'cdwp_fun.short_list_business_functions'; C_ROOT_FUN_PROC varchar2(200) default 'cdwp_fun.root_business_functions'; C_LIST_BR_PROC varchar2(200) default 'cdwp_br.list_business_rules'; C_SLIST_BR_PROC varchar2(200) default 'cdwp_br.short_list_business_rules'; C_ROOT_BR_PROC varchar2(200) default 'cdwp_br.root_business_rules'; g_dsql_varchar2_result varchar2(4000); g_dsql_number_result number(38); g_dsql_boolean_result boolean; -- -- cursor to select text lines of a specific type and element -- cursor c_txt ( b_txt_ref number , b_txt_type varchar2 ) is select nvl(txt.txt_text, '.') txt_text from cdi_text txt where txt.txt_ref = b_txt_ref and txt.txt_type = b_txt_type order by txt.txt_seq; -- -- public program units -- -- 5.8 use odwapref instead of hard-coded value -- -- virtual directory for images '/odwa_images/'; -- standard installation function C_IMAGES_VD return varchar2 ; function release_banner return varchar2 ; -- to find out whether an object has certain details 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 ; 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 ; procedure heading ( p_level in number , p_static in boolean default odwactxt.get_static ); procedure TableDataHeading ( p_heading in varchar2 , p_size in number default 2 , p_attributes in varchar2 default null ); 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=""' ); function p ( p_string in varchar2 , p_style in varchar2 default null ) return varchar2 ; procedure p ( p_string in varchar2 , p_style in varchar2 default null ); 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' ) return varchar2; -- to be called from every element report, in the Heading section procedure include_report_styles ; procedure include_stnd_styles ; procedure tableRowOpen ( p_parameters in varchar2 default '' ); procedure tableRowClose ; -- to open the HTML table procedure tableOpen ( p_parameters in varchar2 default 'BORDER="0" SUMMARY=""' ); -- to close the HTML table procedure tableClose ; 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 ; procedure bookmark ( p_target_code in varchar2 ); function add_images ( p_text in varchar2 , p_static in boolean default odwactxt.get_static , p_attributes in varchar2 := null ) return varchar2 ; -- this function returns a string with a HOME.gif and a link to the indicated level function home_link ( p_one_file in varchar2 default odwactxt.get_one_file ,p_static in boolean default odwactxt.get_static ) return varchar2 ; 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 ; -- 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 ; -- this procedure will automatically execute the appropriate procedure for p_ivid -- where available it will run the Repositgory Report; where not, it will run VHV (for now) -- when it becomes available, it will run the Browser procedure go_link ( p_ivid in number ); 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 , 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} procedure tool_tab_header ( p_tool in varchar2 , p_tabimage in varchar2 , p_mapname in varchar2 ); procedure tool_header ( p_tool in varchar2 ); 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 ); function convertYnToCheck ( p_value in varchar2 ) return varchar2 ; function convertYnToCheck ( p_static in boolean default odwactxt.get_static ,p_value in varchar2 ) return varchar2 ; 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 ); 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 ); procedure startup ( p_static in boolean default odwactxt.get_static , p_session_id in number default -1 ); 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 ); function find_app_id ( p_app_name in varchar2 , p_app_version in number default null ) return number ; procedure find_app_name_version ( p_app_id in number , p_app_name out varchar2 , p_app_version out number ); procedure odwa_user_home ; 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 ); -- function that return a URL to the report for the indicated SAC element within the -- report for the PAC that owns the SAC 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 indicates whether the specified object p_irid 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 ; end; /