# S362OIM.def: Collects Oracle Identity Manager Information # $Id: S362OIM.def,v 1.20 2009/08/28 13:59:55 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/S362OIM.def,v 1.20 2009/08/28 13:59:55 mschenke Exp $ # # Change History # 20090821 DEM Provide provision for diagnostic dashboard timeout. =head1 NAME S362OIM - Collects Oracle Identity Manager Information =head1 DESCRIPTION This module collects information about Oracle Identity Manager. The following reports can be generated and are regrouped in C: =cut echo tput('bold'),'Processing Oracle Identity Manager module ...',tput('off') # Initialization var $OIM_FIX = getSetting('OIM_FIX',true) var $OIM_NAM = getSetting('OIM_NAME','XIMDD') var $OIM_PRT = getSetting('OIM_PORT',8080) var $OIM_SRV = getSetting('OIM_SERVER') var $OIM_USR = uc(getSetting('OIM_USER','XELSYSADM')) var $DB_USER = getSetting('OIM_DB_USER') var $OIM_RDBMS = getSetting('OIM_RDBMS') var $TNS_ALIAS = getSetting('OIM_TNS_ALIAS') var $OIM_LOCAL = getSetting('OIM_LOCAL') var $OIM_HOME = getSetting('OIM_HOME') var $AS_HOME = getSetting('OIM_AS_HOME') var $AS_TYPE = getSetting('OIM_AS_TYPE') var $ORACLE_HOME = getSetting('ORACLE_HOME','') var $TAIL = getSetting('RDA_TAIL',1000) #var $OIM_WLS_CFG = catDir($AS_HOME,'opmn','conf') #var $OIM_WS_CFG = catDir($AS_HOME,'opmn','conf') var $ERR = ' (error)' var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle Identity Manager' # Load the common macros run library() run DBinfo() # --- RDBMS home collections -------------------------------------------------- if $OIM_RDBMS {# Determine the user password if hasSqlPassword($DB_USER,$TNS_ALIAS) var $pwd = undef else var $pwd = askPassword(concat('Enter ',$DB_USER,'@',$TNS_ALIAS,\ ' user password:')) # Switch the context var $log = setSqlLogin($DB_USER,$pwd,$TNS_ALIAS) var $try = setSqlFailure(0) # Test the database connection if !testSql() { =head2 system - System Information Collects OIM system information from the database. =cut var $ver = get_db_version(true) debug ' Inside OIM module, gathering information about system' report system var $TTL = '---+!! System Information' var @TTL = ('',\ '---+ Version Information',\ '---+ System Configuration') var @HDR = ('',\ '|*Version* |*Value* |',\ '|*Keyword* |*Value* |*Description* |') set $sql {SELECT '|' || " xsd_code || ' |' || " xsd_value || ' |' " FROM xsd " WHERE xsd_code IN ('XL_PATCH_BASE','XL_BUILD') " ORDER BY xsd_code DESC; "PROMPT ___Macro_separator(2)___ "SELECT '|' || " pty_keyword || ' |' || " pty_value || ' |' || " pty_name || ' |' " FROM pty " ORDER BY pty_keyword,pty_value; } call separator(1) if loadSql($sql) {call writeLastSql() call separator(0,'System Information') var $OIM_VER = field('\|',2,grepLastSql('XL_PATCH_BASE','f')) var $OIM_BLD = field('\|',2,grepLastSql('XL_BUILD','f')) if or($OIM_VER,$OIM_BLD) var $aut = cond(or(compare('older',$OIM_VER,'9.1.0.2'),\ compare('older',$OIM_BLD,'1865.28')),false,true) } =head2 users - User Information Displays the information about OIM users. =cut debug ' Inside OIM module, gathering information about users' report users var $TTL = '---+!! User Information' var @TTL = ('',\ '---+ OIM User Count per Status',\ '---+ New OIM Users per Day, Last 10 Days',\ '---+ Users per Organization',\ '---+ Users per Group') var @HDR = ('',\ '|*Status*| *Count*|',\ '|*Date*| *Count*|',\ '|*Account Name*| *Count*|',\ '|*Group Name*| *Count*|') set $sql {SELECT '|' || " usr_status || ' | ' || " COUNT(*) || '|' " FROM usr " GROUP BY usr_status; "PROMPT ___Macro_separator(2)___ "SELECT '|' || " TO_CHAR(TRUNC(usr_create),'DD-Mon-YYYY') || ' | ' || " COUNT(*) || '|' " FROM usr " WHERE usr_create > TRUNC(SYSDATE - 10) " GROUP BY TRUNC(usr_create) " ORDER BY TRUNC(usr_create); "PROMPT ___Macro_separator(3)___ "SELECT '|' || " act_name || ' | ' || " COUNT(usr_key) || '|' " FROM act,usr " WHERE usr.act_key = act.act_key " GROUP BY act.act_name; "PROMPT ___Macro_separator(4)___ "SELECT '|' || " ugp_name || ' | ' || " COUNT(usr.usr_key) || '|' " FROM ugp,usg,usr " WHERE ugp.ugp_key = usg.ugp_key " AND usg.usr_key = usr.usr_key " GROUP BY ugp_name " ORDER BY ugp_name; } call separator(1) call writeSql($sql) call separator(0,'User Information') =head2 tables - Table Analysis Information Displays the information about table analysis. =cut debug ' Inside OIM module, gathering table analysis information' report tables var $TTL = '---+!! Table Analysis Information' var @TTL = ('',\ '---+ Table Analysis Information') var @HDR = ('',\ '|*Table Name*|*Last Analyzed*|') set $sql {SELECT '|' || " table_name || ' |' || " TO_CHAR(MAX(last_analyzed),'DD-Mon-YYYY') || ' |' " FROM user_tables " GROUP BY table_name " ORDER BY table_name; } call separator(1) call writeSql($sql) call separator(0,'Table Analysis Information') =head2 users - Password Policy Information Displays the information about OIM password policies. =cut debug ' Inside OIM module, gathering password policy related information' report passwords var $TTL = '---+!! Password Policy Information' var @TTL = ('',\ '---+ Number of Password Policies',\ '---+ Dictionary-Based Password Policies') var @HDR = ('',\ '| *Count*|',\ '|*Password Policy Name*|') set $sql {SELECT '| ' || " COUNT(*) || '|' " FROM pwr; "PROMPT ___Macro_separator(2)___ "SELECT '|' || " pwr_name || ' |' " FROM pwr " WHERE pwr_dictionary_location IS NOT NULL " ORDER BY pwr_name; } call separator(1) call writeSql($sql) call separator(0,'Password Policy Information') =head2 expimp - Export/Import Information Displays the export/import information. =cut # Export/import related items debug ' Inside OIM module, gathering export/import related information' report expimp prefix {write '---+ Exported/Imported' write '|*File* |*Description* |*User* |*Date* |' } set $sql {SELECT '|' || " eif_filename || ' |' || " eif_description || ' |' || " eif_user || ' |' || " TO_CHAR(eif_create,'DD_Mon-YYYY HH24:MI:SS') || ' |' " FROM eif " ORDER BY eif_create; } call writeSql($sql) if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Export/Import Information]]' } =head2 miscellaneous - Miscellaneous Displays the miscellaneous information. =cut debug ' Inside OIM module, gathering miscellaneous information' set $sql {SELECT 'tbl=' || table_name " FROM all_tables " WHERE table_name like '%JMSSTORE' " OR table_name like '%WLSTORE' " OR table_name in ('JMS_MESSAGES','XLAQQUEUETAB','OJMS_MSGS','SIB001'); } var ($tbl) = grepSql($sql,'^tbl=','f') report miscellaneous var $TTL = '---+!! Miscellaneous Information' var @TTL = ('',\ '---+ Number of Task Assignment Adapters',\ '---+ Adapter Compile Status (not OK)',\ '---+ List of Servers',\ '---+ Number of Access Policies',\ '---+ Number of Tasks',\ concat('---+ Number of ',$tbl),\ '---+ Number of JMS Transactions',\ '---+ Number of AUD_JMS',\ '---+ Connectors') var @HDR = ('',\ '| *Count*|',\ '|*Adapter Name*|*Status*|',\ '|*Server Name*|*Server Type*|',\ '| *Count*|',\ '|*Task Type*|*Status*| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '|*Name*|*Version*|*Status*|') set $sql {SELECT '| ' || " COUNT(1) || '|' " FROM adp " WHERE adp_type = 'A'; "PROMPT ___Macro_separator(2)___ "SELECT '|' || " adp_name || ' |' || " adp_status || ' |' " FROM adp " WHERE adp_status <> 'OK'; "PROMPT ___Macro_separator(3)___ "SELECT '|' || " svr_name || ' |' || " svd_svr_type || ' |' " FROM svd,svr " WHERE svd.svd_key = svr.svd_key; "PROMPT ___Macro_separator(4)___ "SELECT '| ' || " COUNT(1) || '|' " FROM pol; "PROMPT ___Macro_separator(5)___ "SELECT '|' || " pkg.pkg_type || ' |' || " sta.sta_bucket || ' | ' || " COUNT(osi.sch_key) || '|' " FROM sch,sta,pkg,obj,act,mil,tos,orc,osi " WHERE sch.sch_key = osi.sch_key " AND sta.sta_status = sch.sch_status " AND orc.pkg_key = pkg.pkg_key " AND osi.orc_key = orc.orc_key " AND pkg.obj_key = obj.obj_key " AND osi.mil_key = mil.mil_key " AND tos.tos_key = orc.tos_key " AND act.ACT_KEY = osi.ACT_KEY " GROUP BY pkg.pkg_type,sta.sta_bucket " ORDER BY pkg.pkg_type,sta.sta_bucket; } if $tbl {append $sql {PROMPT ___Macro_separator(6)___ "SELECT '| ' || " COUNT(1) || '|' " FROM :1; } } var (undef,$col) = getSqlColumns('RDA','','JMS_TRANSACTIONS') call clearSqlColumns('RDA') if $col {append $sql {PROMPT ___Macro_separator(7)___ "SELECT '| ' || " COUNT(1) || '|' " FROM jms_transactions; } } append $sql {PROMPT ___Macro_separator(8)___ "SELECT '| ' || " COUNT(1) || '|' " FROM aud_jms; } var (undef,$col) = getSqlColumns('RDA','','CIH') call clearSqlColumns('RDA') if $col {append $sql {PROMPT ___Macro_separator(9)___ "SELECT '|' || " cih_name || ' |' || " cih_version || ' |' || " cih_status || ' |' " FROM cih; } } call separator(1) call writeSql(bindSql($sql,value($tbl))) call separator(0,'Miscellaneous Information') } # Restore the previous context call setSqlLogin($log) call setSqlFailure($try) } # --- AS Home Collections ----------------------------------------------------- if $OIM_LOCAL {var $dir = catDir($OIM_HOME, 'xellerate', 'config') # Check whether authentication is needed for Diagnostic Dashboard if !?$aut {if testFile('fr',catFile($dir,'Version.prop')) {var $OIM_VER = value(grepFile(lastFile(),'^product\.version','fi')) var (undef,undef,undef,$ver,$bld) = \ split('\.',value(grepFile(lastFile(),'^build\.number','fi')),5) var $OIM_BLD = concat($ver,'.',$bld) var $aut = cond(or(compare('older',$OIM_VER,'9.1.0.2'),\ compare('older',$OIM_BLD,'1865.28')),false,true) } } =head2 xlconfig_parsing - xlconfig.xml Parsing Test Checks whether the F file has XML parsing errors. =cut var $fil = catFile($dir,'xlconfig.xml') if testFile('r',$fil) {report xlconfig_parsing debug ' Inside OIM module, parsing xlconfig.xml for errors' write '---+!! xlconfig.xml XML Parsing Test' var $xml = xmlLoadFile($fil) if xmlError($xml) {write 'The OIM Server config file \ ``$ORACLE_HOME/xellerate/config/xlconfig.xml`` is corrupt.' write 'Some configuration items will not be readable or used. It could \ cause performance or malfunction issues.' } else {write 'No errors detected in ``$ORACLE_HOME/xellerate/config/xlconfig.xml``' } if isCreated(true) toc '2:[[',getFile(),'][rda_report][xlconfig.xml Parsing Test]]' } =head2 OIM Configuration Files Gets OIM configuration files. =cut pretoc '2: Xellerate Config Files' call sort_files(3,0,catFile($dir,'xlconfig.xml'),\ catFile($dir,'log.properties')) unpretoc if match($AS_TYPE,'oc4j') {pretoc '2:OC4J Configuration' var $dir1 = catDir($AS_HOME,'opmn','conf') var $dir2 = catDir($AS_HOME,'j2ee',getSetting('OIM_OC4J_INSTANCE',''),\ 'config') call sort_files(3,0,catFile($dir1,'opmn.xml'),\ catFile($dir2,'data-sources.xml'),\ catFile($dir2,'jms.xml'),\ catFile($dir2,'server.xml'),\ catFile($dir2,'default-web-site.xml'),\ catFile($dir2,'system-jazn-data.xml'),\ catFile($dir2,'transaction-manager.xml')) unpretoc } elsif match($AS_TYPE,'jboss') {pretoc '2:JBOSS Configuration' var $dir = catDir($AS_HOME,'bin') if isWindows() call sort_files(3,0,catFile($dir,'run.bat')) elsif isUnix() call sort_files(3,0,catFile($dir,'run.conf'),\ catFile($dir,'run.sh')) if getSetting('OIM_JBOSS_HOME') {var $dir = last pretoc '3: Non Clustered' call sort_files(4,0,\ grepDir(catDir($dir,'server','default','conf'),\ '(log4j|jboss-log4j)\.xml','p')) pretoc '3: Clustered' call sort_files(4,0,\ grepDir(catDir($dir,'server','all','conf'),\ '(log4j|jboss-log4j)\.xml','p')) } unpretoc } =head2 OIM Profile Files Gets OIM profile files. =cut pretoc '2: Xellerate Profile Files' call sort_files(3,$TAIL,\ grepDir(catDir($OIM_HOME,'xellerate','Profiles'),'\.profile$','p')) unpretoc =head2 javatasks - JavaTasks Files Gets list of files in F<$OIM_HOME\xellerate\JavaTasks> directory. =cut report javatasks var $dir = catDir($OIM_HOME,'xellerate','JavaTasks') prefix {write '---+!! List of files from ',$dir } call statDir('a',$dir) if isCreated(true) toc '2:[[',getFile(),'][rda_report][JavaTasks Files]]' =head2 schedtask - ScheduleTask Files Gets list of files in F<$OIM_HOME\xellerate\ScheduleTask> directory. =cut report schedtask var $dir = catDir($OIM_HOME,'xellerate','ScheduleTask') prefix {write '---+!! List of files from ',$dir } call statDir('a',$dir) if isCreated(true) toc '2:[[',getFile(),'][rda_report][ScheduleTask Files]]' =head2 OIM Log Files Gets OIM log files. =cut pretoc '2: Xellerate Log Files' call sort_files(3,$TAIL,\ grepDir(catDir($OIM_HOME,'logs'),'\.(log|err)$','p'),\ grepDir(catDir($OIM_HOME,'xellerate','logs'),'.','p')) unpretoc } =head2 sch_stat - Scheduler Status Collects Scheduler Status Information =cut # Validate the server name and port if !match($OIM_SRV,'^[\w\-\.]+$') {echo 'Invalid OIM diagnostic dashboard server' return } if !match($OIM_PRT,'^\d+$') {echo 'Invalid OIM diagnostic dashboard port' return } # Get the scheduler status debug ' Inside OIM module, getting scheduler status information' report sch_stat var $url = concat('http://',$OIM_SRV,':',$OIM_PRT,'/xlScheduler') if $aut {var $url = concat($url,'/') var $pwd = askPassword(concat('Enter ',$OIM_USR,' user password:')) var $req = createRequest('POST',$url) call addReqForm($req,\ concat('USERNAME=',$OIM_USR),\ concat('PASSWORD=',$pwd),\ 'ACTION=STATUS') } else var $req = createRequest('GET',$url) var $rsp = submitRequest($req) if isSuccess($rsp) {prefix {write '---+!! Scheduler Status' write '---## Using: ',$url write $TOC } var $htm = htmlLoadResponse($rsp,htmlDisable(htmlParser(),'R')) loop $lin (htmlTable($htm)) write $lin } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Scheduler Status]]' else echo 'Cannot get the scheduler status (',join(',',getRspCode($rsp)),\ ' - ',getRspMessage($rsp),')' # --- Diagnostics Dashboard operations ---------------------------------------- # Validate the application name if !match($OIM_NAM,'^\w+$') {echo 'Invalid diagnostic dashboard application name' return } # Get a session cookie debug ' Inside OIM module, accessing diagnostic dashboard (can take time)' var $url = concat('http://',$OIM_SRV,':',$OIM_PRT,'/',$OIM_NAM,\ '/SystemVerification') var $req = createRequest('GET',$url) var $sec = getSetting('OIM_TIMEOUT',150) if !match($sec,'^\d+$') var $sec = 150 call setDftTimeout($sec) var $rsp = submitRequest($req) if !isSuccess($rsp) {echo 'Cannot access the diagnostic dashboard (',join(',',getRspCode($rsp)),\ ' - ',getRspMessage($rsp),')' return } if $aut {var $url = concat('http://',$OIM_SRV,':',$OIM_PRT,'/',$OIM_NAM,\ '/UserVerification') var $req = createRequest('POST',$url) call addReqForm($req,\ concat('userID=',$OIM_USR),\ concat('password=',$pwd)) var $rsp = submitRequest($req) if !isSuccess($rsp) {echo 'Cannot access the diagnostic dashboard (',join(',',getRspCode($rsp)),\ ' - ',getRspMessage($rsp),')' return } var $url = concat('http://',$OIM_SRV,':',$OIM_PRT,'/',$OIM_NAM,\ '/SystemVerification') var $req = createRequest('GET',$url) var $rsp = submitRequest($req) if !isSuccess($rsp) {echo 'Cannot access the diagnostic dashboard (',join(',',getRspCode($rsp)),\ ' - ',getRspMessage($rsp),')' return } } pretoc '2:Diagnostics Dashboard' =head2 Diagnostics Dashboard reports =head3 sys_info - System Information Collects Oracle Identity Manager system information. =cut # Extract the system information from previous response var $sys = undef var $htm = htmlLoadResponse($rsp,\ htmlFilter(htmlDisable(htmlParser(),'DR'),'td')) loop $nod (htmlFind($htm,'.../td class="ControlLabel"')) {loop $itm (htmlContent($nod,'S')) {var $str = htmlText($itm) next !match($str,'\w+') if $aut {if match($str,'^Oracle Identity Manager') var $str = concat(' ',$str) var $sys = concat($sys,replace($str,'\240',' ',true)) } else var $sys = replace($str,'\240',' ',true) } } # Parse the system information if $sys {debug ' Inside OIM module, getting OIM system information' report sys_info loop $val (split('\s{2,}',$sys)) {next match($val,'(\<|The following diagnostic)',true) if match($val,'^System Information\s*:',true) write '---+ System Information' elsif match($val,'^(.*):$') write '|',last,' ||' elsif match($val,'^(.*):\s+(.*)$') {var ($hdr,$txt) = (last) write '|*',$hdr,'* |',$txt,' |' } } if isCreated(true) toc '3:[[',getFile(),'][rda_report][System Information]]' } =head3 db_connect - Database Connectivity Check This test is to verify if Oracle Identity Manager is able to connect to the database or not. This test verifies the direct database connection as well as the J2EE data sources (XA and non-XA). =head3 lock_status - Account Lock Status This test is to verify if Oracle Identity Manager locks an account when there are successive multiple invalid login attempts. This test checks if a given account is locked or not. =head3 enc_key_ver - Data Encryption Key Verification This test is to verify the Data Encryption Key used for Oracle Identity Manager. The data encryption key in an Oracle Identity Manager installation should be the same as the one used to encrypt the data in the Oracle Identity Manager database. This may not be the case when an Oracle Identity Manager installation is pointed to a database schema created for a different Oracle Identity Manager installation. This can also happen when database dump from one Oracle Identity Manager installation is imported for a different Oracle Identity Manager installation without copying the corresponding key. =head3 sch_svc_sta - Scheduler Service Status This test is to verify the status of the Oracle Identity Manager Scheduler Service running on this server. =head3 rem_mgr_sta - Remote Manager Status This test reports the status of the Remote Managers that this Oracle Identity Manager installation is set up to work with. =head3 jms_msg - JMS Messaging Verification The purpose of this test is to verify that Oracle Identity Manager will be able to submit a JMS message and process it. =head3 jvm_prop - Java VM System Properties Report This test is to display all the Java VM system properties. =head3 lib_version - Libraries and Extensions Version Report This test reports the version of the Oracle Identity Manager libraries and extensions. =head3 lib_manifest - Libraries and Extensions Manifest Report This test reports the manifest information of the Oracle Identity Manager libraries and extensions. =head3 sso_diag - SSO Diagnostic Information This test provides information pertaining to SSO setup. Also, provides instructions required to set up Oracle Identity Manager to enable retrieving run-time diagnostic information related to SSO logins. =cut var %tb_rpt = (\ 'Database Connectivity Check',\ 'db_connect',\ 'Account Lock Status',\ 'lock_status',\ 'Data Encryption Key Verification',\ 'enc_key_ver',\ 'Scheduler Service Status',\ 'sch_svc_sta',\ 'Remote Manager Status',\ 'rem_mgr_sta',\ 'JMS Messaging Verification',\ 'jms_msg',\ 'Java VM System Properties',\ 'jvm_prop',\ 'Oracle Identity Manager Libraries and Extensions Version Report',\ 'lib_version',\ 'Oracle Identity Manager Libraries and Extensions Manifest Report',\ 'lib_manifest',\ 'SSO Diagnostic Information',\ 'sso_diag'\ ) # Submit query (POST request with session cookie) debug ' Inside OIM module, executing tests (can take time)' var $req = createRequest('POST',$url) call addReqForm($req,\ 'CB_VALIDATEDBCONNECTIONS=selected',\ 'CB_VALIDATEUSERLOCKED=selected',\ concat('INP_VALIDATEUSERLOCKED_USERNAME=',encode($OIM_USR)),\ 'CB_VALIDATEDBKEY=selected',\ 'CB_VALIDATESCHEDULER=selected',\ 'CB_VALIDATEREMOTEMANAGER=selected',\ 'CB_VALIDATEMESSAGE=selected',\ 'CB_SYSTEMPROPERTIESCHECK=selected',\ 'CB_REPORTLIBRARIESVERSION=selected',\ 'CB_REPORTLIBRARIESMANIFEST=selected',\ 'CB_SSODIAGNOSTICINFO=selected',\ 'Verify=Verify') var $rsp = submitRequest($req) if !isSuccess($rsp) {echo 'Failed to get OIM diagnostic dashboard results (',\ join(',',getRspCode($rsp)),' - ',getRspMessage($rsp),')' return } data "diag.htm" call writeResponse($rsp) var $htm = htmlLoadResponse($rsp,\ htmlFilter(htmlDisable(htmlFix(htmlParser(),\ $OIM_FIX),\ 'DR'),\ 'td','a','b','pre')) # Declare a macro for formatting a PRE block macro fmt_pre {var ($str) = @arg var $str = replace(encode($str),'\n','%BR%',true) var $str = replace($str,'\t','  ',true) return $str } # Extract the HTML content and write to reports loop $nod (htmlFind($htm,'.../td class="ControlLabel"')) {var ($ttl,@nod) = htmlContent($nod,undef,'table|td|th|tr') next !@nod # Validate that it is a test node next !compare('eq',htmlName($ttl),'a') var $ttl = replace(htmlValue($ttl,'name'),'\+',' ',true) debug ' Inside OIM module, extracting ',$ttl # Parse the test information var ($key,%tst) = ('?') loop $itm (@nod) {var $tag = htmlName($itm) if !defined($tag) var $tst{$key} = trim(htmlText($itm),'\240+') elsif compare('eq',$tag,'b') var $key = lc(field('\s',0,htmlText($itm))) elsif compare('eq',$tag,'pre') {if htmlFind($itm,'table') {var $str = undef var $pre = cond(match($ttl,'(properties|version) report',true),'',"\011") loop $det (htmlContent($itm)) {if compare('eq',htmlName($det),'table') {if ?$str var $str = concat(chomp($str),"\012") loop $row (htmlFind($det,'tr')) {var $txt = trim(chomp(htmlText($row))) if length($txt) var $str = concat($str,$pre,$txt,"\012") } } else var $str = concat($str,htmlText($det)) } var $tst{$key} = chomp(replace($str,'\n{3,}',"\012\012",true)) } else var $tst{$key} = trim(htmlText($itm)) } } # Generate the report report nvl($tb_rpt{$ttl},$ttl) write '---+!! ',$ttl write '|*Description*|',$tst{'description'},' |' if exists($tst{'input'}) write '|*Input Parameters*|``',fmt_pre($tst{'input'}),'`` |' write '|*Result*|',check(uc($tst{'result'}),'FAILED','%RED%','%BLUE%'),\ $tst{'result'},'%ENDCOLOR% |' if match($ttl,'properties report',true) {write '---++ Properties' write '|*Property*|*Value*|' loop $lin (split('\n',$tst{'details'})) {next match($lin,'^\s*$') write '|',join(' |',split('\s+',replace($lin,'\|','|',true),2)),' |' } } elsif match($ttl,'version report',true) {write '---++ Library Versions' write '|*Library Name*|*Version*|' loop $lin (split('\n',$tst{'details'})) {next match($lin,'^\s*(\z|LIBRARY)',true) write '|',join(' |',split('\s+',$lin,2)),' |' } } elsif match($ttl,'manifest report',true) {write '%BR%' write '%TOC3-2%' var $flg = false loop $lin (split('\n',$tst{'details'})) {next match($lin,'^\s*(\z|LIBRARY)') if match($lin,'^Name:') {if $flg write $TOP var $flg = true write '---++ ',replace($lin,'^Name:\s*') } elsif match($lin,'^\s+(\w[^:]+):\s+(.*)$') {var ($key,$val) = last write '|*',$key,'* |',$val,' |' } } } else write '|*Details*|``',fmt_pre($tst{'details'}),'``|' if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][',\ replace($ttl,'Oracle Identity Manager '),\ check(uc($tst{'result'}),'FAILED',$ERR),']]' } } unpretoc =head1 SEE ALSO L, L =begin credits =over 10 =item RDA 4.10: Brad Donison. =item RDA 4.14: Mikko Uronen, Kari Jyrala. =item RDA 4.16: Brad Donison. =item RDA 4.17: Brad Donison. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002-2009, Oracle. All rights reserved. =head1 TRADEMARK NOTICE Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. =cut