create or replace package body odwarobs
is
/*****************************************************************************************
Purpose Navigating through and selecting objects from the Repository
Usage
Remarks
Revision history
When Who Construct
Revision What
------------------------------------------------------------------------------------------
$revision_history$
10-Sep-2003 Kannan Parthasarathy
- B2881790: Fixed GIF file name.
25-Jan-2002 Kannan Parthasarathy
- B2727189: Escape double quotes in JavaScript.
16-Dec-2002 Kannan Parthasarathy
- B2636982: Show only valid objects.
10-Dec-2002 Kannan Parthasarathy
- B2701835 : Fixed.
18-Nov-2002 Kannan Parthasarathy
- Fixed OAC P1 violations.
24-sep-2002 Kannan Parthasarathy
- References to CDM are hidden from general users
31-jul-2001 Lucas Jellema
1.10 - include join with RM_REPOSITORIES to resolve NLS Issue (bug 1911520) in queries with RM$NLS_ELEMENT_TYPES
01-mar-2001 Lucas Jellema
1.9 - list UE element types
23-feb-2001 Lucas Jellema
1.8 - help item link to help item 1580
- fix issue 209 - different icon for search option [odwa project/209%]
02-feb-2001 Lucas Jellema
1.7 - allow Folders to be selected if so indicated
- make working on IE
12-jan-2001 Peter Ebell
1.6 - Minor layout changes to object browser
22-sep-2000 Lucas Jellema
1.5 function invoke_robs, procedure rob, procedure js_submmit_robs: Support passing back and forth of context (cfg_ivid, wa_irid); close properly if calling window no longer available.
15-sep-2000 Lucas Jellema
1.4 - MultiFrame
- support for Select Version
29-aug-2000 Lucas Jellema
1.3 Support selecting of Configuration
Support user setting Element Type (if no specific element type is required)
Support browsing under All Containers and Configurations
11-aug-2000 Lucas Jellema
1.1 Support query for undefined type
10-aug-2000 Lucas Jellema
1.0 Initial Creation to support ODWAGRPH
*****************************************************************************************/
--
-- private constants
--
REVISION_LABEL constant varchar2(30) := '$x.y:: 1.10 $';
PACKAGE_NAME constant varchar2(30) := 'ODWAROBS';
procedure js_invoke_robs
( p_type_id in number
, p_form_name in varchar2 -- name of the Form that
-- * will hold value of the selected properties
-- * must be submitted to confirm and apply the selection
-- this form should contain the following (hidden?) fields
-- irid, ivid
, p_ivid_field in varchar2 -- name of the Form-item that will hold the ivid value
, p_irid_field in varchar2 default null -- name of the Form-item that will hold the irid value
, p_function_name in varchar2 default 'invokeRobs'
, p_auto_close in varchar2 default 'Y'
, p_workarea_irid in number default null
, p_folder_ivid in number default null
, p_cfg_ivid in number default null
, p_search_type_id in number default null
, p_wa_field in varchar2 -- name of the Form-item that will hold the workarea irid
, p_cfg_field in varchar2 default null -- name of the Form-item that will hold the cfg_ivid
, p_fol_allowed in varchar2 default 'N' -- indicates whether ( if p_type_id is null) Folders are allowed to be selected
) is
begin
htp.p('
');
end; -- js_invoke_robs
/*
// window2=open
// ( ''odwarobs.robSelector?p_type_id='||to_char(p_type_id)
// ||chr(38)||'p_form_name='||p_form_name
// ||''''
// ||', ''robsWindow''
// , ''scrollbars=auto, width=200, height=10, screenX=120''
// +'', screenY=100, resizable=yes, toolbar=no, location=no,directories=no''
// +'', status=no, menubar=no''
// );
*/
function derive_mode
( p_mode in varchar2 default null -- WA, CFG, FOL
, p_folder_ivid in varchar2 default null
, p_cfg_ivid in varchar2 default null
, p_workarea_irid in varchar2 default null
) return varchar2
is
l_mode varchar2(10):= p_mode;
begin
if l_mode is null
then
if p_workarea_irid is not null
then
l_mode:= 'WA';
elsif p_cfg_ivid is not null
then
l_mode:= 'CFG';
elsif p_folder_ivid is not null
then
l_mode:= 'FOL';
end if;
if p_folder_ivid is not null
then
l_mode:= l_mode||'FOL';
end if;
end if;
return l_mode;
end; --derive_mode
procedure headerFrame
( p_mode in varchar2 default null -- WA, CFG, FOL
, p_folder_ivid in varchar2 default null
, p_cfg_ivid in varchar2 default null
, p_workarea_irid in varchar2 default null
) is
l_parent_folder_irid number(38);
l_mode varchar2(10):= derive_mode( p_mode , p_folder_ivid, p_cfg_ivid, p_workarea_irid);
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_package_name => PACKAGE_NAME
, p_procedure_name=> 'headerFrame'
);
htp.htmlOpen;
htp.headOpen;
cdwp.write_about(package_name, revision_label);
htp.headClose;
htp.bodyOpen
( cattributes=>'BGCOLOR="#CCCCCC" '
--||' onLoad="alert(''p_workarea_irid='||p_workarea_irid||''')"'
);
cdwp.tableOpen;
cdwp.tableRowOpen;
-- Write Context:
cdwp.tableDataValue
( ''
||cdwpbase.ifThenElse
( l_mode in ('CFG','CFGR', 'CFGFOL')
, cdwp.add_images( '{configuration.gif}')
||cdwpbase.get_cfg_name( p_cfg_ivid => to_number( p_cfg_ivid), p_format => 'VLABEL')
||cdwpbase.nbsp(3)
, cdwpbase.ifThenElse
( l_mode in ('WA','WAR', 'WAFOL')
, cdwp.add_images( '{workarea.gif}')
||cdwpbase.get_wa_name( p_wa_irid => to_number( p_workarea_irid))
||cdwpbase.nbsp(3)
)
)
||cdwpbase.ifThenElse
( p_folder_ivid is not null
, cdwp.add_images( '{folder.gif}')
||jr_name.get_path( id=> to_number(p_folder_ivid), format => 'VLABEL')
)
||''
, p_width => 400
, p_attributes => 'BGCOLOR="#FFFFFF"'
);
if l_mode is not null
then
htp.p('
');
end if;
cdwp.tableRowClose;
cdwp.tableClose;
htp.bodyClose;
htp.htmlClose;
end; -- headerFrame
procedure robSelector
( p_type_id in number
, p_mode in varchar2 default null -- WA, CFG, FOL
, p_folder_ivid in varchar2 default null
, p_cfg_ivid in varchar2 default null
, p_workarea_irid in varchar2 default null
, p_ivid in varchar2 default null
, p_irid in varchar2 default null
, p_search_type_id in varchar2 default null -- if p_type_id IS NULL, then the user is allowed to select any type he/she likes
-- to make searching easier, he may want to select a specific type; that type
-- is passed in p_search_type_id; this parameter is ignored if p_type_id has a value!
, p_fol_allowed in varchar2 default 'N' -- indicates whether ( if p_type_id is null) Folders are allowed to be selected
) is
type t_robs_tbl
is table of varchar2(8000)
index by binary_integer;
c_column_height number(2):=13;
l_robs_tbl t_robs_tbl;
l_ctr number(10):=0;
l_parent_folder_irid number(38);
l_mode varchar2(10):= derive_mode( p_mode , p_folder_ivid, p_cfg_ivid, p_workarea_irid);
-- loads the l_rob_tbl
procedure load_robs_table
( p_folder_ivid in number
, p_cfg_ivid in number
, p_workarea_irid in number
, p_type_id in number
) is
l_icon varchar2(200);
l_where varchar2(3000); -- to hold the additional where clause to look for BR, FUN and BRDD
cursor c_wa
is
select wa.irid
, wa.OWNER
, wa.NAME
, wa.KIND
, wa.DESCRIPTION
from sdd_workareas wa
order
by wa.name
;
cursor c_cfg
is
select cfg.IRID
, cfg.IVID
, cfg.NAME
, cfg.DESCRIPTION
, ov.vlabel
, nvl(ov.state, 'N') state
from sdd_configurations cfg
, sdd_object_versions ov
where ov.ivid = cfg.ivid
order
by cfg.name
, ov.branch_id -- to at least group by branch; probably need name of branch as well
, ov.sequence_in_branch
;
cursor c_root_fol
is
select
app.irid
, app.ivid
, app.name
, 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_fol (b_folder_ivid in number)
is
select
app.ivid
, app.irid
, app.name
, decode
( app.types
, 4844, 'FOL'
, 5009, 'APP'
, 'CNT') app_type
, ov.state
, ov.vlabel
from sdd_folders app
, sdd_folder_members fm
, sdd_object_versions ov
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 c_folder_contents_in_wa( b_folder_ivid in number)
is
select E.irid
, E.ivid
, E.vlabel
, E.state
, E.logical_type_id
-- , jr_name.get_Path_no_context(E.ivid, 'MAIN','NAME')
, E.NAME
from I$SDD_OBJECT_VERSIONS E
, sdd_folder_members mem
, i$sdd_wa_context wac
Where E.wastebasket = jr_context.wastebasket
and wac.workarea_irid = jr_context.workarea
and wac.object_ivid = E.ivid
and mem.member_object = E.irid
and mem.parent_ivid = b_folder_ivid
order
by E.name
;
l_ctr number(10):=0;
procedure add_entry
( p_new_mode in varchar2
, p_id in number default null
, p_ivid in number default null
, p_gif in varchar2 default null
, p_text in varchar2 default null
, p_type in varchar2 default 'drill' -- values: drill, select
) is
begin
l_ctr:= l_ctr + 1;
if p_type = 'drill'
then
l_robs_tbl(l_ctr):= ''
||cdwpbase.ifThenElse
( p_gif is not null
, cdwp.add_images('{'||p_gif||'}')
)
||''
||replace(p_text,' ',' ')
||''
||''
;
elsif p_type = 'drillselect'
then
l_robs_tbl(l_ctr):=
''
||cdwpbase.ifThenElse
( p_gif is not null
, cdwp.add_images('{'||p_gif||'}', p_attributes => 'ALT="Select"')
)
||''
||''
||replace(p_text,' ',' ')
||''
||''
;
elsif p_type = 'select'
then
l_robs_tbl(l_ctr):= ''
||cdwpbase.ifThenElse
( p_gif is not null
, cdwp.add_images('{'||p_gif||'}')
)
||''
||replace(p_text,' ',' ')
||''
||''
;
else
l_robs_tbl(l_ctr):=
cdwpbase.ifThenElse
( p_gif is not null
, cdwp.add_images('{'||p_gif||'}')
)
||''
||replace(p_text,' ',' ')
||''
;
end if; -- p_type = 'drill'
end; -- add_entry
begin
-- modes:
-- null -> top level; show labels: Workareas, Configurations, All Containers
-- WA -> p_workarea_irid is null: show Workareas
-- WAR -> p_workarea_irid is not null: show Top Folders in Workarea
-- WAFOL-> show nested folders in p_folder_ivid + elements of indicated type
-- CFG -> p_cfg_ivid is null -> show all Configurations
-- CFGR -> p_cfg_ivid is not null -> show top folders in Configuration + parentless members of indicated type
-- CFGFOL -> p_folder_ivid is not null -> show nested folders + members of indicated type
-- FOL -> p_folder_ivid is null -> show top folders in repository
-- FOLFOL-> p_folder_ivid is not null -> show nested folders + members of indicated type
-- BRANCH -> p_branch_irid is null -> show all branches
-- Branch -> p_branch_irid is not null -> show all objects on branch
l_icon:= cdwpbase.get_icon( p_type_id => p_type_id);
if l_mode is null
then
add_entry( p_new_mode => 'WA', p_gif => 'workarea.gif', p_text => Rob_msg.GetMsg(Rob_msg.DSP181_ODWA_WAS,'','','',''));
add_entry( p_new_mode => 'CFG', p_gif => 'configuration.gif', p_text => Rob_msg.GetMsg(Rob_msg.DSP176_ODWA_CONFIG,'','','',''));
add_entry( p_new_mode => 'FOL', p_gif => 'AllFolders.gif', p_text => Rob_msg.GetMsg(Rob_msg.DSP183_ODWA_ALLFOLDERS,'','','',''));
elsif l_mode ='WA'
then -- load Workarea Names
for r_wa in c_wa loop
add_entry( p_new_mode => 'WAR', p_id => r_wa.irid, p_gif => 'workarea.gif', p_text => r_wa.name);
end loop; -- r_wa
elsif l_mode='WAR'
then
jr_context.set_workarea( to_number(p_workarea_irid));
for r_root_fol in c_root_fol loop
add_entry
( p_new_mode => 'WAFOL'
, p_id => r_root_fol.irid
, p_ivid => r_root_fol.ivid
, p_gif => cdwpbase.ifThenElse
( r_root_fol.app_type = 'APP'
, 'app_sys.gif'
, 'folder.gif'
)
, p_text => r_root_fol.name
, p_type => cdwpbase.ifThenElse ----but what if type is container/folder/app?
( nvl(p_type_id,-1) in (4844, 5009, 4845 )
or
p_fol_allowed ='Y'
, 'drillselect'
, 'drill'
)
);
end loop; -- r_root_fol
elsif l_mode ='WAFOL'
then -- load Workarea Names
jr_context.set_workarea( p_workarea_irid);
for r_nested_fol in c_nested_fol(b_folder_ivid => p_folder_ivid) loop
add_entry
( p_new_mode => 'WAFOL'
, p_id => r_nested_fol.irid
, p_ivid => r_nested_fol.ivid
, p_gif => cdwpbase.ifThenElse
( r_nested_fol.app_type = 'APP'
, 'app_sys.gif'
, 'folder.gif'
)
, p_text => r_nested_fol.name
, p_type => cdwpbase.ifThenElse ----but what if type is container/folder/app?
( nvl(p_type_id,-1) in (4844, 5009, 4845 )
or
p_fol_allowed ='Y'
, 'drillselect'
, 'drill'
)
);
end loop; -- r_nested_fol
elsif l_mode ='CFG'
then -- load Configuraton Names
for r_cfg in c_cfg loop
add_entry
( p_new_mode => 'CFGR'
, p_id => r_cfg.irid
, p_ivid => r_cfg.ivid
, p_gif => 'configuration.gif'
, p_text => r_cfg.name||' {'||r_cfg.vlabel||'}'
, p_type => cdwpbase.ifThenElse ----but what if type is configuration
( p_type_id = 384781276385787681422765648005056569
, 'drillselect'
, 'drill'
)
);
end loop; -- r_cfg
elsif l_mode ='FOL'
then -- load Root folders in configuration
for r_root_fol in odwa_fol.c_root_app loop
add_entry
( p_new_mode => 'FOLFOL'
, p_id => r_root_fol.app_id
, p_ivid => r_root_fol.app_ivid
, p_gif => cdwpbase.ifThenElse
( r_root_fol.app_type = 'APP'
, 'app_sys.gif'
, 'folder.gif'
)
, p_text => r_root_fol.app_name
||' ('||r_root_fol.vlabel||')'
, p_type => cdwpbase.ifThenElse ----but what if type is container/folder/app?
( nvl(p_type_id,-1) in (4844, 5009, 4845 )
or
p_fol_allowed ='Y'
, 'drillselect'
, 'drill'
)
);
end loop; -- r_root_fol
elsif l_mode ='CFGR'
then -- load Root folders in configuration
for r_cfg_root in odwa_fol.c_root_in_cfg( b_cfg_ivid => p_cfg_ivid) loop
add_entry
( p_new_mode => 'CFGFOL'
, p_id => r_cfg_root.app_id
, p_ivid => r_cfg_root.app_ivid
, p_gif => cdwpbase.ifThenElse
( r_cfg_root.app_type = 'APP'
, 'app_sys.gif'
, 'folder.gif'
)
, p_text => r_cfg_root.app_name
||' ('||r_cfg_root.vlabel||')'
, p_type => cdwpbase.ifThenElse ----but what if type is container/folder/app?
( p_type_id in (4844, 5009, 4845 )
, 'drillselect'
, 'drill'
)
);
end loop; -- r_cfg_root
elsif l_mode ='CFGFOL'
then
for r_nested_fol in odwa_fol.c_nested_apps_in_cfg
( b_folder_ivid => p_folder_ivid
, b_cfg_ivid => p_cfg_ivid
) loop
add_entry
( p_new_mode => 'CFGFOL'
, p_id => r_nested_fol.app_id
, p_ivid => r_nested_fol.app_ivid
, p_gif => cdwpbase.ifThenElse
( r_nested_fol.app_type = 'APP'
, 'app_sys.gif'
, 'folder.gif'
)
, p_text => r_nested_fol.app_name
||' ('||r_nested_fol.vlabel||')'
, p_type => cdwpbase.ifThenElse ----but what if type is container/folder/app?
( nvl(p_type_id,-1) in (4844, 5009, 4845 )
or
p_fol_allowed ='Y'
, 'drillselect'
, 'drill'
)
);
end loop; -- r_nested_fol
elsif l_mode ='FOLFOL'
then
for r_nested_fol in odwa_fol.c_nested_apps
( b_folder_ivid => p_folder_ivid
) loop
add_entry
( p_new_mode => 'FOLFOL'
, p_id => r_nested_fol.app_id
, p_ivid => r_nested_fol.app_ivid
, p_gif => cdwpbase.ifThenElse
( r_nested_fol.app_type = 'APP'
, 'app_sys.gif'
, 'folder.gif'
)
, p_text => r_nested_fol.app_name
||' ('||r_nested_fol.vlabel||')'
, p_type => cdwpbase.ifThenElse ----but what if type is container/folder/app?
( nvl(p_type_id,-1) in (4844, 5009, 4845 )
or
p_fol_allowed ='Y'
, 'drillselect'
, 'drill'
)
);
end loop; -- r_nested_fol
end if; -- l_mode is null
if l_mode in ('CFGFOL' , 'FOLFOL', 'WAFOL')
then
if nvl(p_type_id, -1) not in (4844, 5009, 4845 ) -- Folder, Application System and Container
then
if p_type_id = -4907 -- BRDD
then
l_where :=
' exists (select 1
from cdi_text
where txt_ref = ci.id
and txt_type = ''CDINOT''
and txt_text like ''%%''
and parent_ivid = ci.ivid
) ';
elsif p_type_id = -5024 -- BR
then
l_where :=
' cdwp_chk_fun_is_business_rule
( ci.id
, ci.function_label
, ci.function_type ) = ''Y''
';
elsif p_type_id = 5024 -- FUN
then
l_where :=
' cdwp_chk_fun_is_business_rule
( ci.id
, ci.function_label
, ci.function_type ) = ''N''
';
end if; -- p_type_id = -4907 -- BRDD
odwasrch.runSearch
( qWorkareaIrid => p_workarea_irid ---- should be null for l_mode = FOLFOL, CFGFOL
, qFolderIrid => null
, qFolderIvid => p_folder_ivid
, qIncludeNested => null -- 'Y' to perform recursive search in child folders
, qElementType => abs(p_type_id) -- to cater for -4907 and -5024 (BRDD and BR)
, qTipVersionsOnly => cdwpbase.ifThenElse( l_mode = 'FOLFOL', 'Y')
, qCfgIrid => null
, qCfgIvid => p_cfg_ivid -- should be null for l_mode = FOLFOL, WAFOL
, qWhere => l_where
, p_enforce_acc_privs => false -- improve performance; assume only folders on which the user has SEL are queried
);
if odwasrch.g_ividTab.count > 0 and odwasrch.g_ividTab(1) > 0
then
for i in 1..odwasrch.g_ividTab.count loop
--B2636982: Show only valid objects
if not odwavrsn.is_in_wastebasket(p_ivid => odwasrch.g_ividtab(i)) then
add_entry
( p_new_mode => l_mode
, p_id => odwasrch.g_iridTab(i)
, p_ivid => odwasrch.g_ividTab(i)
, p_gif => nvl( l_icon, cdwpbase.get_icon( p_type_id => odwasrch.g_typeTab(i )))
, p_text => odwasrch.g_nameTab(i)
||cdwpbase.ifThenElse
( odwasrch.g_vlabelTab(i) is not null
, ' ('||odwasrch.g_vlabelTab(i)||')'
)
, p_type => 'select'
);
end if;
end loop; -- i in 1..g_iridTAB.count
end if; -- odwasrch.g_ividTab.count > 0 and odwasrch.g_ividTab(1) > 0
end if; -- p_type not in (4844,4845, 5009)
end if; -- if l_mode in ('CFGFOL', 'FOLFOL')
end; -- load_robs_table
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_package_name => PACKAGE_NAME
, p_procedure_name=> 'robSelector'
);
load_robs_table
( p_folder_ivid => to_number(p_folder_ivid)
, p_cfg_ivid => to_number(p_cfg_ivid)
, p_workarea_irid => to_number(p_workarea_irid)
, p_type_id => nvl( p_type_id
, cdwpbase.ifThenElse
( nvl(p_search_type_id,'null') = 'null'
, null
, to_number( p_search_type_id)
)
)
);
htp.htmlOpen;
htp.headOpen;
cdwp.write_about(package_name, revision_label);
htp.p('');
htp.headClose;
htp.bodyOpen
( cattributes=>'BGCOLOR="#FFFFFF" '
--||' onLoad="alert(''p_workarea_irid='||p_workarea_irid||''')"'
);
htp.formopen
( curl => 'odwarobs.robSelector'
, cmethod => 'POST'
, cattributes => 'NAME="robsForm" '
, ctarget => ''
);
htp.p
( ' '
);
htp.p
( ' '
);
htp.p
( ' '
);
htp.p
( ' '
);
htp.p
( ' '
);
htp.p
( ' '
);
htp.p
( ' '
);
htp.p
( ' '
);
htp.p
( ' '
);
/*
-------------------------------------------------------------
| Folder Up/ To Root
----------------------------------------------
| icon- Folder 1 (link) icon- object 3 icon- object 8
| icon- Folder 2 (link) icon- object 4 icon- object 9
| icon- Folder 3 (link) icon- object 5
| icon- object 1 icon- object 6
| icon- object 2 icon- object 7
|--------------------------------
| Element Type : Files
| Currently Selected: OK CANCEL
|_____________________________________________
single click on element: Currenty Selected is updated
double Click on element: clicked element into form and submit
*/
htp.p
( '
'
);
-- now loop over the current contents and display URL (icon+name)
l_ctr:=1;
htp.p('
');
loop
if l_ctr > l_robs_tbl.count
then
exit;
end if;
htp.p( l_robs_tbl(l_ctr)||' ');
if mod(l_ctr, c_column_height) = 0 -- next column
then
htp.p(' '||cdwpbase.nbsp(18)||'
'); -- the nbsp to guarantee a minimum width
end if;
l_ctr:= l_ctr+1;
end loop;
htp.p(' '||cdwpbase.nbsp(18)||'
');
-- to have at least 3 columns
for i in ceil(l_ctr/c_column_height)..3 loop
htp.p('
'||cdwpbase.nbsp(1)||'
');
end loop;
htp.p
('
');
htp.formClose;
htp.bodyClose;
htp.htmlClose;
end; -- robSelector
procedure controlFrame
( p_type_id in number
, p_mode in varchar2 default null -- WA, CFG, FOL
, p_folder_ivid in varchar2 default null
, p_cfg_ivid in varchar2 default null
, p_workarea_irid in varchar2 default null
, p_ivid in varchar2 default null
, p_irid in varchar2 default null
, p_search_type_id in varchar2 default null -- if p_type_id IS NULL, then the user is allowed to select any type he/she likes
-- to make searching easier, he may want to select a specific type; that type
-- is passed in p_search_type_id; this parameter is ignored if p_type_id has a value!
) is
l_parent_folder_irid number(38);
l_cdm_used varchar2(1);
cursor c_ete
is
select net.nls_name name
, et.id irid
, et.ivid
from ci_element_types cet
, rm_element_types et
, rm$nls_element_types net
, rm_repositories rep
where cet.short_name = et.short_name
and net.nls_language = rep.nls_language
and net.etid = et.irid
and supertype in ('SHR', 'NSHR')
and et.product = 'CI'
and et.abstract = 'N'
and exists (
select null
from ck_product_elements pe
where pe.element_name = et.name
and pe.product_code = 'DESIGN'
)
and et.irid not in (5052, 5055) -- filter out the element types that cannot truly serve as PAC
-- Specific MCO and LOV
union
select 'Folder', 4844, 1 from dual
union
select 'Application System', 5009, 1 from dual
union -- User Extended Types
select net.nls_name name
, et.id irid
, et.ivid
from rm_element_types et
, rm$nls_element_types net
, rm_repositories rep
where net.etid = et.irid
and net.nls_language = rep.nls_language
and et.product = 'CI'
and et.abstract = 'N'
and et.user_extension = 'YYY'
order
by 1
;
cursor c_ov (b_irid in number)
is
select ov.ivid
, ov.STATE
, decode
( ov.STATE
, 'O', 'Checked Out'
, 'I', 'Checked In'
, 'N', 'Unversioned'
, 'Unknown State'
) check_state
, ov.WASTEBASKET
, ov.DATE_CREATED -- check out date?
, ov.DATE_CHANGED
, ov.VLABEL
, ov.BRANCH_ID
, ov.SEQUENCE_IN_BRANCH
, ov.LOGICAL_TYPE_ID
, brh.name branch_name
from i$sdd_object_versions ov
, sdd_branches brh
where ov.irid = b_irid
and brh.branch_id(+) = ov.branch_id
order
by brh.name
, ov.sequence_in_branch
;
begin
l_cdm_used := odwapref.get_value('use_cdm');
-- 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_package_name => PACKAGE_NAME
, p_procedure_name=> 'controlFrame'
);
htp.htmlOpen;
htp.headOpen;
cdwp.write_about(package_name, revision_label);
odwahelp.js_invoke_help;
htp.headClose;
htp.bodyOpen
( cattributes=>'BGCOLOR="#CCCCCC" '
--||' onLoad="alert(''p_workarea_irid='||p_workarea_irid||''')"'
);
-- Form = robDisplay;
-- Items: elementType
-- selected
-- version
htp.formopen
( curl => 'odwarobs.controlFrame'
, cmethod => 'GET'
, cattributes => 'NAME="robsDisplay" '
, ctarget => ''
);
cdwp.tableopen;
cdwp.tableRowOpen;
htp.p
( '
'||Rob_msg.GetMsg(Rob_msg.CAP217_ODWAROBS_ELTYPE,'','','','')||''
||cdwpbase.nbsp(4)
);
if p_type_id is not null -- a specifc element type is REQUIRED
then
htp.p
( cdwp.add_images( '{'||cdwpbase.get_icon(p_type_id)||'}')
||cdwpbase.get_nls_type_name(p_type_id)
);
else
htp.formselectopen
( cname => 'elementType'
, cprompt => ''
, cattributes => 'onChange="parent.listFrame.document.robsForm.p_search_type_id.value=
document.robsDisplay.elementType.options[document.robsDisplay.elementType.selectedIndex].value;'
||'parent.listFrame.document.robsForm.submit();'
||'return true;"'
);
htp.p
( '
');
end if;-- not unversioned
-- 1.7 only show VHV icon if an object is currently selected
if p_ivid is not null
then
htp.tableData
( htf.anchor2
( 'odwavrsn.vhv'
||'?p_ivid='||p_ivid
, ctext => cdwp.add_images
( p_text => '{versiontree.gif}'
, p_attributes=> 'alt="'||Rob_msg.GetMsg(Rob_msg.DSP319_ODWAROBS_VERHIST,'','','','')||'"'
)
,ctarget => '_NEW'
)
);
end if; -- p_ivid is not null
cdwp.tableRowClose;
cdwp.tableClose;
htp.formClose;
htp.p
( ''
);
htp.bodyClose;
htp.htmlClose;
end; -- controlFrame
procedure js_submit_robs
( p_form_name in varchar2 -- name of the Form that
-- * will hold value of the selected properties
-- * must be submitted to confirm and apply the selection
, p_ivid_field in varchar2 -- name of the Form-item that will hold the ivid value
, p_irid_field in varchar2 -- name of the Form-item that will hold the irid value
, p_auto_close in varchar2 default 'Y'
, p_wa_field in varchar2 default null -- name of the Form-item that will hold the workarea irid
, p_cfg_field in varchar2 default null -- name of the Form-item that will hold the cfg_ivid
) is
begin
htp.p('
');
end; -- js_submit_robs
-- Repository Object Browser
-- -------------------------------
-- | headerFrame |
-- | |
-- | |
-- |-----------------------------|
-- | |
-- | listFrame |
-- | |
-- |-----------------------------|
-- | |
-- | controlFrame |
-- | |
-- -------------------------------
--
--
procedure rob
( p_type_id in number
, p_form_name in varchar2 -- name of the Form that
-- * will hold value of the selected properties
-- * must be submitted to confirm and apply the selection
-- this form should contain the following (hidden?) fields
-- irid, ivid
, p_ivid_field in varchar2 -- name of the Form-item that will hold the ivid value
, p_irid_field in varchar2 -- name of the Form-item that will hold the irid value
, p_mode in varchar2 default null -- WA, CFG, FOL
, p_folder_ivid in varchar2 default null
, p_cfg_ivid in varchar2 default null
, p_workarea_irid in varchar2 default null
, p_ivid in varchar2 default null
, p_irid in varchar2 default null
, p_search_type_id in varchar2 default null -- if p_type_id IS NULL, then the user is allowed to select any type he/she likes
-- to make searching easier, he may want to select a specific type; that type
-- is passed in p_search_type_id; this parameter is ignored if p_type_id has a value!
, p_auto_close in varchar2 default 'Y'
, p_wa_field in varchar2 default null-- name of the Form-item that will hold the workarea irid
, p_cfg_field in varchar2 default null -- name of the Form-item that will hold the cfg_ivid
, p_fol_allowed in varchar2 default 'N' -- indicates whether ( if p_type_id is null) Folders are allowed to be selected
) is
--- if an element is selected, we can derive the folder_ivid from the owning container and the given
-- context (provided the folder_ivid in the context does indeed contain the chosen object)
l_folder_ivid number(38):= nvl( p_folder_ivid
, cdwpbase.ifThenElse
( p_ivid is not null
, cdwpbase.get_ivid
( p_irid => jr_acc_rights.get_owning_container
( obj_irid => cdwpbase.get_irid
( p_ivid=> p_ivid)
)
, p_cfg_id => p_cfg_ivid
, p_wa_id => p_workarea_irid
)
)
);
l_mode varchar2(10):= derive_mode( p_mode , l_folder_ivid, p_cfg_ivid, p_workarea_irid);
begin
htp.htmlOpen;
htp.headOpen;
cdwp.write_about(package_name, revision_label);
htp.title(Rob_msg.GetMsg(Rob_msg.DSP321_ODWAROBS_ROS ,'','','',''));
js_submit_robs
( p_form_name => p_form_name
, p_ivid_field=> p_ivid_field
, p_irid_field=> p_irid_field
, p_auto_close=> p_auto_close
, p_wa_field => p_wa_field
, p_cfg_field => p_cfg_field
);
odwasrch.js_invoke_search
( p_session_id => odwactxt.get_session_id
, p_type_id => nvl( to_char(p_type_id), '''+listFrame.document.robsForm.p_search_type_id.value+''')
, p_wa_id => '''+listFrame.document.robsForm.p_workarea_irid.value+'''
, p_cfg_id => '''+listFrame.document.robsForm.p_cfg_ivid.value+'''
, p_folder_ivid => '''+listFrame.document.robsForm.p_folder_ivid.value+'''
, p_js_selected => '{p_form_name='||p_form_name||'}'
||'{p_ivid_field='||p_ivid_field||'}'
||'{p_irid_field='||p_irid_field||'}'
, p_function_name => 'invokeSearch'
);
htp.headClose;
htp.framesetopen
( crows => '10%, 60%,30%'
, cattributes => 'BORDER="1" LONGDESC=odwahelp.rightSide?p_session_id=&p_him_id=401 TITLE="'
||Rob_msg.Getmsg(rob_msg.CAP072_ODWA_OB,'','','','')||'"'
);
htp.frame
( csrc => 'odwarobs.headerFrame?p_mode='||l_mode
||chr(38)||'p_folder_ivid='||l_folder_ivid
||chr(38)||'p_cfg_ivid='||p_cfg_ivid
||chr(38)||'p_workarea_irid='||p_workarea_irid
, cname=> 'headerFrame'
, cattributes => 'LONGDESC=odwahelp.rightSide?p_session_id=&p_him_id=401 TITLE="'
||Rob_msg.Getmsg(rob_msg.CAP072_ODWA_OB,'','','','')||'"'
);
htp.frame
( csrc => 'odwarobs.robSelector?p_type_id='||to_char(p_type_id)
||chr(38)||'p_mode='||l_mode
||chr(38)||'p_folder_ivid='||l_folder_ivid
||chr(38)||'p_cfg_ivid='||p_cfg_ivid
||chr(38)||'p_workarea_irid='||p_workarea_irid
||chr(38)||'p_ivid='||p_ivid
||chr(38)||'p_irid='||p_irid
||chr(38)||'p_search_type_id='||p_search_type_id
||chr(38)||'p_fol_allowed='||p_fol_allowed
, cname=> 'listFrame'
, cattributes => 'LONGDESC=odwahelp.rightSide?p_session_id=&p_him_id=401 TITLE="'
||Rob_msg.Getmsg(rob_msg.CAP072_ODWA_OB,'','','','')||'"'
);
htp.frame
( csrc => 'odwarobs.controlFrame?p_type_id='||to_char(p_type_id)
||chr(38)||'p_mode='||l_mode
||chr(38)||'p_folder_ivid='||l_folder_ivid
||chr(38)||'p_cfg_ivid='||p_cfg_ivid
||chr(38)||'p_workarea_irid='||p_workarea_irid
||chr(38)||'p_ivid='||p_ivid
||chr(38)||'p_irid='||p_irid
||chr(38)||'p_search_type_id='||p_search_type_id
, cname=> 'controlFrame'
, cattributes =>' LONGDESC=odwahelp.rightSide?p_session_id=&p_him_id=401 TITLE="'
||Rob_msg.Getmsg(rob_msg.CAP072_ODWA_OB,'','','','')||'"'
);
htp.framesetclose;
htp.bodyClose;
htp.htmlClose;
end; -- rob
begin
null;
end; -- odwarobs
/