Ozibug - web based bug tracking


  1. Introduction
  2. Requirements
  3. Software Installation
  4. Configure the build.xml file
  5. Configure the reports file
  6. Create an Ozibug report
  7. Schedule the Report
Back to index
 

You can use your computer to automatically execute an Ozibug report and have it emailed to you.

When using Unix or Linux machines this is done using the crontab and cron commands. When using Windows machines this is done using the at command or through the task scheduler utility.

The uses for being able to do this are endless. You can get a summary of new bugs emailed to you every Monday morning or perhaps you want to schedule a nightly custom XML report and integrate this into other XML aware products.

The following sections will take you through the steps to schedule a report.

Back to top
 

You will need some additional packages to be able to schedule your reports. A Java installation, the ANT package, and some additional common jars from freely available software.

  1. Java

    This is the java execution environment. It is probably already installed on your computer and may either be the JDK or JRE. If not it can be downloaded from Sun Microsystems.

  2. ANT

    This is a Java build tool which is used to run various combinations of tasks in a platform independent manner. It can be downloaded from the ANT Apache website.

  3. JavaMail

    This is a commonly used software library required to enable the sending of email. It can be downloaded from Sun Microsystems.

  4. JAF

    This is a commonly used software library required to enable the sending of email. It can be downloaded from Sun Microsystems.

Back to top
 

Download the required software and install it, the following example shows a Win32 example where the software is installed into C:\.

Also you need to create a directory for your report and ANT scripts. Call this directory reports.

C:\> mkdir reports
C:\> dir

 Volume in drive C is Local Disk
 Volume Serial Number is C433-97A1

 Directory of C:\

12/03/2003  01:15p      <DIR>          Documents and Settings
15/08/2003  08:27a      <DIR>          jakarta-ant
23/07/2003  02:50p      <DIR>          jdk1.3.1
29/08/2003  10:05a      <DIR>          javamail
11/07/2003  10:40a      <DIR>          jaf
11/07/2003  10:40a      <DIR>          reports
24/07/2003  07:29p      <DIR>          Program Files
04/01/2001  03:24p                   0 tempfile.tmp
29/08/2003  10:05a      <DIR>          WINNT

               3 File(s)          2,814 bytes
              16 Dir(s)     989,974,528 bytes free

C:\>
Back to top
 

Download the build.xml file, place it into the reports directory and open it in your favourite editor.

You'll need to edit the file to reflect your configuration.

  1. from.name

    Set this property to the full name of the person you wish the emailed report to be sent from.

    <property name="from.name" value="Report Master" />
                              
  2. from.address

    Set this property to the email address of the person you wish the emailed report to be sent from.

    <property name="from.address" value="nobody@your-domain.com" />
                              
  3. host

    Set this property to the fully qualified hostname of the server where your Ozibug is located.

    <property name="host" value="host.your-domain.com" />
                              
  4. port

    Set this property to the port of the server where your Ozibug is located. Note: this should contain a leading colon if it is set. If your port is the default (80) then this property should have the value of "".

    <property name="port" value=":8080" />
                              
  5. context

    Set this property to the context of your Ozibug (this is usually ozibug.)

    <property name="context" value="ozibug" />
                              
  6. mailhost

    Set this property to the fully qualified address of your mailserver.

    <property name="mailhost" value="mail.your-domain.com" />
                              
  7. key

    Set this property to the value of the key parameter. The authentication key can be obtained from the key link Show key for single access authentication on the Maintain User page. It is also displayed in the address bar of your browser when you create a report in Ozibug and then select the orange XML button. There is more information on this in the Create an Ozibug report section.

    <property name="key" value="Zgv2ZWxvcGVy%3Ac3loSjR0RjAvWjdPNw%3D%3D" />
                              
Back to top
 

Download the reports.bat file for Win32 platforms or reports.sh for Linux or Unix platforms. Place the file into the reports directory and open it in your favourite editor.

You'll need to edit the file to reflect your configuration.

Win32 - reports.bat

  1. JAVA_HOME

    Set this variable to the directory where you installed Java into.

    set JAVA_HOME=C:\jdk1.3.1
                              
  2. ANT_HOME

    Set this variable to the directory where you installed ANT into.

    set ANT_HOME=C:\jakarta-ant
                              
  3. CLASSPATH

    Set this variable to include the jars of the JavaMail and JAF packages.

    set CLASSPATH=C:\javamail\mail.jar;C:\jaf\activation.jar
                              

Linux/Unix - reports.sh

  1. JAVA_HOME

    Set this variable to the directory where you installed Java into.

    JAVA_HOME="/opt/jdk"
                              
  2. ANT_HOME

    Set this variable to the directory where you installed ANT into.

    ANT_HOME="/opt/jakarta-ant"
                              
  3. CLASSPATH

    Set this variable to include the jars of the JavaMail and JAF packages.

    CLASSPATH="/opt/javamail/mail.jar:/opt/jaf/activation.jar"
                              
Back to top
 

Log into Ozibug as the user that you wish to run the report as. Now go to the reports page View reports and create your report as normal and save it with a sensible name. Once created you should verify the report can be run normally and produces the required results in your browser.

You can now select the RSS outputType and then the orange XML button Get the RSS friendly (XML) source of this report which will give you an XML format of your report. It should display in a separate browser window and at the end of the URL you should be able to see the key parameter. You can use this parameter to set a property in the build.xml file. Simply cut and paste just the parameter value into the file.

In the following example URL the key section that you can cut and paste has been highlighted.

http://localhost/ozibug/Controller?action=reports.Reports&report=Default&key=ZGV2ZWxvcGVy%3Ac3loSjR0RjAvwJDpnw%3D%3D
Back to top
 

You can now schedule the report from the command line or from the task scheduler. The task scheduler is the recommended way as it allows you to assign the proper permissions and set a fine tuned schedule for the report.

The parameters that can be specified to the reports.bat script are as follows.

  1. Ozibug report name, space characters should be changed to %20 so the report called All New would become All%20New.
  2. Mail recipient name, pass in as a quoted value ie., "Fred Jones". Note that this parameter is optional.
  3. Mail recipient address ie., fred@jones.com

Windows Platforms

From the command window you can now schedule the report batch file to run using the at command. You may wish to wrap the command line in another batch file to add additional directions such as working directory or multiple reports, etc.

rem ****************************************************************************
rem *
rem * File:        C:\reports\wrapper.bat
rem *
rem * Description: wrapper script for executing one or more reports
rem *
rem ****************************************************************************

rem *
rem * change to the correct drive
rem *
C:

rem *
rem * change to the correct directory
rem *
cd reports

rem *
rem * now execute the report commands
rem *
reports.bat Default "Fred Jones" fred@jones.com
reports.bat All%20New "Fred Jones" fred@jones.com

The script can now be scheduled as follows. This command schedules the execution to occur just one time at 5:30 PM.


C:\> at 17:30 C:\reports\wrapper.bat

Added a new job with job ID = 1

C:\> at

Status ID   Day                     Time          Command Line
-------------------------------------------------------------------------------
        1   Today                   5:30 PM       C:\reports\wrapper.bat

C:\>
                      

Linux and Unix Platforms

When using Linux or Unix the scheduling can be done with the at or crontab commands in a very similar manner to that described above. First create a text crontab file which contains your comands to schedule, it will look similar to the following.

################################################################################
#
# File:        ${HOME}/eric.crontabs
#
# Description: crontab file used to schedule events
#
#***************************************************************************

#
# schedule the Default report at 5 minutes past midnight every day
#
5 0 * * *   /opt/reports/reports.sh Default   "Fred Jones" fred@jones.com

#
# schedule the "All New" report every weekday morning at 7 AM
#
0 7 * * 1-5 /opt/reports/reports.sh All%20New "Fred Jones" fred@jones.com

Now you can add the commands in this file to the scheduler with the following command.


$ crontab ${HOME}/eric.crontabs
                      

To list your scheduled commands issue the following command.


$ crontab -l

################################################################################
#
# File:        ${HOME}/eric.crontabs
#
# Description: crontab file used to schedule events
#
################################################################################

#
# schedule the Default report at 5 minutes past midnight every day
#
5 0 * * *   /opt/reports/reports.sh Default   "Fred Jones" fred@jones.com

#
# schedule the "All New" report every weekday morning at 7 AM
#
0 7 * * 1-5 /opt/reports/reports.sh All%20New "Fred Jones" fred@jones.com
                      
Back to top
 
Back to index