# WSPsetup.def: Assists IBM WebSphere Application Server Collection Setup # $Id: WSPsetup.def,v 1.5 2012/01/03 13:34:48 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/WSPsetup.def,v 1.5 2012/01/03 13:34:48 mschenke Exp $ # # Change History # 20120103 MSC Change the copyright notice. =head1 NAME WSPsetup - Assists IBM WebSphere Application Server Collection Setup =head1 DESCRIPTION This module provided associated logic for the setup of the IBM WebSphere Application Server collections. =cut #------------------------------------------------------------------------------ # Section init: Module initialization #------------------------------------------------------------------------------ section init keep @cel,@srv #------------------------------------------------------------------------------ # Section get_cells: Identify the cells #------------------------------------------------------------------------------ section get_cells if grepDir($top = ${WSP_PROFILE_ROOT},'^[^\.]+$','n') {loop $pro (last) {if testDir('d',catDir($top,$pro,'config','cells')) {loop $cel (grepDir(lastDir(),'^[^\.]+$','n')) {if testFile('f',catFile(lastDir(),$cel,'virtualhosts.xml')) call push(@cel,concat($pro,':',$cel)) } } } if @cel var ${AUX.dft} = 1 } #------------------------------------------------------------------------------ # Section get_cell_ids: Get the cell identifiers #------------------------------------------------------------------------------ section get_cell_ids var ($cnt,@tbl,%prv) = (0) # Analyze the previous set if ${WSP_CELL_IDS} {loop $uid (split('\|',last)) var $prv{getSetting(concat('WSP_CELL_',$uid))} = \ getSetting(concat('WSP_USER',$uid)) } # Prepare the current set loop $cel (@cel) {incr $cnt call setTempSetting(concat('WSP_CELL_CEL',$cnt),$cel) call setTempSetting(concat('WSP_USER_CEL',$cnt),$prv{$cel}) call push(@tbl,concat('CEL',$cnt)) } var ${AUX.dft} = join('|',@tbl) #------------------------------------------------------------------------------ # Section get_cell_items: Produce the items for the profile:cell selection #------------------------------------------------------------------------------ section get_cell_items var ($cnt,@tbl) = (0) if ${AUX.itm} call push(@tbl,last) loop $cel (@cel) call push(@tbl,incr($cnt),$cel) var ${AUX.itm} = join('|',@tbl) #------------------------------------------------------------------------------ # Section get_home_list: Get the Middleware or IBM WebSphere home #------------------------------------------------------------------------------ section get_home_list var ($top,@hom,%dup) = (${WSP_PROFILE_ROOT}) if length($srv = ${WSP_SERVERS}) {if !compare('eq',${WSP_SERVERS},'*All*') var @srv = split('\|',${WSP_SERVERS}) loop $itm (@srv) {var ($pro,$cel,$nod,undef) = split(':',$itm) if testFile('fr',catFile(\ $top,$pro,'config','cells',$cel,'nodes',$nod,'variables.xml')) {var $obj = xmlLoadFile(lastFile(),xmlDisable(xmlParser(),'BCDEPR')) var $hom if xmlFind($obj,\ 'variables:VariableMap/entries symbolicName=".*ORACLE_HOME$"') var $hom = xmlValue(last,'value') elsif xmlFind($obj,\ 'variables:VariableMap/entries symbolicName="WAS_INSTALL_ROOT"') var $hom = xmlValue(last,'value') if $hom call push(@hom,$hom) } } loop $hom (@hom) {if length($hom) var $dup{$hom} = true } } else var @srv = () var ${AUX.dft} = join('|',keys(%dup)) #------------------------------------------------------------------------------ # Section get_server_items: Produce the items for the server selection #------------------------------------------------------------------------------ section get_server_items var ($cnt,$top,@srv) = (0,${WSP_PROFILE_ROOT}) if length($cel = ${WSP_CELLS}) {if !compare('eq',${WSP_CELLS},'*All*') var @cel = split('\|',${WSP_CELLS}) loop $itm (@cel) {var ($pro,$cel) = split(':',$itm) var $dir = catDir($top,$pro,'config','cells',$cel,'nodes') loop $nod (grepDir($dir,'^[^\.]+$','n')) {if testDir('d',catDir($dir,$nod,'servers')) {loop $srv (grepDir(lastDir(),'^[^\.]+$','n')) {if testFile('f',catFile(lastDir(),$srv,'server.xml')) call push(@srv,incr($cnt),join(':',$pro,$cel,$nod,$srv)) } } } } if @srv {if ${AUX.itm} call unshift(@srv,last) } } else var @cel = () var ${AUX.itm} = join('|',@srv) =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut