# MCxscf.cfg: Collects Extended System Control Facility (XSCF) information # $Id: MCxscf.cfg,v 1.5 2013/12/20 13:40:15 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCxscf.cfg,v 1.5 2013/12/20 13:40:15 RDA Exp $ # # Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. # # Change History # 20131220 JGS Fix spell. ############################################################################### # Setup information for Extended System Control Facility (XSCF) ############################################################################### #------------------------------------------------------------------------------ # Module definition #------------------------------------------------------------------------------ def="COL/${CUR.K_MODULE}.XSCF" dsc='Collects Extended System Control Facility (XSCF) Information' var=dsp_items,get_action exe=sdcl { "if ${RUN.EXPLORER.B_USE_XSCF} "{var ${F_CFG:'Current input file'} = ${RUN.EXPLORER.XPLR.XSCF.F_CFG} " loop $set (@{N_SET:'XSCF archive host set'} = @{RUN.EXPLORER.XPLR.XSCF.N_SET}) " {var ${T_HOST_${VAR.set}:"Host name or IP address of XSCF archive host \ " ${VAR.set}"} = ${RUN.EXPLORER.XPLR.XSCF.T_HOST_${VAR.set}} " var ${T_SECTION_${VAR.set}:"Section name to use from .explorer file at \ " archive host ${VAR.set}"} = ${RUN.EXPLORER.XPLR.XSCF.T_SECTION_${VAR.set}} " var ${T_USER_${VAR.set}:"User for connecting to XSCF archive host \ " ${VAR.set}"} = ${RUN.EXPLORER.XPLR.XSCF.T_USER_${VAR.set}} " } " var ${AUX.var} = [] "} } #------------------------------------------------------------------------------ # Settings definitions #------------------------------------------------------------------------------ [dsp_items] typ=C bef="\nDefined XSCF archive contexts:" dsc='Display archive context for user@hosts' vis=0 exe=sdcl { "var ($nxt,@ctx,@dsp,@itm,@rsp) = (0) "keep $nxt,@ctx "if ?${N_SET} "{loop $set (@{N_SET}) " {var ($hst,$sct,$usr) = (${T_HOST_${VAR.set}},\ " ${T_SECTION_${VAR.set}},\ " ${T_USER_${VAR.set}}) " next !?$hst " var $dsc = cond(compare('eq',$hst,'-'),\ " concat($sct,' from ',$usr,' on local host'),\ " concat($sct,' from ',$usr,' at ',$hst)) " call push(@ctx,join('/',$sct,$usr,$hst)) " call push(@dsp,concat(${VAR.set},'\040\040',$dsc)) " call push(@itm,${VAR.set},$dsc) " call push(@rsp,${VAR.set},${VAR.set}) " incr $nxt " } "} "var ${T_TMP_DSP/T} = join('\012',@dsp) "var ${T_TMP_ITM/T} = join('|','0|Previous menu',@itm) "var ${T_TMP_RSP/T} = join('|','0|0',@rsp) "if ${T_TMP_DSP} " var ${AUX.inp} = ${T_TMP_DSP} } [get_action] typ=M ask=0 bef="\nSelect an action:" cas=0 dft='R' err='Invalid action' inp='Enter the selection' nam=-T_TMP_ACT val=E var=D:define,dsp_items,get_action:\ R:save:\ S:suppress,dsp_items,get_action exe=sdcl { "if ?${N_SET} "{var ${AUX.itm} = ['D'=>'Define new XSCF archive context', \ " 'S'=>'Suppress an existing XSCF archive context', \ " 'R'=>'Return'] " var ${AUX.rsp} = ['D'=>'D','S'=>'S','R'=>'R'] "} "else "{var ${AUX.itm} = ['D'=>'Define new XSCF archive context', \ " 'R'=>'Return'] " var ${AUX.rsp} = ['D'=>'D','R'=>'R'] "} } [save] typ=B dft=1 dsc='Save settings' nam=- exe=sdcl { "loop $set (@{N_SET:'XSCF Archive host set'} = @{N_SET}) "{var ${T_HOST_${VAR.set}:"Host name or IP address of XSCF archive host \ " ${VAR.set}"} = ${T_HOST_${VAR.set}} " var ${T_SECTION_${VAR.set}:"Section name to use from .explorer file at \ " archive host ${VAR.set}"} = ${T_SECTION_${VAR.set}} " var ${T_USER_${VAR.set}:"User for connecting to XSCF archive host \ " ${VAR.set}"} = ${T_USER_${VAR.set}} "} } #------------------------------------------------------------------------------ # Define a new archive context #------------------------------------------------------------------------------ [define] typ=B dft=1 dsc='Define an item' nam=- var=get_section,get_user,get_host,is_dup [get_section] typ=T dsc='Section name to use from .explorer file' err='The section name contains invalid characters' inp='Enter the XSCF section name to use from .explorer file' nam=-T_TMP_SECTION ref="^\w[\w\-\.]*$" val=E [get_user] typ=T dsc='User for connecting to the archive host' err='Bad user name' inp='Enter the user for connecting to the XSCF archive host' nam=-T_TMP_USER ref=defined(isUser(last,true)) val=E [get_host] typ=T dsc='Host name or IP address of archive host' err='Bad host name or IP address' inp="Enter the host name or IP address of an XSCF archive host, or '-' for \ local host" nam=-T_TMP_HOST ref=defined(check(last,'^-$',last,isHost(last,true))) val=E [is_dup] typ=B dsc='Validate if section/user/host is duplicated' nam=- var=true:not_unique:\ save_host,save_user,save_section exe=sdcl { "var $val = concat('^',${T_TMP_SECTION},'/',${T_TMP_USER},'/',${T_TMP_HOST},'$') "var ${AUX.dft} = grep(@ctx,$val,'f') } [not_unique] typ=C dsc='Duplicate XSCF archive context' inp='Duplicate entry' vis=0 [save_host] typ=T dft=${T_TMP_HOST} dsc="Archive host ${VAR.nxt}" nam=T_HOST_${VAR.nxt} exe=sdcl { "call push(@{N_SET},incr($nxt)) } [save_user] typ=T dft=${T_TMP_USER} dsc="Archive user ${VAR.nxt}" nam=T_USER_${VAR.nxt} [save_section] typ=T dft=${T_TMP_SECTION} dsc="Section ${VAR.nxt}" nam=T_SECTION_${VAR.nxt} #------------------------------------------------------------------------------ # Suppress an archive context #------------------------------------------------------------------------------ [suppress] typ=M bef="\nSelect an XSCF archive context to suppress:" dft="^" dsc='Select the XSCF archive context to suppress' err='Specify the item number' inp='Enter the selection' itm="${T_TMP_ITM}" mnu='<