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:
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:
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.text
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:
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:
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: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
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:zmain open 1:"mesh.html,new" use 1 write "",! 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,"
",! . use 5 use 1 write "",! close 1
The file "mesh.html" 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 . . .
which is the original MESH file with added link information. When run, appears 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
Arm;A01.378.800.075
Axilla;A01.378.800.090
Elbow;A01.378.800.420
Forearm;A01.378.800.585
Hand;A01.378.800.667
Fingers;A01.378.800.667.430
Thumb;A01.378.800.667.430.705
Wrist;A01.378.800.667.715
Shoulder;A01.378.800.750
Head;A01.456
Ear;A01.456.313
Face;A01.456.505
Cheek;A01.456.505.173
Chin;A01.456.505.259
. . .
When a link is clicked (Cardia) a second window opens: