<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
<book><bookinfo>
<title>Geodetic Data Modeling System Internet Interface: Honors Thesis</title>
<authorgroup>

<author>
  <firstname>Michael</firstname>
  <surname>Still</surname>
  <affiliation><jobtitle>964076</jobtitle></affiliation>
</author>
</authorgroup>

<abstract><title>Abstract</title>
<para>
This document discusses the <command>GDMS Internet interface</command>. This interface allows remote access to the vast majority of the functionality available in the X Windows version of <command>GDMS</command>. The interface was developed in Perl, and uses the Common Gateway Interface (CGI) offered by most modern web servers to interact with the web browser.
</para>
</abstract>
</bookinfo>

<glossary><title>Glossary</title>
<para>
The following acronyms are used throughout this document.
</para>

<execute><cmd>insertall</cmd><args>builddb . "gloss-(.*).sgml"</args></execute>

</glossary>

<chapter id="ch01"><title>Introduction</title>
<sect1><title>Motivation</title>
<para>
At the time that the <command>Geodetic Data Modeling System</command> (GDMS) implementation project was initiated, several of the potential users expressed a desire for the application to be available over the Internet. There are a variety of reasons that this type of functionality is enticing. The primary reason for <command>GDMS</command> is that it allows casual users to ability to analyze data, whilst not having to maintain their own copies of the datasets. A secondary reason is that it allows users who would normally use the X windows interface to the application to access data whilst <quote>in the field</quote>, or otherwise physically separated from their normal research location.
</para>

<para>
Initially, it was thought that a Internet interface to <command>GDMS</command> was outside the achievable scope of the project for 2002. However, as the year progressed, it became clear to me that implementing a Internet interface was indeed achievable, and would add genuinely useful functionality to the application. Hence this honors extension was undertaken.
</para>
</sect1>

<sect1><title>Outcome</title>
<para>
This document describes the design process and implementation of the <command>GDMS Internet interface</command>, a Perl application intended to operate under the Common Gateway Interface (CGI) offered by most modern web servers, including Apache, which is the web server in use within the University of Canberra Survey Laboratory. This application allows the on line use of almost all of the functionality available under the X windows <command>GDMS</command> system.
</para>
</sect1>
</chapter>

<chapter><title>Implementation rationale</title>
<execute><cmd>builddb</cmd><input>weblanguage.sgml</input></execute>

<sect1><title>Presentation of the user interface</title>
<para>
In accordance with Internet user interface design best practice, the <command>GDMS Internet interface</command> presents a fully configurable user interface. This is implemented by providing extension tags above those which are available in the standard HTML specification (Raggett, Le Hors, &amp; Jacobs 1999).
</para>

<para>
The <command>GDMS Internet interface</command> follows the recommendations of the most recent HTML specification at the time of development for the insertion of scripting tags into HTML source files (Raggett, Le Hors, &amp; Jacobs 1999). Further documentation on the <command>GDMS Internet interface</command> tags available can be found in Appendix A of this document.
</para>
</sect1>

<execute><cmd>builddb</cmd><input>webgraphics.sgml</input></execute>

</chapter>


<chapter><title>Implementation</title>
<para>
This chapter discusses the actual application which was produced. The application is quite complex, with a series of pages being used to prompt the user and display information. The interaction of these different pages, each of which has a <quote>command</quote> associated with it, is shown in figure 3.2 below.
</para>

<para>
When the application starts, the command is not defined, as the user is unlikely to have specified one as part of the URL. This results in the <command>GDMS Internet interface</command> using the <emphasis>main</emphasis> command. The user is then presented with a welcome screen, which displays the message of the day. The message of the day in intended to be used to warn the users of the <command>GDMS Internet interface</command> of scheduled unavailability of the system, or new datasets having been added. There are no limits on the text that can be included in the message of the day however, so it could inform users of an impending Christmas party, or other equally unrelated events.
</para>

<figure><title>GDMS Internet interface welcome screen</title>
<execute><cmd>eqimg</cmd><args>gdmsii-welcome.png</args></execute>
</figure>

<figure><title>GDMS Internet interface command interaction</title>
<execute><cmd>eqimg</cmd><args>commands.png</args></execute>
</figure>

<para>
The message of the day is stored as a template named motd.html within the templates directory. See the configuration appendix of this document for more information about customizing this file.
</para>

<para>
The next operation that the user will perform is selecting a dataset to start processing. At this stage all other commands are disabled, because of a reliance on a dataset being available for processing. The user selects the <emphasis>open</emphasis> command, and a new page displaying a list of the available datasets is displayed. Once the user has selected one of the datasets from this list, a new page showing a plot of the selected dataset is displayed.
</para>

<figure><title>Selecting a dataset</title>
<execute><cmd>eqimg</cmd><args>gdmsii-open.png</args></execute>
</figure>

<figure><title>A dataset plot in the north direction (time domain)</title>
<execute><cmd>eqimg</cmd><args>gdmsii-plot.png</args></execute>
</figure>

<para>
It should be noted that at this time there is no way to configure the various graphing options offered by <command>GDMS</command> within the <command>GDMS Internet interface</command>. The recommended method for selecting the graphing style preferred by the users of the system is to run the <command>GDMS</command> X Windows application as the user id the web server runs as, and then copy the file ~/.cep to the same directory as the <command>GDMS Internet interface</command> executable. It should also be noted that at this time it is not possible to have individual graphing preferences for different users.
</para>

<para>
Now that the user has selected a dataset, the mathematical commands are now available. These may be selected from the same menu as the graphing commands, and include Least Squares regressions, windowing, interpolation, and Fast Fourier Transformations. All of the functionality available within the <command>GDMS</command> X Windows application is available for these mathematical operations.
</para> 

<para>
The <command>GDMS Internet interface</command> graphing subsystem also handles graphs in the frequency domain, in the same manner as the <command>GDMS</command> X Windows interface.
</para>

</chapter>



<chapter><title>Conclusion</title>
<para>
Based on the discussion in previous chapters, Perl CGI with PNG images were selected for the implementation of the <command>GDMS Internet interface</command>. This has resulted in a easy to understand code base, which will aid in future expansion of the application. The <command>GDMS Internet interface</command> should also correctly function with all modern web servers, including the Apache web server which is used by the University of Canberra Survey Laboratory.
</para>

<para>
There is some scope for future improvement of the <command>GDMS Internet interface</command>. This includes:
</para>

<itemizedlist>
<listitem><para>A web aware method of configuring graphing preferences.</para></listitem>
<listitem><para>Per user graphing preferences.</para></listitem>
<listitem><para>Allowing zooming on the dataset graphs in the same manner that the <command>GDMS</command> X Windows application allows.</para></listitem>
<listitem><para>Caching of processed datasets where it makes sense. Graphs are already cached.</para></listitem>
<listitem><para>Implementation of features as they are added to the <command>GDMS</command> X Windows application.</para></listitem>
</itemizedlist>

<para>
Overall, the <command>GDMS Internet interface</command> is a stable and reliable light weight interface to the <command>GDMS</command> batch interface.
</para>
</chapter>



<chapter><title>References</title>
<sect1><title>References</title>
<execute><cmd>insertall</cmd><args>builddb . "ref-.*"</args></execute>
</sect1>
</chapter>






<appendix><title>GDMS Internet interface scripting elements</title>
<sect1><title>Introduction</title>
<para>
This appendix documents the various tags which are implemented by the <command>GDMS Internet interface</command> in addition to the standard HTML tags normally available. All of these tags are within the scripting name space provided by HTML 4.01 (Raggett, Le Hors, &amp; Jacobs 1999).
</para>

<execute><cmd>insertall</cmd><args>builddb . "cmd-.*"</args></execute>
</sect1>
</appendix>

<appendix><title>Source code</title>
<execute><cmd>code2db</cmd><input>~mikal/opensource/cep/source/web/gdms.pl</input></execute>
</appendix>

<appendix><title>Installation</title>
<para>
To install the <command>GDMS Internet interface</command>, simply place it within your web servers CGI executable directory. Then work through the various options listed in the configuration file, and ensure that they are correct for your system. The most commonly incorrect settings are the paths to locations such as the temporary directory. These may be set to anything you desire, with the limitation that the plots directory <emphasis>must</emphasis> be accessible to the web server, as the images are served directly from this folder.
</para>

<para>
Note that no compilation of the <command>GDMS Internet interface</command> is required, as Perl is an interpreted language.
</para>

<para>
It is also important to ensure that all permissions are set correctly on the new directories to ensure that the web server remains secure. Consult your local system administrator for assistance.
</para>

</appendix>











<appendix><title>A sample configuration file</title>
<para>
This appendix details a sample configuration file for the <command>GDMS Internet interface</command>. This file should be stored in the same directory as the <command>GDMS</command> CGI script. It should also be noted that the <quote>.cep</quote> configuration file that would normally reside in a user's home directory should also be in the same directory as the <command>GDMS</command> CGI script.
</para>

<para>
The easiest way to create a suitable <quote>.cep</quote> configuration file is to run <command>GDMS</command> as any user, configure it so that you are happy with the graph output, and then copy that .cep file to the right location. Don't forget to update the permissions so that the user the web server is running as has read and write permissions on the file.
</para>

<para>
The same gdms.config file is as follows:
</para>

<execute><cmd>code2db</cmd><input>/home/httpd/cgi-bin/gdms.config</input></execute>
</appendix>
</book>

