# TGsys.cfg: Manages Operating System Target Definitions # # $Id: TGsys.cfg,v 1.3 2013/10/30 07:18:47 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/RDA/TGsys.cfg,v 1.3 2013/10/30 07:18:47 RDA Exp $ # # Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. # # Change History # 20130422 MSC Improve the validation. #------------------------------------------------------------------------------ # Module definition #------------------------------------------------------------------------------ dsc='Manages Operating System Target Definitions' var=select_command exe=sdcl { "macro is_unique "{var ($cur,$ttl) = @arg " " loop $itm ($[COL]->get_items('SYS')) " {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 an operating system target #------------------------------------------------------------------------------ [do_define] typ=B dft=${T_ADMIN_VALUE} nam=- var=true:W_CLASS,B_DEDICATED,T_TITLE,set_ccr_home exe=sdcl { "var $cnt = undef } [W_CLASS] typ=T def=${T_ADMIN_VALUE} dft='SYS' dsc='Target type' [B_DEDICATED] typ=B opt=true def=${T_ADMIN_VALUE} dft=${RUN.CLASS.SYS.B_DEDICATED} dsc='Is it a dedicated target?' [T_TITLE] typ=T def=${T_ADMIN_VALUE} dft=${RUN.CLASS.SYS.T_TITLE:${CUR.W_MODULE}} dsc='Operating system target description' err='Duplicate description' inp='Enter the operating system target description' ref=is_unique(${CUR.K_MODULE},last) val=E [set_ccr_home] typ=D def=${T_ADMIN_VALUE} dft=getNativePath(${RUN.CLASS.SYS.D_CCR_HOME:${D_CCR_HOME}}) dsc='Oracle Configuration Manager home' nam=D_CCR_HOME opt=true val=E var=exists:set_ccr_setup,set_ccr_run [set_ccr_setup] typ=T def=${T_ADMIN_VALUE} dft=cond(testFile('f',catFile(${D_CCR_HOME},'bin',${AS.BATCH:'emCCR'})),\ 'done','skip') dsc='Oracle Configuration Manager setup status' nam=S_CCR_SETUP [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 an operating system target #------------------------------------------------------------------------------ [do_edit] typ=M add=('R|Return to the previous menu|-|-') aft='\040' bef='Edit an operating system target:' cas=false dft=(@{T_ADMIN_VALUE}) dsc='Edit an operating system 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,@mnu,@rsp) = (0) " loop $itm ($[COL]->get_items('SYS')) " {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 an operating system target #------------------------------------------------------------------------------ [do_select] typ=M aft='\040' alt=add_target,do_define,do_select ask=true cas=false dft=(@{T_ADMIN_VALUE}) dsc='Select an operating system 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,@rsp) = (0) " if ${B_ADMIN_END} " {loop $itm ($[COL]->get_items('SYS')) " {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('SYS')) " {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 operating system target|+|-') "if $cnt " call push(@add,'E|Edit an operating system target|-|-') "if ${B_ADMIN_END} "{if $cnt " call unshift(@add,'A|All operating system targets|*|-') " call push(@add,'N|No operating system targets|.|-') " var ${AUX.bef} = ${T_ADMIN_BEFORE:'Select an operating system target list:'} " var ${AUX.opt} = false " var ${AUX.pck} = true "} "else "{var ${AUX.bef} = ${T_ADMIN_BEFORE:'Select an operating system 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.SYS:${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