|
|
Personal History
Try It Out
- Setup the Plugin
- Start WBI. Setup your web
browser to use WBI as a
proxy.
- Register the PersonalHistory
plugin. At the WBI console, type (on one line)
register com/ibm/wbi/examples/history/history.reg
- Check to see whether the plugin is registered and enabled. Go to the
WBI Setup page. The PersonalHistory plugin
should be listed in the table with a checkmark next to its name. If the plugin
is not listed, try registering it again. If the checkmark is not there, click
on the box to the left of the plugin name.
- Open another browser window. Use that window to try out the plugin, and use
this window to display the documentation. (To open another window using
Microsoft Internet Explorer, go to File -> New -> Window. To open a window
using Netscape Navigator, go to File -> New -> Navigator Window.)
- Visit Some Web Pages
- View Your Personal History
- While you're on the WBI Homepage, locate the floating
trail sign icon in the bottom right corner of the
window. Click on the icon and select Personal History
from the popup menu. Notice that the page you visited most
recently is listed first.
- Search the pages you visited by
entering "IBM" as a search term or try a different search
term. Note: The search capability works only on Win32
systems.
- Visit the IBM
Homepage again. Now, reload your Personal History
page. Notice that the IBM page is now first in the automatic
hotlist.
- Other Things to Try
- Access the Personal History help by clicking on the floating
trail sign icon.
- Use some of the other links available from the pop up menu there.
- Try to make shortcut links appear by navigating from one page, to another,
to another. After repeating this cycle (with the same pages) many times,
shortcut links will appear on at least one of the pages.
- Visit some other pages, then search your Personal History for terms that
you know did or did not appear on those pages.
- Having Trouble?
What It Does
The Personal History plugin helps users find web pages that they
have viewed in the past. When a user accesses the Personal
History page, a list of the 200 web pages visited most recently
will appear. The pages will be ordered according to how recently
and how frequently they have been visited. We call this the
Automatic Hotlist, as it shows the pages tht the user
visits most often.
The user can filter this list by specifying search criteria. After
doing this, the list will consist only of web pages that contain the
specified words or phrases. Pages will be ordered according to how
many times they contain the search terms.
The Personal History plugin also adds shortcut links to certain
web pages. These shortcut links are based on the user's prior
web-browsing behavior. For example, if a user always navigates
from page A to page B to page C, a link to page C will appear on
page A. Shortcut links save time for the user. They appear below
the floating trail sign icon.
How It Works
Architecture
In general, the PH plugin performs four functions:
- it monitors which web pages the user visits,
- it generates pages for the user to see (either external web
pages or Personal History pages),
- it edits these pages to give the user a way to
access his or her Personal History
(e.g., by adding a toolbar that contains helpful links) and
- it edits external web pages by adding shortcuts when necessary.
MEG Model
The following diagram shows how the Personal History plugin
processes a request using different types of Megs. These types
include generators ("G"), monitors ("M"), and document editors
("DE"). The PH plugin does not use request editors. The diagram
is symbolic in that the plugin actually contains many different
Megs of the same type (e.g., many generators). The "G" in the
diagram actually refers to the processing step involving
generators. As we go through the scenarios, keep in mind that
for the Personal History plugin, requests are HTTP requests and
responses are HTTP responses (i.e., we're talking about web
pages).
Scenario 1: Accessing an External Web Page
When the user clicks on a link to an external web page (i.e.,
not a WBI-created page), a request is created and sent to
WBI. WBI recognizes the request and uses a
generator to contact the external server and retrieve the
page (the response). The response is then examined by a
monitor, which collects information needed by the history
plugin. A document editor edits the response by adding
the toolbar (trail sign icon) and by possibly adding some
shortcut links.
Scenario 2: Accessing the Auto Hotlist (Personal History) Page
When the user clicks on a link to Personal History, a request is
created and sent to WBI. WBI recognizes the request and
uses a generator to create a web page with a list of URLs
and scores (the response). A document editor edits the
response by adding the toolbar. Personal History pages
are not monitored, and they do not contain shortcut links.
Implementation Details
- Monitoring pages:
The PageIndexingMonitor gathers web page information
each time a user accesses a web page, even if the user has
previously visited that page. Some of the information collected
includes the URL of the page, the date and time that it was
accessed, and the content of the page. Each set of page
information (one set per page access) is kept in a data
structure of the class Step. The Personal History
plugin stores these Step objects in a data structure of the
class History.
As a side note, there is no limit on how large the history and index
objects can become. The PH plugin will always save the complete
history and index to disk on shutdown and load them back in on
startup. If these files get too large and you want to delete them,
they are located in the data/history directory. The *.hst file is
the history and the *.idx file is the index.
- Indexing page content:
For each page access, the page's content is indexed so that it
can be searched later. Indexing information is kept in a data
structure of the class UpdatableIndex. The
History class includes an UpdatableIndex
object.
- HTML code for the Personal History pages:
The history pages are created from a template using WBI's
HtmlTemplateGenerator. The generator uses three files
(inheader.txt, inbody.txt, and infooter.txt)
to set the header, body, and footer of the pages. These files
are retrieved as Java resources. The template includes a
backlink to the most recent non-history web page visited and a
form which allows the user to search the pages stored in the
history.
- List of links on Personal History pages:
The primary content of a history page is an ordered list of links. The way
in which the list is created depends on whether the page is an Auto
Hotlist page or a the result of a search.
The Auto Hotlist page is reached by clicking on the Personal History
link in the WBI toolbar. The links on this page are ordered according
to how recently and how frequently the user has visited the various web
pages. The score for each URL is calculated by using the page
information, which was stored in the Steps in the History
(specifically, the time and date that the page was accessed). The URLs
are sorted according to their scores and are normalized on a scale of
1 to 100. Then the Auto Hotlist page is created, listing each URL
(and its score) in order.
The Searchable History page is reached by entering search terms into
the form in the Auto Hotlist page. The links on this page are ordered
according to how many times the web pages contain the search terms.
This is determined by querying the information available in the
history's index.
- Some key WBI classes that were used:
Known Problems
All of these problems relate to how the Personal History trail
marker icon is displayed. The basic problem is that between the
two browsers and all of the possible badly and no-so-badly
constructed HTML, there are just too many cases to cover. Feel
free to fix these (and send us your
changes!).
-
The Personal History trail sign icon may not always appear in the
lower right hand corner of the browser window, especially on
pages that contain frames.
- Occasionally, on framed pages, the trail icon will appear in
more than one frame. If this happens, try reloading the page
(using shift-reload) and the second one might go away.
- Sometimes when pages are resized, especially when they are
made smaller, the trail icon and its menu simply appear in the upper
left corner of the browser window (i.e., it no longer floats).
Again, if you reload the page, this should correct itself.
Source Files
- history.reg
- Contains the code necessary to register the plugin.
- AddShortcutsEditor.java
- Contains the class definition for AddShortcutsEditor (calculates shortcut
links based on user's history; adds shortcuts and PH icon to page).
- AutoHotlistGenerator.java
- Contains the class definitions for TitleScorePair and AutoHotlistGenerator
(calculates which
web pages were most frequently/recently visited; generates page of ordered
links).
- backbtn.gif
- Contains the image for backlink on PH pages
- backgrnd.jpg
- Contains the image for background on PH pages
- DictionaryEntry.java
- Contains the class definition for DictionaryEntry (used by UpdatableIndex).
- DocFreqPair.java
- Contains the class definition for DocFreqPair (used by UpdatableIndex).
- DocScorePair.java
- Contains the class definition for DocScorePair (used by UpdatableIndex).
- DocumentUrl.java
- Contains the class definition for DocumentUrl (used by History).
- DocumentVersion.java
- Contains the class definition for DocumentVersion (used by History).
- help.html
- Contains documentation on how to use the Personal History plugin.
- History.java
- Contains the class definition for History (data structure which keeps track
of which web pages a user has visited).
- HistoryFileGenerator.java
- Contains the class definition for HistoryFileGenerator (gets necessary
files from the local machine).
- HtmlHelper.java
- Contains the class definition for HtmlHelper (provides useful methods for
dealing with HTML files).
- inbody.txt, infooter.txt, inheader.txt
- Contains text used to make Personal History web pages (used by an
HtmlTemplateGenerator).
- PageIndexingMonitor.java
- Contains the class definition for PageIndexingMonitor (adds web page
information to the History).
- PersonalHistoryPlugin.java
- Contains the class definition for PersonalHistoryPlugin (the plugin
itself).
- SearchableHistoryGenerator.java
- Contains the class definition for SearchableHistoryGenerator (finds web
pages which have been visited and match the search criteria; generates page
of ordered links).
- sign.gif
- Contains the image used for the Personal History toolbar.
- Sort.java
- Contains the class definition for Sort (insertion sort).
- Sortable.java
- Contains the interface definition for Sortable (used by Sort).
- Step.java
- Contains the class definition for Step (used by History).
- toolbar.js
- Contains the javascript used for the Personal History toolbar
(floating icon).
- UpdatableIndex.java
- Contains the class definition for UpdatableIndex (used by History).
- UpdatableIndexCorruptException.java
- Contains the class definition for UpdatableIndexCorruptException (used by
UpdatableIndex).
- UpdatableIndexException.java
- Contains the class definition for UpdatableIndexException (used by
UpdatableIndex).
- UrlTitleScore.java
- Contains the class definition for UrlTitleScore (used by
AutoHotlistGenerator).
|