Mumps Based Web Folders
Sept 25, 2005

This directory contains the Mumps code that produces an hierarchical html folder presentation. There are two sets of Mumps programs that accomplish this. The first set of programs, index.mps or col_index.mps, create the display and the second set, the program tab.mps, creates the hierarchical data base that index.mps or col_index.mps use. The porgrams index.mps and col_index.mps are essentially similar except that the former presents the folders vertically while the second presents them horizontally. Note: if you use "col_index.mps", you must rename its executable file to "index.cgi".

You must download and install the Mumps Compiler for this application to work. The Mumps Compiler is freely available from:

http://www.cs.uni.edu/~okane

An index is built from the file folder.list which contains a script description of the hierarchy. Modify folder.list to create your own hierarchy. Use the provided folder.list file as a guide. Entries in the folder.list each consist of two line pairs, separated by a blank line. Each two line pair consists of, on line one, the text to be displayed in the panel next to the open or closed folder, and, on the second line, the URL of the window to be displayed.

The number of dots at the beginning of each line determines the depth. Do not skip levels when increasing depth. There is little error checking so do it right. Both lines must have the same number of dots. See the example in folder.list. To increase frustration, be certain not to follow these instructions.

Line one "text" may be valid HTML code including image tags, font tags, etc. so long as the tag sequence is completed on the line. If you want to embed double quote marks ("), they must appear in pairs. That is,, use "" for ". Text should be kept to a minimum as there is a maximum length to the total number of bytes in a descriptor hierarchy (about 2048 depending on build options in Mumps).

The second line gives the URL of the display to be associated with the text form the first line. Following the URL is the name of the target window into which the URL will be loaded. In the example folder.list, you will see references to the right frame in a two frame display. Note the quotation marks around the URL. URL's not prefixed with "http://..." are relative to the base directory.

You may use other window names to the right of the "target=" sequence. Some window names, such as "_top" are defined by your browser and should be avoided. If you use a name not otherwise in use as a frame name or a reserved name, a new window will be created.

You can invoke the index in its own window or in a frame. When invoked into a frame, you do something like the following:

<html> <frameset cols=28%,* border=1> <title> Your Title <title> <frame src="index.cgi" name=left scrolling=auto marginwidth=0> <frame src=blank.html name=right marginwidth=0> </frameset> </html>

In this example, two frames are created and named. The left-hand panel is named "left" and the web folders are opened in this window. A second frame, named "right" is created with an initial display containing "blank.html".

To invoke the web folders directly, you can use, in addition to the above, with:

<a href="http://www.aaa.bbb.com/index.cgi"> text </a>
The file "index.cgi" is the compiled index program. Some web servers require a different file extension or placement of the file in a particular directory. The file should have its protection codes set so that it can be executed by the web server.

How to Build a Folder Set

Compile Mumps programs index.mps and tab.mps. A copy of the Mumps Compiler is available at http://www.cs.uni.edu/~okane.

The software consists of:

  1. tab.mps - a file which reads the folder hierarchy and builds a data base; and

  2. index.mps (col_index.mps) - programs that run as a web server tasks and display the hierarchy.

There is also a script file 00BUILD that contains the steps to build an index.

The program tab.mps reads the hierarchy and creates Mumps global array references. These areprinte to stdout as tab.mps executes. At higher levels of the array reference are the less indented entries while the more indexted entries reside at lower levels. At each node is stored the URL associated with the node. The maximum depth is limited by the maximum length of a global array reference, about 2048 bytes in most cases. There is no effective limit to the numer of tags.

Prefixed to each text tag is a code number. This is not visible in the displayed window. It is there in order to preserve the sequencing of the text tags.

The default programs use a global array named "^lib" for the hierarchy. You may have other hierachies and the URL from one hierarchy can access another. To specify a hierarchy other than "^lib", use the following when referencing the program:

http://www.aaa.bbb.com/index.cgi?array=myhierarchy

Example Folder

We took the 2003 National Library of Medicine Mesh Hierarchy (note: this version is out of date and should not be used for clinical work). The hierarchy has a file format as follows:

Body Regions;A01
Abdomen;A01.047
Abdominal Cavity;A01.047.025
Peritoneum;A01.047.025.600
Douglas' Pouch;A01.047.025.600.225
Mesentery;A01.047.025.600.451
Mesocolon;A01.047.025.600.451.535
Omentum;A01.047.025.600.573
Peritoneal Cavity;A01.047.025.600.678
Retroperitoneal Space;A01.047.025.750
Abdominal Wall;A01.047.050
Groin;A01.047.365
Inguinal Canal;A01.047.412
Umbilicus;A01.047.849
Back;A01.176
Lumbosacral Region;A01.176.519
Sacrococcygeal Region;A01.176.780
Breast;A01.236
Nipples;A01.236.500
Extremities;A01.378
Amputation Stumps;A01.378.100
Lower Extremity;A01.378.610
Buttocks;A01.378.610.100
Foot;A01.378.610.250
Ankle;A01.378.610.250.149
Forefoot, Human;A01.378.610.250.300
Metatarsus;A01.378.610.250.300.480
Toes;A01.378.610.250.300.792
Hallux;A01.378.610.250.300.792.380
Heel;A01.378.610.250.510
Hip;A01.378.610.400
Knee;A01.378.610.450
Leg;A01.378.610.500
Thigh;A01.378.610.750
Upper Extremity;A01.378.800
where each line contains a text description terminated by a semi-colon followed by one or more index entries. The index entries form an hierarchy. We processed these codes with the following program:
zmain open 1:"mesh.html,new" use 1 write "<html><body>",! use 5 write ! write "MESH 2003 Hierarchy",! write """blank.html"" target=right",! for do . read a . if '$test break . for i=1:1 set x=$p(a,".",i) if x="" quit . set i=i-1 . write ! . for j=1:1:i write "." . write " ",$p(a,";",1),! . for j=1:1:i write "." . write " ""mesh.html#",$p(a,";",1),""" target=right",! . use 1 . write "<a name=",$p(a,";",1),"></a>",a,"<br>",! . use 5 use 1 write "</body></html>",! close 1
The program reads the MESH entries and builds two files: one directed to stdout (redirected to the file name "folder.list") and one named mesh.html. The "folder.list" file looks like:

MESH 2003 Hierarchy
"blank.html" target=right

. Body Regions
. "mesh.html#Body Regions" target=right

.. Abdomen
.. "mesh.html#Abdomen" target=right

... Abdominal Cavity
... "mesh.html#Abdominal Cavity" target=right

.... Peritoneum
.... "mesh.html#Peritoneum" target=right

..... Douglas' Pouch
..... "mesh.html#Douglas' Pouch" target=right

..... Mesentery
..... "mesh.html#Mesentery" target=right

...... Mesocolon
...... "mesh.html#Mesocolon" target=right

..... Omentum
..... "mesh.html#Omentum" target=right

..... Peritoneal Cavity
..... "mesh.html#Peritoneal Cavity" target=right

.... Retroperitoneal Space
.... "mesh.html#Retroperitoneal Space" target=right

... Abdominal Wall
... "mesh.html#Abdominal Wall" target=right

... Groin
... "mesh.html#Groin" target=right

... Inguinal Canal
... "mesh.html#Inguinal Canal" target=right

... Umbilicus
... "mesh.html#Umbilicus" target=right

.. Back
.. "mesh.html#Back" target=right

.
.
.
The file "mesh.html" looks like:
<html><body> <a name=Body Regions></a>Body Regions;A01<br> <a name=Abdomen></a>Abdomen;A01.047<br> <a name=Abdominal Cavity></a>Abdominal Cavity;A01.047.025<br> <a name=Peritoneum></a>Peritoneum;A01.047.025.600<br> <a name=Douglas' Pouch></a>Douglas' Pouch;A01.047.025.600.225<br> <a name=Mesentery></a>Mesentery;A01.047.025.600.451<br> <a name=Mesocolon></a>Mesocolon;A01.047.025.600.451.535<br> <a name=Omentum></a>Omentum;A01.047.025.600.573<br> <a name=Peritoneal Cavity></a>Peritoneal Cavity;A01.047.025.600.678<br> <a name=Retroperitoneal Space></a>Retroperitoneal Space;A01.047.025.750<br> <a name=Abdominal Wall></a>Abdominal Wall;A01.047.050<br> <a name=Groin></a>Groin;A01.047.365<br> <a name=Inguinal Canal></a>Inguinal Canal;A01.047.412<br> <a name=Umbilicus></a>Umbilicus;A01.047.849<br> <a name=Back></a>Back;A01.176<br> <a name=Lumbosacral Region></a>Lumbosacral Region;A01.176.519<br> <a name=Sacrococcygeal Region></a>Sacrococcygeal Region;A01.176.780<br> <a name=Breast></a>Breast;A01.236<br> <a name=Nipples></a>Nipples;A01.236.500<br> <a name=Extremities></a>Extremities;A01.378<br> <a name=Amputation Stumps></a>Amputation Stumps;A01.378.100<br> <a name=Lower Extremity></a>Lower Extremity;A01.378.610<br> <a name=Buttocks></a>Buttocks;A01.378.610.100<br> <a name=Foot></a>Foot;A01.378.610.250<br> <a name=Ankle></a>Ankle;A01.378.610.250.149<br> <a name=Forefoot, Human></a>Forefoot, Human;A01.378.610.250.300<br> <a name=Metatarsus></a>Metatarsus;A01.378.610.250.300.480<br> <a name=Toes></a>Toes;A01.378.610.250.300.792<br> <a name=Hallux></a>Hallux;A01.378.610.250.300.792.380<br> <a name=Heel></a>Heel;A01.378.610.250.510<br> <a name=Hip></a>Hip;A01.378.610.400<br> <a name=Knee></a>Knee;A01.378.610.450<br> <a name=Leg></a>Leg;A01.378.610.500<br> <a name=Thigh></a>Thigh;A01.378.610.750<br> <a name=Upper Extremity></a>Upper Extremity;A01.378.800<br> <a name=Arm></a>Arm;A01.378.800.075<br> <a name=Axilla></a>Axilla;A01.378.800.090<br> <a name=Elbow></a>Elbow;A01.378.800.420<br> <a name=Forearm></a>Forearm;A01.378.800.585<br> <a name=Hand></a>Hand;A01.378.800.667<br> <a name=Fingers></a>Fingers;A01.378.800.667.430<br> <a name=Thumb></a>Thumb;A01.378.800.667.430.705<br> <a name=Wrist></a>Wrist;A01.378.800.667.715<br> <a name=Shoulder></a>Shoulder;A01.378.800.750<br> <a name=Head></a>Head;A01.456<br> <a name=Ear></a>Ear;A01.456.313<br> <a name=Face></a>Face;A01.456.505<br> <a name=Cheek></a>Cheek;A01.456.505.173<br> <a name=Chin></a>Chin;A01.456.505.259<br> . . .
which is the original MESH file with added link information. When run, appears as follows:

When a link is clicked (Cardia) a second window opens: