home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Sample.bin
/
ReadMe.txt
< prev
next >
Wrap
Text File
|
1998-10-16
|
8KB
|
190 lines
WebLogAnalyzer ReadMe File
------------------------------------------------------------------------------
To run the WebLogAnalyzer program:
- open a DOS window
- go to the web log analyzer's directory
- go to the "class" subdirectory
- enter: "java WebLogAnalyzer"
NOTE: To run the java versions Visual Cafe, the java runtime (JRE), or development kit (JDK)
must be properly installed on your system.
------------------------------------------------------------------------------
CONTENTS
1. What this application does.
2. What this application demonstrates.
3. How this application was written.
4. Application classes and interfaces.
5. Limitations and known problems.
------------------------------------------------------------------------------
1. What this application does.
This application analyzes log files created by web servers and displays
interesting usage statistics. The supported log file formats are "Common Log
File" format and "Extended Log File" format. Most web servers can generate
log files in these formats.
------------------------------------------------------------------------------
2. What this application demonstrates.
This application demonstrates the following:
- Writing a java application (not an applet).
- Using Visual Cafe to easily design an application's look, without writing code.
- Using Visual Cafe to specify the basic interaction of the application's components.
- Using the TabPanel component, including data validation.
- Using the Wizard component, including data validation.
- Using KLGroup's JCChartComponent and JCTableComponent.
- Using a simple custom layout manager.
- Displaying a "splash" window while the program initializes in the background.
- Using java's Serializable interface to save program data and state.
- Separating UI code from application "meat" code.
- Using (and cancelling) a thread running in tandem with the UI.
- Date & time handling using java's Date, Calendar, and DateFormat classes.
- Network access using java's URL and URLConnection classes.
- Creating a native Windows EXE from a Java application.
------------------------------------------------------------------------------
3. How this application was written.
This application was written using Symantec Visual Cafe.
First the UI was created, starting with a "Basic Progam" project. Dialogs and
components were added visually until the proper "look" was achieved. Then
interactions between components were specified using the Interaction Wizard.
At this point we had a good "demo" of the program! You could run the program
and operate its controls to see how the program was going to work, but nothing
would actually happen (i.e. new reports weren't memorized, etc). At this point
it was time to add the "meat" code.
Finishing up the program consisted of writing the non-UI classes and doing
minor customization of a few of the UI classes. Non-UI classes were created
for the "things" the program manipulates (reports, log files). A top-level
Data class was written to both contain the program-global options and also
the list of user reports. Using java serialization to read/write this top-level
non-UI class was a simple way of implementing an "ini" file that remembers all
of the user's settings.
Creating a native Windows version was the easiest part of all. The appropriate
project option was selected and then the project was rebuilt. Presto!
------------------------------------------------------------------------------
4. Application classes.
UI Classes
----------
AboutDialog
This is a typical "about" dialog. It displays information about the program,
including version and copyright.
AlertDialog
This dialog is used to alert the user of some unexpected occurance.
It displays the message passed to it when it is created and can either display
both an OK and CANCEL button, or just an OK button.
AnalyzeDialog
This dialog is displayed while the program analyzes a log file.
It displays the progress to the user, and allows the user to cancel the
analysis at any time. The analysis itself is run as a separate thread created
and controlled by this dialog.
EditReportDialog
This is a tabbed dialog that allows the user to change the options of a web
log report. The fields are the same as the NewReportDialog, but it is a
tabbed dialog, not a Wizard. Ensuring that the field names are identical
in both the EditReportDialog and NewReportDialog has allowed copying and
pasting some code between the two.
NewReportDialog
This is a wizard that leads the user through creating a new web log report.
This class includes a simple extension of the SimpleWizardController for data
validation. The fields are the same as the EditReportDialog, but it is a Wizard,
not a tabbed dialog. Ensuring that the field names are identical in both the
EditReportDialog and NewReportDialog has allowed copying and pasting some
code between the two.
OptionsDialog
This dialog displays/edits options that are program-global (don't apply to
one specific report).
ReportLayout
This is a simple LayoutManager. It is used by the ReportViewFrame to layout
report elements in a single column.
ReportViewFrame
This window displays a report. It uses the ReportLayout class to arrange the
report elements in a single column.
SplashDialog
This is the first window the program displays. It shows the program name and
copyright. While it is being displayed, the program initializes itself in the
background. It also ensures the copyright is displayed for a certain minimum
length of time, even if program initialization is done early.
WebLogAnalyzer
This is the application's main frame and contains the program's entry point,
the static "main()" method. The program displays a list of reports defined by
the user and some buttons to perform common operations.
WLAUtil
This is an all-static general utility class for both UI and non-UI code.
Being all-static, it never get instantiated.
Non-UI Classes
--------------
Analyzer
This is the thread that runs reports. It operates at the same time as the
standard UI thread. Progress is reported to the UI code via the TrackProgress
interface. It also provides the mechanism for safe thread cancelling.
Note: It is usually not safe to call the Thread.stop() method, as
randomly stopping execution in a thread may leave "damaged" objects
(objects in an inconsistent state).
Data
This is the top-level data object. Only one of these is instantiated.
It is Serializable, and gets stored as the program's "ini" file.
LogFile
This represents a log file. It has code to read and parse the log file. Results
from parsing are stored in an array of LogRecord.
LogRecord
This is the information contained in one line of the parse log. LogRecords are
created in the LogFile's parsing code then saved there.
ParseLogException
This is an exception that indicates a problem occured while parsing a log file.
Report
This contains the information on one report. It has both the report options as
specified by the user, and the report results. Its run() method does the
actual log file analysis.
Interfaces
----------
Sortable
This interface is implemented by objects that are to be quicksorted.
TrackProgress
This interface is used by the non-UI "meat" code to communicate with the UI code
about the state of the web log analysis. It allows the non-UI code to
communicate to the UI code without knowing any of the UI details.
------------------------------------------------------------------------------
5. Limitations and known problems.
- Limitations due to Sun's FTP protocol handler
- Only anonymous FTP access allowed. This means you typically can't access
your server area with the logs in it as they rarely allows anonymous access.
- Design decision: The parsed log file is not stored when the user quits
the program. So, upon re-running and changing some report parameter,
re-analyzing the report always requires re-reading the log file.