# S367JDEV.def: Collects Oracle JDeveloper Information # $Id: S367JDEV.def,v 2.8 2012/01/20 11:13:19 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/S367JDEV.def,v 2.8 2012/01/20 11:13:19 mschenke Exp $ # # Change History # 20120118 KRA Extend collection. =head1 NAME S367JDEV - Collects Oracle JDevloper Information =head1 DESCRIPTION This module collects Oracle JDeveloper-related diagnostic information. The following reports can be generated and are regrouped under C: =head1 REPORTS =cut echo tput('bold'),'Processing JDEV module ...',tput('off') # Initialization var $JDEV_HOME = getSetting('JDEV_HOME','') var $MW_HOME = getSetting('JDEV_MW_HOME','') var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' toc '1:Oracle JDeveloper' # Load the libraries run library() # Set the current target call setCurrent(addTarget('OH_JDEV',{ORACLE_HOME=>$JDEV_HOME})) if ?${JDEV_REQ_WREQ} call setSymbol('$MH',$MW_HOME) =head2 abbr - Abbreviations Displays the RDA abbreviations defined for the Oracle JDeveloper home collection. =cut debug ' Inside JDEV module, collecting defined abbreviations' report abbr prefix {write '---+ Oracle JDeveloper Home Abbreviations' write '|*Abbreviation*|*Location*|' } var %hsh = getSymbols() loop $key (keys(%hsh)) write '|',$key,' |',catDir(@{$hsh{$key}}),' |' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Abbreviations]]' =head2 env - Environment Variables Collects important environment variables. =cut debug ' Inside JDEV module, collecting important environment variables' report env write '---+ Important Environment Variables' write '|*Variable*|*Value*|' loop $key ('JDEV_USER_DIR','JDEV_USER_HOME') write '|',$key,' |',getEnv($key),' |' toc '2:[[',getFile(),'][rda_report][Environment Variables]]' =head2 jdk_version - JDK Version For version 11g and later, determine the available JDK version. =cut # Macro to get the JDK version macro get_jdk_version {var ($dir,$ttl) = @arg import $TOP keep $TOP if testFile('fx',$cmd = catFile($dir,'bin',${AS.EXE:'java'})) {write '---+ ',$ttl write '---## JDK Location: ',encode(addSymbol($cmd)) call statFile('b',$cmd) write '---++!! JDK Full Version' call writeCommand(concat(quote($cmd,'x'),' -fullversion 2>&1')) write $TOP } } debug ' Inside JDEV module, gathering JDK version' report jdk_version title '---+!! JDK Version Information' title $TOC if grepFile(catFile($JDEV_HOME,'.product.properties'),\ '^JDEV_JAVA_HOME=\s*(.*)\s*$','f1') call get_jdk_version(first(last),'JDeveloper IDE') call get_jdk_version(first(findDir($MW_HOME,'^jdk','p')),\ 'OFM Environment (jdk)') call get_jdk_version(first(findDir($MW_HOME,'^jrockit_','p')),\ 'OFM Environment (jrockit)') if !hasOutput(true) write '**No JDK found.**' toc '2:[[',getFile(),'][rda_report][JDK Version]]' =head2 adf_version - ADF Runtime Version Determines the ADF runtime version information. =cut if findCommand('java') {var $cmd = last debug ' Inside JDEV module, gathering ADF runtime version' if or(testFile('fr',catFile($MW_HOME,'oracle_common','modules',\ 'oracle.adf.model_11.1.1','adfm.jar')),\ testFile('fr',catFile($JDEV_HOME,'BC4J','lib','bc4jmt.jar'))) {var $cmd = concat($cmd,' -cp ',lastCommand(),\ ' oracle.jbo.common.PrintVersion') report adf_version prefix {write '---+ ADF Runtime Version Information' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) toc '2:[[',getFile(),'][rda_report][ADF Runtime Version]]' } } =head2 Installation Files For Oracle JDeveloper 11g and later, gathers following JDeveloper installation files: =over 4 =item o F<$JDEV_HOME/.home> =item o F<$JDEV_HOME/.product.properties> =item o F<$MW_HOME/registry.xml> =item o F<$MW_HOME/logs/log.txt> =back =cut debug ' Inside JDEV module, gathering JDeveloper installation files' pretoc '2:Installation Files' call sort_files(3,0,catFile($JDEV_HOME,'.home'),\ catFile($JDEV_HOME,'.product.properties'),\ catFile($MW_HOME,'registry.xml'),\ catFile($MW_HOME,'logs','log.txt')) unpretoc =head2 Script Files Collects the script files from the following directories: =over 4 =item o F<$JDEV_HOME/ide/bin> =item o F<$JDEV_HOME/jdev/bin> =back =cut debug ' Inside JDEV module, gathering script files' pretoc '2:Script Files' call sort_files(3,0,grepDir(catDir($JDEV_HOME,'ide','bin'),'^\.+$','npv'),\ grepDir(catDir($JDEV_HOME,'jdev','bin'),'^\.+$','npv')) unpretoc =head2 Oracle JDeveloper Libraries Lists the Oracle JDeveloper libraries present in the following directories: =over 4 =item o F<$JDEV_HOME/jdev/extensions> =item o F<$JDEV_HOME/jdev/lib> =item o F<$JDEV_HOME/jdev/lib/patches> =item o F<$JDEV_HOME/soa/modules> =item o F<$JDEV_HOME/uddi/lib> =item o F<$JDEV_HOME/webservices/lib> =back =cut # Macro to list the files macro stat_files {var ($lvl,$rpt,$dir,$pat,$opt) = @arg import $TOC,$TOP keep $TOC,$TOP report concat('lib_',$rpt) title '---+!! Information Taken from ',encode($dir) if compare('eq',$rpt,'soa_modules') {title $TOC loop $sub (findDir($dir,'^\.+$','npv')) {prefix write '---+ ',encode(addSymbol($sub)) call statFile('b',grepDir($sub,nvl($pat,'\.jar$'),nvl($opt,'inp'))) if hasOutput(true) write $TOP } } else {call statFile('b',grepDir($dir,nvl($pat,'\.jar$'),nvl($opt,'inp'))) if hasOutput(true) write $TOP } if isCreated(true) toc $lvl,':[[',getFile(),'][rda_report][',encode(addSymbol($dir)),']]' } debug ' Inside JDEV module, listing the jdeveloper libraries' pretoc '2:Oracle JDeveloper Libraries' call stat_files(3,'jdev_extn',catDir($JDEV_HOME,'jdev','extensions')) call stat_files(3,'jdev',catDir($JDEV_HOME,'jdev','lib')) call stat_files(3,'jdev_patch',catDir($JDEV_HOME,'jdev','lib','patches')) call stat_files(3,'soa_modules',catDir($JDEV_HOME,'soa','modules')) call stat_files(3,'uddi',catDir($JDEV_HOME,'uddi','lib')) call stat_files(3,'webservices',catDir($JDEV_HOME,'webservices','lib')) unpretoc =head2 ide_extn - IDE Extensions Overview Lists the Oracle JDeveloper IDE extension files from the F<$JDEV_HOME/ide/extensions> directory. =cut debug ' Inside JDEV module, listing the IDE extensions' var $dir = catDir($JDEV_HOME,'ide','extensions') report ide_extn prefix write '---+ Oracle JDeveloper IDE Extensions Overview' call statDir('n',$dir) if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][IDE Extensions Overview]]' } =head2 ide_macro - IDE Macros Overview Lists the Oracle JDeveloper IDE macro files from the F<$JDEV_HOME/ide/macros> directory. =cut debug ' Inside JDEV module, listing the IDE macros' var $dir = catDir($JDEV_HOME,'ide','macros') report ide_macro prefix write '---+ Oracle JDeveloper IDE Macros Overview' call statDir('n',$dir) if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][IDE Macros Overview]]' } =head2 manifest - Manifest Information Extracts the manifest from F<$JDEV_HOME/BC4J/lib/bc4jc.jar> when F is available. This is applicable for Oracle JDeveloper 10.1.3 and earlier. =cut if testFile('f',catFile($JDEV_HOME,'BC4J','lib','bc4jct.jar')) {if findCommand('unzip') {var $cmd = last report manifest debug ' Inside JDEV module, extracting the manifest' var $cmd = concat($cmd,' -p ',lastCommand(),' META-INF/MANIFEST.MF') prefix write '---+ Manifest Information' call writeCommand($cmd) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Manifest Information]]' } } =head2 Oracle WebLogic Server Domain Information It includes all reports produced by the WREQ module for the specified Oracle WebLogic Server domain (applicable for version 11g and later). =cut toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Oracle WebLogic Server Overview")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_JDEV_TOP.toc")%' toc '%POP2%' toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Oracle WebLogic Server Domain")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_JDEV_DOM.toc")%' toc '%POP2%' # Restore the default target call setCurrent() =head1 SEE ALSO L =begin credits =over 10 =item RDA 4.17: Anjani Sankar, Miguel Hernandez. =item RDA 4.27: Miguel Hernandez, Yogesh Sontakke. =back =end credits =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