G4ZFE Log Search applet ================== The Log search applet is a Java applet that allows on-line searching of your contest or DX-pedition logs. The applet and logs (in an optimised format) are located on your web site. The Java applet is run by a web browser which searches the server's log files for the requested callsign. The results of the search are then displayed on the web browser. I use the applet to allow the M6A and M7A contest logs to be searched. An example of the use of this applet is the M7A Log Book search page (http://www.babbage.demon.co.uk/searchm7a.html) This ZIP file should contain the following files: o readme.txt - this file o search.class - applet file o search.html - example of how to use the applet o example1.log - example log format (ASCII format) o example2.log - example log format (prt format) o example3.log - example log format (ADIF format) o example4.log - example log format (Cabrillo format) o sortlog.zip - sortlog program for processing logs Features ----------- o Can be used on any web site (as no CGI scripts are used); o Log files are optimally stored to reduce download time and provide fast search times; o Allows wildcard searches; o Source code available. Log File format ------------------ The log search program uses an ASCII log file sorted and split up into 36 ("A.TXT" to "Z.TXT" and "0.TXT" to "9.TXT") files. These files are sorted according to the first letter of the callsign. For example this is part of a "L.TXT" file: 24-NOV-96 2036 40 CW LA1K 24-NOV-96 0307 160 CW LA2KD 23-NOV-96 0113 160 CW LA2O 23-NOV-96 0306 80 CW LA2O Note that only the date, time, band, mode and callsign fields are stored. This is to speed up the search and also to reduce disk space on the server. To produce these files I have written a 'C' program to do the parsing, sorting and writing of the .TXT files. The input file for conversion can be in any of the following formats: o Cabrillo (see example4.log) o ADIF (see example3.log file); o Printer output file (see example2.log file); o ASCII log file (see example1.log file). To use the program: a. Extract the sortlog.zip file which contains the sortlog.exe program. b. Run the program "sortlog example1.log" By default the log files produced will contain date and time information. If you do not wish this information to be available then use the -nodate and -notime switches. For example if you do not wish date information to be saved use "sortlog -nodate example1.log" If you do not want date or time information, use "sortlog -nodate -notime example1.log" c. Copy the .TXT files produced to your server (including the empty files!). As the files produced have the same names it is a good each to create a sub-directory on the server for each log. If you have problems or are unsure of the above then e-mail your logs (zipped up in MIME or uuencoded format) to richard@babbage.demon.co.uk and I'll e-mail the formatted files back to you. Why is this strange file format used? ----------------------------------------------- It is possible just to store the ASCII log on the server and use it instead of the .TXT files. However as the search program reads the log file from the server then the *whole* of the log file would need to be transferred. For example, the M6A 1996 CQ WW CW log contains 3100 QSOs and even with the minimum amount of data is still 100K which would take a few minutes to download. Splitting the files up mean that a much smaller amount of data needs to be transferred which reduces both the download and search times. How to use the applet ---------------------------- An example will be used to demonstrate how to use the applet. The example is for G4ZFE, with a web site URL of "www.myisp.co.uk/~g4zfe",and logs for 1997 Maldives DX-pedition; 1997 IARU contest; 1997 Field Day; 1. The following example HTML page (search.html) illustrates how to use the applet: ------------------------------- cut here --------------------------------------------- G4ZFE Log Search Page

G4ZFE Log Search Page

Please use this applet to search the logs of my latest DX-peditions and contest logs.

Sorry but the search applet requires a java aware browser. ------------------------------- cut here --------------------------------------------- Note: a. The parameters "log1Name" to "log3Name" are used to name the checkboxes in the GUI. There can currently be a maximum of 6 such checkboxes in this applet. b. The parameters "URL1Name" to "URL3Name" specify the location on the server where each of the logs are to be found. Note in this case a directory "logs" has been created with a sub-directory (e.g "97iaru") for each of the log files. Note that the "/" character at the end of the URL is required. 2. Upload the files to your site. The filenames are case sensitive and should all be transferred in binary mode. Both files should be in the same directory on your site. a. search.html; b. search.class; 3. Create a directory called "logs" on your web server. Under the "logs" directory create four sub-directories - "8Q7FE", "97iaru" and "97fd". Note that the directory names are (usually) case sensitive. 4. Convert the 8Q7FE logs (in the file "8Q7FE.log"). For example, at the DOS prompt type "sortlog 8Q7FE.log". 36 files ('A.TXT' to 'Z.TXT' and '0.TXT' to '9.TXT') will be created. 5. Upload the created .TXT files to the "logs/8Q7FE" directory on the server. Ensure that the filenames stored are either all lowercase or all uppercase and not a mix. (Tip: if you are using a command line FTP client program type "prompt y" and then "mput *.TXT" to automate the process). 6. Repeat the above two steps for the 97iaru and 97fd logs. 7. Test the applet on-line. Frequently Asked Questions ------------------------------------ 1. I get an error "applet search can't start: class search not found" This error message appears on the Web browser's status screen. It means that the Log Search java applet could not be found on your web server. The search.class file must be in the same directory as your search HTML page (unless you have used the CODEBASE applet parameter). Also ensure that you transferred the search.class file in binary mode to your web server. Some web servers are case-sensitive so ensure that the search.class filename is of the correct case. 2. When I search for a callsign the following is displayed: "Starting search Sorry .. not found! Search completed ... 0 QSOs found" This message is caused by one of the following: a. The log files not being stored in the correct directory on the web server. e.g. the following applet parameter indicates where the files are on the server: Using the above example opening the URL "http://www.myisp.co.uk/~g4zfe/logs/8Q7FE/G.TXT" should display all the stations beginning with "G" that were worked in the 8Q7FE expedition. If your web browser displays an error (e.g. File not found) that the data files have not been transferred correctly and this is the cause of the problem. b. A firewall/proxy server between yourself and the Internet. With Netscape Navigator 4.0 (Release version) add the following line to your prefs.js file: user_pref("security.lower_java_network_security_by_trusting_proxies", true); 3. When I search for a callsign the following is displayed: Starting search Error whilst reading contest log file.. Search completed ... 0 QSOs found This message is caused by incorrectly formatted log files: Check this by opening a data file as shown above and check that the line looks similar to the example. If not then you have probably found a bug in the sortlog program used to generate the data files. Please let me know so that I can fix it! Comments, bugs and suggestions to richard@babbage.demon.co.uk Richard Everitt, G4ZFE