# DEVr11.def: Defines Common Macros for Oracle Developer 11g # $Id: DEVr11.def,v 1.2 2009/08/06 10:20:58 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/DEVr11.def,v 1.2 2009/08/06 10:20:58 mschenke Exp $ # # Change History # 20090805 DEM Extend functionality. =head1 NAME DEVr11 - Defines Common Macros for Oracle Developer 11g =head1 DESCRIPTION This persistent sub module regroups macros that are common to Oracle Developer in Oracle Application Server 11g. The following macro is available: =cut # Make the module persistent and share macros keep $KEEP_BLOCK,@SHARE_MACROS var @SHARE_MACROS = ('collect_dev_generic','collect_dev_instance',\ 'collect_forms_instance','collect_reports_instance',\ 'get_components','get_instances') # Load the common macros run ASITlib() run DEVlib() =head2 S This macro gathers Oracle Developer Forms/Reports installation files and its directory contents information. =cut macro collect_dev_generic {import $FORMS_HOME,$OH2,$ORACLE_HOME,$REPORTS_HOME pretoc '2:Installation Files' var $dir = catDir($ORACLE_HOME,'inventory','Components21') call get_install($dir,'oracle.','reports.core') call get_install($dir,'oracle.','reports.builder') call get_install($dir,'oracle.','developer.forms.compiler') call get_install($dir,'oracle.','developer.forms.builder') unpretoc # List forms/java directory contents pretoc '2:Oracle Forms' call get_forms_java_directory($FORMS_HOME) # Get forms/server directory contents call sort_results(3,0,$OH2,'$OH',\ grepDir(catDir($FORMS_HOME,'server'),'(\.cfg$|\.conf$|\.env$|\.htm$|\ \.properties$|\.xml)','ipn')) unpretoc pretoc '2:Oracle Reports' var $dir = catDir($REPORTS_HOME,'conf') if testFile('r',catFile($dir,'cgicmd.dat')) {# Get reports/conf directory contents var $dir = catDir($ORACLE_HOME,'reports','conf') call sort_results(3,0,$OH2,'$OH',\ grepDir($dir,'\.conf$|^(cgicmd.dat|distribution.xsl|proxyinfo.xml|\ rwserver.install|rwserver.template|rwservlet.properties)$',\ 'ipn')) } unpretoc } =head2 S This macro collects Oracle Developer-related startup scripts, toolkit files (such as F, F, and F), reports the syntax integrity of the collected F files using the F command on UNIX and the F command on Windows, and reports the version used. =cut macro collect_dev_instance {var ($dsc,$top,\%cmp) = @arg import $ORACLE_HOME,$TOC,$TOP debug ' - Getting Oracle Developer startup scripts, toolkit files and version' var $abr = setAbbr() var $pre = concat('^',quote($top),'\b') call setAbbr(concat($abr,'i_',$dsc)) # Oracle Forms/Reports startup scripts pretoc '2:Startup Scripts' call sort_results(3,0,$pre,'$OI',\ grepDir(catDir($top,'bin'),'\.(sh|bat)$','ip'),\ grepDir(catDir($top,'config','reports','bin'),'\.(sh|bat)$','ip')) unpretoc # Oracle Forms/Reports toolkit files pretoc '2:Toolkit' macro find_file {loop $fil (@arg) {if testFile('r',$fil) {call get_file($fil,0,'tk_',3) return $fil } } return undef } var ($cfg,@uif) = (catDir($top,'config','FRComponent')) loop $key (keys(%cmp)) {var ($typ,$cmp) = split('\|',$key,2) next !match($typ,'^DeJvmRuntimeInfo$',true) debug ' - ',$cmp,' component' call setAbbr(concat($abr,'i_',$dsc,'_c_',$cmp)) loop $fil (catFile($cfg,$cmp,'guicommon','tk','admin','uiprint.txt'),\ catFile($cfg,$cmp,'guicommon','tk','admin','uiscreenprint.txt')) {if testFile('r',$fil) call get_file($fil,0,'tk_',3) } if find_file(catFile($cfg,$cmp,'guicommon','tk','admin','uifont.ali'),\ catFile($cfg,$cmp,'tools','common','uifont.ali')) var @uif = (@uif,last) var $cnt = 0 loop $fil (grepDir(catDir($cfg,$cmp,'guicommon','tk','admin'),\ 'Tk2Motif.rgb','r',1)) {incr $cnt call get_file($fil,0,sprintf('tk_d%02d_',$cnt),3) } loop $fil (\ catFile($cfg,$cmp,'guicommon','tk','admin','PPD','default.ppd'),\ catFile($cfg,$cmp,'guicommon','tk','admin','PPD','datap462.ppd'),\ catFile($cfg,$cmp,'guicommon','tk','admin','PPD','screenprinter.ppd')) {if testFile('r',$fil) call get_file($fil,0,'tk_',3) } } unpretoc # Check the syntax of collected uifont.ali files call setAbbr(concat($abr,'i_',$dsc)) if @uif {if isUnix() var $pgm = catFile($ORACLE_HOME,'bin','mfontchk') elsif isWindows() var $pgm = catFile($ORACLE_HOME,'bin','fnchk.exe') else var $pgm = undef if testFile('fx',$pgm) {var $pgm = quote($pgm,'x') report uifont loop $uif (@uif) {var $cmd = concat($pgm,' ',quote($uif,'x'),' 2>&1') prefix {if !isCreated() write '---+!! Syntax Integrity of uifont.ali' write '---## Using: ',encode($cmd) } call writeCommand($cmd) } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Syntax Integrity of uifont.ali]]' } } # Oracle Forms/Reports versions report versions write '---+!! Versions' write $TOC write '%BR%' write '' write 'ORACLE_HOME=',$ORACLE_HOME write 'INSTANCE_HOME=',$top write 'This install is part of AS 11g' write '' # Get Forms runtime version if grepDir(catDir($top,'bin'),'^frmcmp_batch(\.bat|\.sh)?$','ip') var ($cmd) = (last) else var $cmd = undef if $cmd {write '---+ Current runtime version of forms' call loadCommand(concat(quote($cmd,'x'),' \?')) call writeLastFile(0,1) write $TOP } # Get Reports runtime version if grepDir(catDir($top,'config','reports','bin'),'^rwrun(\.bat|\.sh)?$','ip') var ($cmd) = (last) else var $cmd = undef if $cmd {write '---+ Current runtime version of reports' call loadCommand(concat(quote($cmd,'x'),' \?')) call writeLastFile(0,1) write $TOP } # Determine latest patch applied var $dir = catDir($ORACLE_HOME,'lib') prefix write '---+ List of librw files to see PRE_patch suffix' call statFile('b',reverse(grepDir($dir,'^librw','inr'))) if hasOutput(true) write $TOP # Determine base installed version prefix write '---+ Installed Version' var $dir = catDir($ORACLE_HOME,'inventory','Components21') loop $nam ('oracle.developer.forms.compiler',\ 'oracle.developer.forms.builder') {var $cmp = catDir($dir,$nam) next !testDir('d',$cmp) write '---## Using $ORACLE_HOME/inventory/Components21/',$nam,\ ' to determine initially installed version' call statDir('n',$cmp) break } loop $nam ('oracle.reports.core','oracle.reports.builder') {var $cmp = catDir($dir,$nam) next !testDir('d',$cmp) write '---## Using $ORACLE_HOME/inventory/Components21/',$nam,\ ' to determine initially installed version' call statDir('n',$cmp) break } if hasOutput(true) write $TOP toc '2:[[',getFile(),'][rda_report][Versions]]' # Restore the abbreviation call setAbbr($abr) } =head2 S This macro collects Oracle Forms-related configuration and log files. =cut macro collect_forms_instance {var ($dsc,$top,\%cmp) = @arg import $TAIL debug ' - Getting Oracle Forms configuration and log files' var $abr = setAbbr() var $pre = concat('^',quote($top),'\b') pretoc '2:Oracle Forms' loop $key (keys(%cmp)) {var ($typ,$cmp) = split('\|',$key,2) next !match($typ,'^FormsRuntimeInfo$',true) var $typ = 'FormsComponent' debug ' - ',$cmp,' component' call setAbbr(concat($abr,'i_',$dsc,'_c_',$cmp)) pretoc "3:'",$cmp,"' Forms Component" # Get Forms files pretoc '4:Forms Files' call get_file(catFile(\ $top,'config',$typ,$cmp,'admin','resource','US','fmrweb.res'),0,'res_',5) unpretoc # Get Forms server files pretoc '4:Forms Server Files' call get_file(catFile($top,'config',$typ,$cmp,'registry','oracle','forms',\ 'registry','Registry.dat'),\ 0,'reg_',5) unpretoc # Collect the configuration files pretoc '4:Configuration Files' call sort_results(5,$TAIL,$pre,'$OI',\ grepDir(catDir($top,'config',$typ,$cmp,'server'),\ '(\.cfg$|\.conf$|\.env$|\.htm$|\.properties$|\.xml)','ipn')) unpretoc # Collect the log files pretoc '4:Log Files' call sort_results(5,$TAIL,$pre,'$OI',\ grepDir(catDir($top,'diagnostics','logs',$typ,$cmp),'\.log$','dir')) # Get forms/trace directory contents var $dir = catDir($top,$typ,$cmp,'trace') loop $fil (grepDir($dir,'^\.+$','irvt')) call get_file($fil,0,'trc_',5) unpretoc 2 } unpretoc call setAbbr($abr) } =head2 S This macro collects Oracle Reports-related configuration and log files. It lists the files in F directory. It collects the Reports Diagnostic Tool results. =cut macro collect_reports_instance {var ($dsc,$top,\%cmp) = @arg import $TAIL debug ' - Getting Oracle Reports configuration and log files' var $abr = setAbbr() var $pre = concat('^',quote($top),'\b') pretoc '2:Oracle Reports' var $dir = catDir($top,'config','ReportsBridgeComponent') loop $nam (grepDir($dir,'^[^\.]','n')) {if testDir('d',catDir($dir,$nam)) var @tmp = (@tmp,join('|','ReportsBridgeComponent',$nam)) } loop $key (keys(%cmp),@tmp,'ReportsToolsComponent|ReportsTools') {var ($typ,$cmp) = split('\|',$key,2) next !match($typ,'^(Reports(Bridge|Server|Tools))Component$',true) var ($txt) = last debug ' - ',$cmp,' component' call setAbbr(concat($abr,'i_',$dsc,'_c_',$cmp)) pretoc "3:'",$cmp,"' ",$txt,' Component' # Collect the configuration files pretoc '4:Configuration Files' call sort_results(5,$TAIL,$pre,'$OI',\ grepDir(catDir($top,'config',$typ,$cmp),'\.(conf|properties|xml)$','dir')) unpretoc # Collect the log files pretoc '4:Log Files' call sort_results(5,$TAIL,$pre,'$OI',\ grepDir(catDir($top,'diagnostics','logs',$typ,$cmp),'\.log$','dir')) unpretoc 2 } # List of files in $OI/reports/server directory call setAbbr(concat($abr,'i_',$dsc)) report repsvrfile prefix write '---+!! List of Files in $OI/reports/server Directory' call statDir('at',catDir($top,'reports','server')) if isCreated(true) toc '3:[[',getFile(),'][rda_report][$OI/reports/server Files]]' # Collect the Reports Diagnostic Tool results report rwdiag var $bin = catDir($top,'config','reports','bin') var ($cmd) = grepDir($bin,'^rwdiag(\.bat|\.sh)?$','ip') if $cmd {prefix {write '---+ Reports Diagnostic Tool Results' write '---## Using: ',encode($cmd),' -findAll 2>&1' } call writeCommand(concat(quote($cmd,'x'),' -findAll 2>&1')) if isCreated(true) toc '3:[[',getFile(),'][rda_report][Reports Diagnostic Tool Results]]' } unpretoc # Restore the report abbreviation call setAbbr($abr) } =head1 SEE ALSO L,L =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