# OAAMcfg.def: Assists Oracle Adaptive Access Manager Collection Setup # $Id: OAAMcfg.def,v 1.5 2012/01/03 13:34:42 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/OAAMcfg.def,v 1.5 2012/01/03 13:34:42 mschenke Exp $ # # Change History # 20120103 MSC Change the copyright notice. =head1 NAME OAAMcfg - Assists Oracle Adaptive Access Manager Collection Setup =head1 DESCRIPTION This module provided associated logic for the setup of the Oracle Adaptive Access Manager collections. =cut #------------------------------------------------------------------------------ # Section init: Module initialization #------------------------------------------------------------------------------ section init #------------------------------------------------------------------------------ # Section chk_applications: Check which OAAM applications are present #------------------------------------------------------------------------------ section chk_applications var %app var %pth var $top = getSetting('OAAM_DOMAIN') # Get the servers with existing applications var $fil = catFile($top,'config','config.xml') if testFile('fr',$fil) {var $obj = xmlLoadFile(lastFile(),xmlDisable(xmlParser(),'BCDEPR')) loop $xml (xmlFind($obj,'domain/app-deployment')) {var $tgt = xmlData(xmlFind($xml,'target')) next !testDir('d',catDir($top,'servers',$tgt,'logs')) var $nam = xmlData(xmlFind($xml,'name')) var $pth = xmlData(xmlFind($xml,'source-path')) if testFile('f',catFile($pth,'WEB-INF','classes','oaam_version.properties')) var $pth{$tgt,$nam} = $pth } } # Customize the setup if @srv = keys(%pth) {var ${AUX.dft} = 1 var ($srv_cnt,$srv_flg,@srv_all,@srv_dft,@srv_itm,%srv_sel) = (0,true) # Analyze the previous requests var $val = getSetting('OAAM_SERVERS') if compare('eq',$val,'*') var $srv_flg = false loop $key (grepSetting(concat('^','OAAM_SRV\d+$'))) {var $srv = getSetting($key) var $srv_sel{$srv} = 1 loop $sub (grepSetting(concat('^',$key,'_APP\d+$'))) var $app{$srv,getSetting($sub)} = getSetting(concat($sub,'_PATH')) } # Generate temporary setting loop $srv (@srv) {call push(@srv_all,incr($srv_cnt)) call push(@srv_itm,$srv_cnt,$srv) if and($srv_flg,exists($srv_sel{$srv})) call push(@srv_dft,$srv_cnt) call setTempSetting($key = concat('TMP_OAAM_SRV',$srv_cnt),$srv) var ($app_cnt,@app_all,@app_dft,@app_itm) = (0) loop $app (keys($pth{$srv})) {call push(@app_all,incr($app_cnt)) call push(@app_itm,$app_cnt,$app) if exists($app{$srv,$app}) call push(@app_dft,$app_cnt) call setTempSetting(concat($key,'_APP',$app_cnt),$app) call setTempSetting(concat($key,'_APP',$app_cnt,'_PATH'),$pth{$srv,$app}) } call setTempSetting(concat('TMP_DFT_APPLICATIONS',$srv_cnt),\ join('|',@app_dft)) call setTempSetting(concat('TMP_ITM_APPLICATIONS',$srv_cnt),\ join('|',@app_itm)) } call setTempSetting('TMP_ALL_SERVERS',join('|',@srv_all)) call setTempSetting('TMP_DFT_SERVERS',cond($srv_flg,join('|',@srv_dft),'*')) call setTempSetting('TMP_ITM_SERVERS',join('|',@srv_itm)) } =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