# OCS.def: Defines Common Oracle Collaboration Suite Macros # $Id: OCS.def,v 1.9 2008/02/25 17:32:55 mschenke Exp $ # ARCS: $Header: /home/cvs/repository/RDA_4/src/scripting/lib/modules/OCS.def,v 1.9 2008/02/25 17:32:55 mschenke Exp $ # # Change History # 20080225 MSC Change the copyright notice. =head1 NAME MAIL - Defines Common Oracle Collaboration Suite Macros =head1 DESCRIPTION This persistent sub module regroups macros that are common to several Oracle Collaboration Suite modules. The following macros are available: =cut # Make the module persistent and share macros keep $KEEP_BLOCK,@SHARE_MACROS var @SHARE_MACROS = ('get_log','get_last_log') =head2 S This macro collects the last lines of of log file. When you do not specify a number of lines, RDA collects the whole log file. =cut # Get the log file macro get_log {var ($dir,$nam,$lin) = @arg debug ' Inside get_log, looking for ',$nam,' in ',$dir import $TOP var $fil = catFile($dir,$nam) if testFile('f',$fil) {if $lin {write '---+ Last ',$lin,' Lines of ',$nam,' File' write '---## Information Taken from ',$fil call writeTail($fil,$lin) } else {write '---+ Display of ',$nam,' File' write '---## Information Taken from ',$fil call writeFile($fil) } write $TOP } } =head2 S This macro lists the directories present, lists the content of the most recent directory, and collects the log file from the most recent directory. =cut macro get_last_log {var ($dir,$age,$lin) = @arg debug ' Inside get_last_log, looking most recent log in ',$dir import $TOC,$TOP # Get the directory list var @dir = grepDir($dir,'^\d+$',concat('ptm',$age)) write '---+ Most Recent Directories' if !@dir {write 'No changes in ',$dir,' during ',$age,' last days' return } write 'In ',$dir,'%BR%Limited to ',$age,' last days' call statFile('b',@dir) write $TOP # Get the last directory content var $dir = $dir[0] write '---+ Last Directory Content' call statDir('n',$dir) write $TOP # Get the log file call get_log($dir,concat(basename($dir),'.log'),$lin) call get_log($dir,'text.log',$lin) } =head1 COPYRIGHT NOTICE Copyright (c) 2002-2008, 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