create or replace package body odwainfo is /***************************************************************************************** Purpose Implements the popup window with information on a certain object Should also provide the About Window for ODWA Usage Remarks Revision history When Who Construct Revision What ------------------------------------------------------------------------------------------ $REVISION_HISTORY$ 26-nov-2002 Kannan Parthasarathy B2661562: Modified display statement. 30-jan-2001 Lucas Jellema 1.5 Solve problem similar to issue 125: wrong folder path for object with a / in their name 10-jan-2001 Lucas Jellema 1.4 Include menu-bar: links to VHV, VEV, Browser Show wastebasket status 20-dec-2000 Lucas Jellema 1.3 WHAT will you be doing (during the check out)?: Include in the info window one complete (owning) folder path with folder versions Sandra Muller wrote: Ik heb nu al een paar keer gehad dat ik op zoek was naar files die in een oudere versie van een bepaalde folder zitten. Met de Search van ODWA kan ik die files makkelijk vinden, maar ik kan ze heel moeilijk in de RON terugvinden omdat ik niet kan zien in welke versie van de owning container(s) ze zitten. Voorbeeld: ik doe een Search naar hsustart.fmb, en vind er een die in headstart/hst/demo zit. Dit is fout, en ik wil dat object purgen Hij zit echter niet in de laatste versie van hst/demo, en als ik hem wil purgen moet ik een workarea maken waar hij in zit. Hiervoor zou het handig zijn om de versienummers van de owning containers in het pad te weten, bijvoorbeeld headstart(1.3)/hst(0.6)/demo(0.15). Dit kan bijvoorbeeld door bij de samenvattende properties van een object (die je krijgt door op de gele i te klikken) (tevens) het pad met versienummers te tonen. WHY (reason for checking out;reference to Bug Number or Change Request): Request by Sandra Muller, ample time savings for Repository Managers. HOW LONG (will the check out last - starting 13:48 20-DEC-2000): 45 minutes 08-dec-2000 Lucas Jellema 1.2 Notes for diagram: show diagram type 15-sep-2000 Lucas Jellema 1.1 Update Context 12-sep-2000 Lucas Jellema 1.0 Checked in after upload from D:\odwa6i\ddl\odwainfo.pkb 10-aug-2000 Lucas Jellema 1.0 Initial Creation *****************************************************************************************/ -- -- private constants -- REVISION_LABEL constant varchar2(30) := '$x.y::1.5 $'; PACKAGE_NAME constant varchar2(30) := 'ODWAINFO'; cursor c_ov (b_ivid in number) is select ov.NAME , ov.TABLE_IRID , ov.LOGICAL_TYPE_ID , ov.NOTM , ov.OBJ_NOTM , ov.OBJ_NOTM_WHEN_ANALYZED , ov.STATE , ov.WASTEBASKET , ov.LOCK_FLAG , ov.DATE_CREATED , ov.CREATED_BY , ov.DATE_CHANGED , ov.CHANGED_BY , ov.VLABEL , ov.BRANCH_ID , ov.SEQUENCE_IN_BRANCH , ov.IRID_GUID , ov.COMMENTS , brn.name branch_name , usr_ch.full_user_name changed_by_full , usr_cr.full_user_name created_by_full from i$sdd_object_versions ov , i$sdd_branches brn , sdw_users usr_ch , sdw_users usr_cr where ov.ivid = b_ivid and ov.branch_id = brn.branch_id (+) and ov.changed_by = usr_ch.username(+) and ov.created_by = usr_cr.username(+) ; r_ov c_ov%rowtype; procedure js_invoke_info ( p_function_name in varchar2 default 'popupInfo' ) is begin htp.p(' '); end; -- js_invoke_info function info_url ( p_ivid in number , p_icon in varchar2 default 'info.gif' , p_text in varchar2 default null , p_alt_text in varchar2 default null , p_function_name in varchar2 default 'popupInfo' -- the JavaScript function accessible from the current frame that will invoke the infoWindow ) return varchar2 is begin return '' ||cdwpbase.ifThenElse ( p_icon is not null , cdwp.add_images ( '{'||p_icon||'}' , p_attributes => cdwpbase.ifThenElse ( p_alt_text is not null , 'ALT="'||p_alt_text||'"' ) ) ) ||p_text ||'' ; end; --info_url -- this procedure will write some additional details for selected elements -- e.g. for Files it writes the File Size, for Function the Short Definition procedure add_details ( p_ivid in number , p_type_id in number ) is cursor c_files( b_ivid in number) is select file_size , os_timestamp , short_description from i$sdd_files where ivid = b_ivid ; r_files c_files%rowtype; cursor c_fun( b_ivid in number) is select short_definition from i$sdd_fun where ivid = b_ivid ; r_fun c_fun%rowtype; cursor c_mod( b_ivid in number) is select short_title , short_name , name , plsql_module_type , java_module_type , purpose , implementation_name , general_module_type , completion_status , size_of_module , complexity , estimate , estimate_units , task_code , project_code , activity_code from i$sdd_mod where ivid = b_ivid ; r_mod c_mod%rowtype; begin if p_type_id = 4819 -- FILES then open c_files( b_ivid => p_ivid); fetch c_files into r_files; close c_files; cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.CAP090_ODWACHKI_FILESIZE,'','','','') , p_property_value => to_char( round(r_files.file_size/1024))||' Kb' ||' ('||to_char( r_files.file_size)||' bytes)' ); cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.CAP121_ODWAINFO_DESC,'','','','') , p_property_value => r_files.short_description ); cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.CAP122_ODWAINFO_OSTS,'','','','') , p_property_value => to_char( r_files.os_timestamp, 'dd-mon-yyyy hh24:mi') ); end if; if p_type_id = 5024 -- FUN or BR then open c_fun( b_ivid => p_ivid); fetch c_fun into r_fun; close c_fun; cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.CAP123_ODWAINFO_DEF,'','','','') , p_property_value => r_fun.short_definition ); end if; if p_type_id = 4941 -- DIA then cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.CAP124_ODWAINFO_DTYPE ,'','','','') , p_property_value => substr ( cdwp_dia.get_dia_type ( p_irid => cdwpbase.get_irid( p_ivid) ) , 1 , 3 ) ); end if; if p_type_id in ( 4907, 4908, 5062) -- PLM, GEM then open c_mod( b_ivid => p_ivid); fetch c_mod into r_mod; close c_mod; if r_mod.name <> r_mod.short_name then cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.CAP094_ODWADEPS_NAME ,'','','','') , p_property_value => r_mod.name ); end if; cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.CAP125_ODWAINFO_TITLE,'','','','') , p_property_value => r_mod.short_title ); cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.CAP126_ODWAINFO_PURPOSE,'','','','') , p_property_value => r_mod.purpose ); -- PLANNING cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.CAP127_ODWAINFO_STATUS,'','','','') , p_property_value => r_mod.completion_status ); -- size, complexity, project, activity, task, estimate, estimate_units if r_mod.plsql_module_type is not null then cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.CAP128_ODWAINFO_TYPE,'','','','') , p_property_value => cdwp.add_images ( '{' ||cdwp_plm.get_plm_icon_name ( p_plsql_module_type => r_mod.plsql_module_type ) ||'}' ) ||r_mod.plsql_module_type ); end if; -- r_mod.plsql_module_type is not null end if; end; -- add_details procedure infoWindow ( p_session_id in number , p_ivid in varchar2 ) is l_ivid number(38):= to_number(p_ivid); l_wa_irid number(38); l_menu_bar varchar2(2000); begin odwactxt.update_context ( p_session_id => p_session_id , p_package_name => PACKAGE_NAME , p_procedure_name=> 'infoWindow' , P_PAC_IvID => l_ivid ); open c_ov( b_ivid => l_ivid); fetch c_ov into r_ov; close c_ov; htp.htmlOpen; htp.headOpen; cdwp.write_about(package_name, revision_label); htp.title ( Rob_msg.GetMsg(Rob_msg.DSP246_ODWAINFO_TITLE ,cdwpbase.get_nls_type_name ( p_type_id => r_ov.logical_type_id) -- cdwpbase.get_ivid_type_id(p_ivid)) ||' '||r_ov.name -- cdwpbase.get_irid( p_ivid) ,'' ,'' ,'' ) ); cdwp.include_report_styles; odwavrsn.js_invoke_vev ( p_irid => odwactxt.get_pac_irid , p_ivid => p_ivid ); odwavrsn.js_invoke_vhv ( p_irid => odwactxt.get_pac_irid , p_ivid => p_ivid ); htp.headClose; htp.bodyOpen; htp.p(''); htp.p(''); l_menu_bar:=cdwp.add_images( p_text => '{ft-left.gif}') ; l_menu_bar:= l_menu_bar ||odwabrow.browser_link ( p_session_id => odwactxt.get_session_id , p_ivid => p_ivid ) ||htf.anchor ( ctext=> cdwp.add_images ( '{versiontreegr.gif}' , p_attributes => 'ALT="'||Rob_msg.GetMsg(Rob_msg.CAP073_ODWACHCK_VERHIST,'','','','')||'"' ) , curl => 'javascript:invokeVhv();' ) ||htf.anchor ( ctext=> cdwp.add_images ( '{vevgr.jpg}' , p_attributes => 'ALT="'||Rob_msg.GetMsg(Rob_msg.CAP074_ODWACHCK_REVHIST,'','','','')||'"' ) , curl => 'javascript:invokeVev();' ) ||cdwp.add_images ( p_text => '{ft-right.gif}' , p_attributes=> ' Qwidth="25" ' ) ; htp.tabledata ( cvalue=> l_menu_bar ,calign => 'right' ,cattributes => 'Zwidth="400" ABGCOLOR="#cccccc"' ); htp.tableRowClose; htp.tableClose; htp.nl; htp.nl; htp.tableOpen('BORDER="0"'); cdwp.print_property ( p_property_name => 'Name' , p_property_value => r_ov.name ); cdwp.print_property ( p_property_name => 'Type' , p_property_value => cdwp.add_images ( '{'||cdwpbase.get_icon( r_ov.logical_type_id)||'}') ||cdwpbase.get_nls_type_name ( p_type_id => r_ov.logical_type_id -- cdwpbase.get_ivid_type_id(p_ivid) ) ); if odwavrsn.is_in_wastebasket(p_ivid => l_ivid) then cdwp.print_property ( p_property_name => cdwp.add_images('{wastebasket.gif}') ||Rob_msg.GetMsg(Rob_msg.DSP247_ODWAINFO_INWB,'','','','') , p_property_value => Rob_msg.GetMsg(Rob_msg.DSP248_ODWAINFO_WBINFO,r_ov.changed_by_full,to_char(r_ov.date_changed, 'dd-mon-YYYY hh24:mi'),'','') ); end if; -- odwavrsn.is_in_wastebasket(p_ivid => l_ivid) cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.DSP249_ODWAINFO_CREATEDBY,'','','','') , p_property_value => r_ov.created_by_full ||' on ' ||to_char(r_ov.date_created, 'dd-mon-YYYY hh24:mi') ); if r_ov.date_changed is not null then cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.DSP250_ODWAINFO_MODBY,'','','','') , p_property_value => odwavrsn.get_author_name ( p_user => odwaprop.get_value ( p_ivid => l_ivid , p_type_id => r_ov.logical_type_id , p_property => 'CHANGED_BY' ) ) ||' on ' ||odwaprop.get_value ( p_ivid => l_ivid , p_type_id => r_ov.logical_type_id , p_property => 'DATE_CHANGED' ) ); end if; add_details ( p_ivid => l_ivid , p_type_id => r_ov.logical_type_id ); odwavrsn.version_status; cdwp.TableDataHeading(Rob_msg.GetMsg(Rob_msg.DSP167_ODWA_CONTEXT,'','','','')); cdwp.TableDataValue ( odwactxt.get_context_label ( p_include_folder_versions => odwactxt.get_workarea_irid is null and odwactxt.get_folder_ivid is not null ) ); cdwpbase.app_summary ( p_el_id => odwactxt.get_pac_irid , p_include_context_label => false ); l_wa_irid:= odwactxt.get_workarea_irid; jr_context.set_workarea(workarea_irid => null); cdwp.print_property ( p_property_name => Rob_msg.GetMsg(Rob_msg.DSP301_ODWAINFO_FOLPATH,'','','','') , p_property_value => jr_name.get_path ( id => jr_acc_rights.get_owning_container(obj_irid => odwactxt.get_pac_irid) , format => 'VLABEL' ) ); jr_context.set_workarea(workarea_irid => l_wa_irid); htp.tableRowOpen; cdwp_txt.display_mlt ( p_el_id => odwactxt.get_pac_irid , p_txt_type => 'CDIDSC' , p_mlt_prompt_name => null , p_max_lines => null , p_el_type => 'FUN' ); htp.TableRowClose; htp.tableClose; htp.bodyClose; htp.htmlClose; end; -- infoWindow begin null; end; -- odwainfo /