Implementation Decisions



Basic Interaction with the WWW


HyperGloss has been designed as a plugin to Web Raveler, a proxy server written by Andrew Kensler at Grinnell College during the Summer of 1999. This proxy server has the ability to keep track of account and security information. The first thing Web Raveler does is ask the client to log in with a username and password. This allows us to maintain some control over the usage of our system. Moreover, Web Raveler can keep certain user information, such as preferences, real name, and/or email address. Web Raveler then intercepts requests for pages and runs our plugin, along with any other desired Web Raveler Plugins, before returning the page to the browser.


Programming Language


HyperGloss is based almost solely on the manipulation of strings. Since the system is also meant to communicate with the Web, HyperGloss is almost entirely written in Perl 5. Javascript has been used for some actions, such as opening secondary windows, but the bulk of the the system is Perl.


Viewing a Typical Page


Each time a page is accessed, our main Plugin script is run. This script adds the "Add," "Search," and "Help" buttons to the top of the document along with the Javascript code needed to open the Annotations, Search, and Help windows. The script also gets any annotations for the page from the the server and adds the colored arrows to designate an annotation. This is done by searching for the "context" of the annotated text in the document. The context is a few hundred characters surrounding the annotated text. Once the string is found, the arrows are inserted on either side of the annotated text, making sure to preserve original links. There is a potential problem if the original page is changed, since the context may not be matched, leaving the annotation homeless. Our goal is to incorporate an approximate string matching algorithm that will allow for minor changes. Currently, if the context of the annotated text is not found, the inserting script searches for the annotated text itself keeping in mind which instance of that text is the desired one. If the document changes significantly, the annotations will be kept in a separate place, and may still be accessible to those that care.

Before the arrows are added, the permissions on the annotation are checked against the user information. The arrows are added if the annotation is public, or the reader is the author or in one of the groups that has access to the annotation.

The time the annotation was made is also checked against the last time the reader accessed that page. If the annotation is old, (i.e., made prior to the last time the reader accessed that Web page), then a yellow arrow is inserted. If the annotation was made since the reader visited the page, it is new and the arrow is red. In the case of an old annotation with a new reply, the arrow is green.


Adding an Annotation


The interface for adding an annotation makes it seem quite simple but the actual implementation involves many checks before any information can be gathered from the add annotation form. When the add button is pressed, a script is run to load an add page that is correct for a new annotation. This page knows who the user is and can get all of the appropriate user information as well as other pertinent information, such as the page being annotated.

Once the client has inputed all of the necessary annotation information and clicks on the submit button, several things are checked. First, a script looks through the HTML source code to see how many times the annotated text appears in the HTML. If it does not appear, it does not allow the annotation to be made. On the other hand, if the annotated text appears more than once (i.e it is ambiguous) another script runs. This script removes all of the links in the HTML source and then puts links in the form of superscript numbers next to each of instance of the annotated text. It also puts a short line at the top of the page that asks the client to pick the instance of the annotated text that they wish to annotate. When the client picks an instance, another script is run that will store all of the necessary information for the annotation including up to 100 characters on either side of the annotated text as the context. If the annotated text was not ambiguous, it simply stores all the information for the annotation including the context, right at the beginning.



Rachel Heck
Last modified: Wed Nov 3 23:25:56 CST 1999