create or replace package odwa_fol is -- root-folders in configuration cursor c_root_in_cfg( b_cfg_ivid in number) is select app.irid app_id , app.ivid app_iVId , app.name app_name , 1 app_version -- must be replaced with the real version label , app.display_title app_display_title , app.types app_types , decode ( app.types , 4844, 'FOL' , 5009, 'APP' , 'CNT') app_type , ov.vlabel , nvl(ov.state, 'N') state from sdd_folders app , sdd_object_versions ov , i$sdd_configuration_members cfm where app.root_flag = 'Y' and ov.ivid = app.ivid and cfm.CONFIG_IVID = b_cfg_ivid and cfm.object_ivid = app.ivid order by app.name , ov.branch_id -- to at least group by branch; probably need name of branch as well , ov.sequence_in_branch ; -- root-folders in current workarea (if not workarea set, all versions of all root folders) cursor c_root_app is select app.irid app_id , app.ivid app_iVId , app.name app_name , 1 app_version -- must be replaced with the real version label , app.display_title app_display_title , app.types app_types , decode ( app.types , 4844, 'FOL' , 5009, 'APP' , 'CNT') app_type , ov.vlabel , nvl(ov.state, 'N') state from sdd_folders app , sdd_object_versions ov where app.root_flag = 'Y' and ov.ivid = app.ivid order by app.name , ov.branch_id -- to at least group by branch; probably need name of branch as well , ov.sequence_in_branch ; cursor c_nested_apps( b_folder_ivid in number) is select app.irid app_id , app.ivid app_iVId , app.name app_name , 1 app_version -- must be replaced with the real version label , app.display_title app_display_title , app.types app_types , decode ( app.types , 4844, 'FOL' , 5009, 'APP' , 'CNT') app_type , ov.vlabel , nvl(ov.state, 'N') state from sdd_folders app , sdd_object_versions ov , sdd_folder_members fm where app.irid = fm.member_object and fm.parent_ivid = b_folder_ivid and ov.ivid = app.ivid order by app.name , ov.branch_id -- to at least group by branch; probably need name of branch as well , ov.sequence_in_branch ; -- cursor to be used outside of workarea context for a specific folder version cursor c_nested_apps_in_cfg ( b_folder_ivid in number , b_cfg_ivid in number ) is select app.irid app_id , app.ivid app_iVId , app.name app_name , 1 app_version -- must be replaced with the real version label , app.display_title app_display_title , app.types app_types , decode ( app.types , 4844, 'FOL' , 5009, 'APP' , 'CNT') app_type , ov.vlabel , nvl(ov.state, 'N') state from sdd_folders app , sdd_object_versions ov , sdd_folder_members fm , i$sdd_configuration_members cfm where app.irid = fm.member_object and fm.parent_ivid = b_folder_ivid and ov.ivid = app.ivid and cfm.CONFIG_IVID = b_cfg_ivid and cfm.object_ivid = app.ivid order by app.name , ov.branch_id -- to at least group by branch; probably need name of branch as well , ov.sequence_in_branch ; -- public procedures and functions -- -- procedure app_home ( p_session_id in number , p_app_id in number default -1 , p_root_value in varchar2 default null , p_root_classification in varchar2 default null ); -- returns the HREF value for URLs to ODWA reports for any element, given its IVID -- the value is only useful in documents that contain the go function, written through -- a call to procedure js_go function call_go ( p_ivid in number ) return varchar2 ; -- this procedure write a JavaScript function that can be called to hyperjump -- to the report for a specific ivid value procedure js_go ( p_session_id in number , p_target in varchar2 default 'document' -- values are: document, top, parent, ); -- this procedure is a central router that can be called for any ivid value -- the procedure will determine what type the element has and will re-route -- to the appropriate report-procedure procedure go ( p_session_id in number , p_ivid in number ); procedure folderTree ( p_session_id in number ); procedure logoFrame ( p_session_id in number ); procedure waSelector ( p_session_id in number ); procedure dataXchange ( p_session_id in number ); procedure rightSide ( p_session_id in number ); -- this procedure prints a very simple report, informing the user that the object he -- requested a report for is in the Wastebasket and therefore not available for reporting procedure wastebasket_report ( p_ivid in number ); -- this procedure prints a very simple report, informing the user that the object he -- requested a report for is not accessible since it is owned by a folder he has no access to procedure inaccessible_report ( p_ivid in number ); -- this procedure can be called from the tree from nodes that represents a specific element type -- within an application system or folder; this procedure will have to redirect to a procedure -- that can procedure the appropriate report procedure type_rep ( p_session_id in number , p_app_id in number , p_el_type_of in varchar2 , p_root_value in varchar2 , p_root_classification in varchar2 ); procedure inflate_Node ( p_node_index in number , p_node_level in number -- level of node-to-be-inflated (all its children will have p_node_level + 1 or higher) , p_num_of_nodes in number , p_node_value in varchar2 default null , p_node_type in varchar2 default null , p_entry_point in number default null , p_session_id in number , p_root_value in varchar2 , p_root_classification in varchar2 default null ); procedure inflate_configs ; procedure inflate_all_folders ; procedure inflate_root_in_wa ( p_wa_irid in number ); procedure appsBottom ( p_session_id in number ); -- A P P L I C A T I O N S Y S T E M S -- procedure list_application_systems ( p_session_id in number , p_workarea_id in number default -1 ); end; -- odwa_fol /