# TGoh.cfg: Manages Middleware Home Target Definitions # # $Id: TGmh.cfg,v 1.5 2013/11/20 11:57:13 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/RDA/TGmh.cfg,v 1.5 2013/11/20 11:57:13 RDA Exp $ # # Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. # # Change History # 20131120 MSC Improve description. #------------------------------------------------------------------------------ # Module definition #------------------------------------------------------------------------------ dsc='Manages Middleware Home Target Definitions' use=Xml var=select_command exe=sdcl { "macro is_unique "{var ($cur,$ttl) = @arg " " loop $itm ($[COL]->get_items('MH')) " {if and(compare('eq',$ttl,$itm->get_first('T_TITLE')),\ " compare('ne',$cur,$itm->get_path)) " return false " } " return true "} } #------------------------------------------------------------------------------ # Setting definitions #------------------------------------------------------------------------------ [select_command] typ=T dft=${W_ADMIN_COMMAND} dsc='Select the administration action' nam=- var=define:do_define:\ edit: do_edit:\ select:do_select #------------------------------------------------------------------------------ # Define a Middleware home target #------------------------------------------------------------------------------ [do_define] typ=B dft=${T_ADMIN_VALUE} nam=- var=true:W_CLASS,B_DEDICATED,D_MW_HOME exe=sdcl { "var $cnt = undef } [W_CLASS] typ=T def=${T_ADMIN_VALUE} dft='MH' dsc='Target type' [B_DEDICATED] typ=B def=${T_ADMIN_VALUE} dft=${RUN.CLASS.MH.B_DEDICATED} dsc='Is it a dedicated target?' opt=true [D_MW_HOME] typ=D def=${T_ADMIN_VALUE} dft=(${RUN.CLASS.MH.D_MW_HOME},\ ${CTX.D_MW_HOME:\ cleanPath([${ENV.ORACLE_HOME:''},upDir(),''],true)}) dsc='Middleware home' err='Warning: The specified directory does not -yet- exist' fmt='<$dir})) } [set_ccr_setup] typ=T def=${T_ADMIN_VALUE} dsc='Oracle Configuration Manager setup status' nam=S_CCR_SETUP var=done:set_ccr_run exe=sdcl { "var ${D_CCR_HOME} = undef "var $hom = catDir(${D_MW_HOME}) "var $sta = 'skip' "if ?nvl(testDir('d',catDir($hom,'oracle_common','ccr')),\ " testDir('d',catDir($hom,'utils','ccr'))) "{var $ccr = last " if ?testFile('f',catFile($ccr,'bin',${AS.BATCH:'emCCR'})) " var ($sta,${D_CCR_HOME:'Oracle Configuration Manager home'},\ " ${W_CCR_SETUP}) = \ " ('done',getNativePath($ccr)) " elsif ?testFile('f',catFile($ccr,'bin',${AS.EXE:'setupCCR'})) " {if grepDir(catDir($ccr,'inventory','pending'),'\.jar$','i') " var ($sta,${D_CCR_HOME:'Oracle Configuration Manager home'}) = \ " ('pending',getNativePath($ccr)) " } "} "var ${AUX.dft} = $sta } [set_ccr_run] typ=T def=${T_ADMIN_VALUE} dsc='Oracle Configuration Manager execution status' nam=S_CCR_RUN exe=sdcl { "var $ccr = catDir(${D_CCR_HOME}) "var $sta = 'skip' "var ${D_CCR_CONFIG} = undef "if ?testDir('d',catDir($ccr,'hosts')) "{if ?nvl(testDir('d',catDir($ccr,'hosts',${RDA.T_HOST})),\ " testDir('d',catDir($ccr,'hosts',${RDA.T_NODE}))) " var ($sta,${D_CCR_CONFIG:'Oracle Configuration Manager data'}) = \ " ('done',getNativePath(last)) "} "var ${AUX.dft} = $sta } #------------------------------------------------------------------------------ # Edit a Middleware home target #------------------------------------------------------------------------------ [do_edit] typ=M add=('R|Return to the previous menu|-|-') aft='\040' bef='Edit a Middleware home target:' cas=false dft=(@{T_ADMIN_VALUE}) dsc='Edit a Middleware home target' err='Invalid entry' inp='Enter the item number or the action letter.' nam=-T_ADMIN_VALUE val=E var=-::do_define exe=sdcl { "# Get the target list "if !?$cnt "{keep $cnt,@itm,@rsp " var ($cnt,@itm,@rsp) = (0) " loop $itm ($[COL]->get_items('MH')) " {var $pth = concat('COL/',$itm->get_path) " call push(@itm,incr($cnt),$itm->get_first('T_TITLE',$pth)) " call push(@rsp,$cnt,$pth) " } "} " "# Determine the menu items and responses "var ${AUX.itm} = [@itm] "var ${AUX.rsp} = [@rsp] } #------------------------------------------------------------------------------ # Select a Middleware home target #------------------------------------------------------------------------------ [do_select] typ=M aft='\040' alt=add_target,do_define,do_select ask=true cas=false dft=(@{T_ADMIN_VALUE}) dsc='Select a Middleware home target' nam=-T_ADMIN_VALUE val=E var=+:add_target,do_define,do_select:\ -:do_edit,do_select:\ *:all_targets:\ .:no_targets exe=sdcl { "# Get the target list "if !?$cnt "{keep $cnt,@add,@all,@itm,@mnu,@rsp " " var ($cnt,@all,@itm,@mnu,@rsp) = (0) " if ${B_ADMIN_END} " {loop $itm ($[COL]->get_items('MH')) " {next $itm->get_first('B_DEDICATED') " var $pth = concat('COL/',$itm->get_path) " call push(@itm,incr($cnt),$itm->get_first('T_TITLE',$pth)) " call push(@rsp,$cnt,$pth) " call push(@all,$pth) " call push(@mnu,$cnt) " } " } " else " {loop $itm ($[COL]->get_items('MH')) " {var $pth = concat('COL/',$itm->get_path) " call push(@itm,incr($cnt),$itm->get_first('T_TITLE',$pth)) " call push(@rsp,$cnt,$pth) " next $itm->get_first('B_DEDICATED') " call push(@mnu,$cnt) " } " } "} " "# Determine the menu items and responses "var @add = ('D|Define a new Middleware home target|+|-') "if $cnt " call push(@add,'E|Edit a Middleware home target|-|-') "if ${B_ADMIN_END} "{if $cnt " call unshift(@add,'A|All Middleware home targets|*|-') " call push(@add,'N|No Middleware home targets|.|-') " var ${AUX.bef} = ${T_ADMIN_BEFORE:'Select a Middleware home target list:'} " var ${AUX.opt} = false " var ${AUX.pck} = true "} "else "{var ${AUX.bef} = ${T_ADMIN_BEFORE:'Select a Middleware home target:'} " var ${AUX.err} = 'Invalid entry' " var ${AUX.inp} = 'Enter the item number or the action letter.' " var ${AUX.opt} = cond($cnt,false,true) "} "var ${AUX.add} = [@add] "var ${AUX.itm} = [@itm] "var ${AUX.rsp} = [@rsp] } [add_target] typ=T dft="COL/${NXT.MH:${K_ADMIN_PARENT}}" dsc='Determine the identifier for a new target' nam=-T_ADMIN_VALUE [all_targets] typ=T dft=(@all) dsc='Select all targets' end='' nam=-T_ADMIN_VALUE [no_targets] typ=T dft=() dsc='Select no targets' end='' nam=-T_ADMIN_VALUE