# TGwh.cfg: Manages Oracle WebLogic Server Home Target Definitions # # $Id: TGwh.cfg,v 1.3 2013/10/30 07:18:47 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/RDA/TGwh.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 # 20130222 MSC Improve target selection. #------------------------------------------------------------------------------ # Module definition #------------------------------------------------------------------------------ dsc='Manages Oracle WebLogic Server Home Target Definitions' var=select_command exe=sdcl { "macro is_unique "{var ($cur,$ttl) = @arg " " loop $itm ($[COL]->get_items('WH')) " {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 Oracle WebLogic Server home target #------------------------------------------------------------------------------ [do_define] typ=B dft=${T_ADMIN_VALUE} nam=- var=true:W_CLASS,B_DEDICATED,D_WL_HOME exe=sdcl { "var $cnt = undef } [W_CLASS] typ=T def=${T_ADMIN_VALUE} dft='WH' dsc='Target type' [B_DEDICATED] typ=B def=${T_ADMIN_VALUE} dft=${RUN.CLASS.WH.B_DEDICATED} dsc='Is it a dedicated target?' opt=true [D_WL_HOME] typ=D def=${T_ADMIN_VALUE} dft=(${RUN.CLASS.WH.D_WL_HOME/v},\ ${CTX.D_WL_HOME:${ENV.WL_HOME}}) dsc='Oracle WebLogic Server home' err='Warning: The specified directory does not -yet- exist' fmt='<$dir})) "} } #------------------------------------------------------------------------------ # Edit an Oracle WebLogic Server home target #------------------------------------------------------------------------------ [do_edit] typ=M add=('R|Return to the previous menu|-|-') aft='\040' bef='Edit an Oracle WebLogic Server home target:' cas=false dft=(@{T_ADMIN_VALUE}) dsc='Edit an Oracle WebLogic Server 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('WH')) " {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 Oracle WebLogic Server 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 an Oracle WebLogic Server 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('WH')) " {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('WH')) " {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 Oracle WebLogic Server home target|+|-') "if $cnt " call push(@add,'E|Edit an Oracle WebLogic Server home target|-|-') "if ${B_ADMIN_END} "{if $cnt " call unshift(@add,'A|All Oracle WebLogic Server home targets|*|-') " call push(@add,'N|No Oracle WebLogic Server home targets|.|-') " var ${AUX.bef} = ${T_ADMIN_BEFORE:\ " 'Select an Oracle WebLogic Server home target list:'} " var ${AUX.opt} = false " var ${AUX.pck} = true "} "else "{var ${AUX.bef} = ${T_ADMIN_BEFORE:\ " 'Select an Oracle WebLogic Server 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.WH:${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