UCM version v5_1
Web access to Source Repositories
Author: Peter Kasper
Contents:
UVMHTML: The command used to create the web pages.
Using the pages: What they contain an how they work.
Hyperlinking: How to add hyperlinks to source files.
See the Table of Contents for more information.
The World Wide Web provides a convenient method for access to computerized
information. In order to exploit this medium, UCM provides a script which
produces a set of CGI scripts that enable web access to information about UVM
or CVS source repositories and the contents of RCS elements within them.
UCM version v5_1
UVMHTML: Creating the pages
The command to create the web pages is:-
uvmhtml input_directory output_directory [-t "html title"]
The input_directory specifies the location of the libraries
to be documented. All libraries found in the directory tree indicated by this
parameter will be documented. The output_directory indicates
where the web pages will be created. The top level page is invoked by simply
referencing the cgi-bin script UVMroot. (The name of this script can be changed
to whatever the user deems appropriate but it cannot be moved to another
directory.)
The html text "html title" will replace the default title of the top
level page. The default title will look like:-
UVM libraries
A list of the UVM libraries contained in:-input_directory
or (if the input directory is a CVS repository):-
CVS Modules
A list of the CVS Modules contained in:-input_directory
All of the files placed in the output directory are cgi_bin scripts which
create the pages and execute a variety of UVMI and/or RCS commands. The
uvmhtml command determines the paths to these commands and imbeds them
into these scripts. Thus in order for the scripts to work correctly the command
should be run on the same machine that the web-server runs on. However, when
the script runs it will give the user an opportunuity to change the input and
output directory specifications and also the UVMI and RCS path names.
UVMHTML creates the following files in the output directory:-
- UVMroot : This script creates the top level (or root) page
which contains a list of the libraries found in input_directory
with links to individual library pages. The web tree for the repository is
accessed by invoking this script.
- UVMlib : This script creates a Library
Contents Page and is invoked by the library/module links found in the root
page or the sub library/module links found in other Library Contents pages.
- UVMelem : This script creates an Element
Contents Page and is invoked by the element links found in the Library
Contents pages. It also searches the element contents for special hyperlinking
commands which its uses to imbed hyperlinks into the output page.
- UVMwww : This script performs various UVMI and RCS
functions which provide general information about UVM libraries (or CVS
modules) and their RCS elements.
- UVMuser : A modifiable script which provides a user
interface to UVMelem. The extracted element contents are piped through this
script before being put into the web page. The default version provides simple
hyperlink mapping and translates special HTML characters.
- UVMhelp : This script displays a version of this web page
which has been appropriatly modified depending on whether the input directory
is a CVS repository or a collection of UVM libraries.
UCM version v5_1
Using the Pages
The links from the root page invoke a separate html page for each library.
These pages contain two forms. The first is used to invoke commands which
display information about the entire library and appears as shown below.
Clicking on one the "submit" buttons invokes the corresponding command and
converts the output into a web page. Each command can be modified by providing
an appropriate option value in the space provided.
- List: Provides a list of elements in the library with the revision
numbers that correspond to the option specification. If no option is specified
the latest (head) revision is displayed.
Option: The option value can be a symbolic tag name or a
date/time specifier. An option value of "Latest" refers to the head revision
and a value of "Original" refers to revision 1.1.
- Activity: Provides a log of modifications to the UVM library. Each
entry contains the date/time (GMT), user name, and nature of the
modification.
Option: If provided, the log will be limited to the last
opt_value days. E.g opt_value
= 2.5 will restrict the log to modifications made in the past 2.5 days.
- Reservations: Provides a list of UVM library elements that are
currently reserved along with the name of the user that reserved them.
Option: If provided, the list will be limited to those
elements reserved by the user specified by opt_value,
otherwise all reservations are listed.
- Changes: Provides a list of library elements that have been changed
int the period specified by the option value. The list is in the form of a
table containing the element name, the "old" revision number, and the "new"
revision number.
Option: Can either be a decimal number or have the form
OLD:NEW, where OLD and
NEW are symbolic tags or date/times. If
opt_value is a number then the changes made during the last
opt_value days will be shown. If it has the form
OLD:NEW then changes between the revisions specified by
OLD and NEW will be shown.
Parentheses can be used to resolve ambiguitites that may arise when including
time fields in dates.
- Groups: Lists all UVM "groups" that exist in the library.
Option: Not used.
The second form on the page is shown below and is followed by lists of
links to sub-libraries and library elements.
Clicking an element link will produce a page containing the contents of the
element revision specified in the text box. These links can be modified to
display a different revision by typing the desired revision specification
into the text box and clicking the "Change" button. The revision can be
specified with a symbolic tag name, a date/time, or an explicit revision number.
This page displays the contents of a specific revision of an element. The
script which produces this information also searches for special
hyperlinking commands which can be used to insert links
into the element contents. These commands can either be imbedded directly into
the element or added in real time when its contents are piped through the
UVMuser script.
This page also provides a form (shown below) which can invoke commands to
display information about the element.
Clicking on one the four submit buttons invokes the corresponding "uvm show"
command and converts the output into a web page. Each command can be modified by
providing an appropriate "Option" value in the space provided.
- History: Provides a list of revisions to the element during period
specified by opt_value. Each entry contains the
revision number, the date/time (GMT) it was created, the name of the user who
created it, and the descriptive comment that they provided.
Option: Can either be a decimal number or have the form
OLD:NEW, where OLD and
NEW are symbolic tags or date/times. If
opt_value is a number then the changes made during the last
opt_value days will be shown. If it has the form
OLD:NEW then changes between the revisions specified by
OLD and NEW will be shown.
Parentheses can be used to resolve ambiguitites that may arise when including
time fields in dates.
- Difference: Lists the differences between the two revisions of the
element specified in the option value. Note: This command uses the may
or may not work depending on how the file protections on the web-server have
been configured.
Option: Has the form OLD:NEW,
where OLD and NEW are
symbolic tags or date/times. The differences between the revisions specified by
OLD and NEW will be shown.
Parentheses can be used to resolve ambiguitites that may arise when including
time fields in dates.
- Tags: Lists all revisions of the element that have been tagged with a
symbolic name. It also gives the revision number of the latest revision.
Option: Not used.
- Membership: Lists all UVM "groups" that the element belongs to.
Option: Not used.
UCM version v5_1
Creating Hyperlinks
UVMHTML provides the user with a simple mechanism for cross-referencing source
code with hyperlinks. This is done by inserting a "hyperlink command line"
before each line in the element which is to contain the link. This can be done
either by changing the element itself or by using UVMuser
script to add them at the time the element is displayed.
A "hyperlink command line has the form :-
[text] uvm F='value' [F='value' ...] [text]
where the argument flags, F, can be any of S,
U, N, L, E, or A.
The optional text preceeding and following the hyperlink command is used to
turn the line into a compiler "comment" line when the commands are imbedded
into source code.
Three different hyperlink commands are recognized:-
- uvm
S='string'
U='URL'
The text matching string in the next line of the
element is turned into a link to the address specified by
URL.
- uvm
N='anchor_name'
The next line of of the element is turned into an html anchor with the name
anchor_name. It will also be displayed in red.
- uvm
S='string'
L='library'
E='element'
A='anchor'
The text matching string in the next line of the
element is turned into a link to another element. If the
library or element arguments
are omitted they will default to the current values. The
anchor argument need not be supplied unless both the
library and element arguments
have been omitted.
Note that links to other elements use the default revision specification in
the last "Library Content Page".
UVMHTML creates a user modifiable script, UVMuser, which can be used to imbed
hyperlink commands into an element without actually
changing it.
The default version of UVMuser (shown below) is a PERL script which reads a
link-map file called "map" and uses it to construct hyperlinking commands. The
"map" file is assumed to reside in the same directory as the scripts and
contains two lines per "link map". The first line contains a regular expression
used to identify lines in the element to which the hyperlink command will be
attached. The second line contains the arguments for the hyperlink command.
#!/usr/local/bin/perl
# Open and read a link map file if it exists
# The link map contains two lines per entry ..
# 1) A PERL regular expression which identifies lines to which will be
# preceded by a hyperlink command
# 2) The argument list to be used in the hyperlink command
if( open( MAP, "map" ) ) {
while( $str = <MAP> ) {
chop( $str );
$args = <MAP>
$map{$str} = $args;
}
close(MAP);
}
# Loop over the element lines
while( $line = <> ) {
$add = ""; # reset the hyperlink command line
# Loop over the link map entries
while( ($str,$args) = each(%map) ) {
if( $line =~ /$str/ ) { # Check if line requres a hyperlink
$add = "UVM $args"; # Create hyperlink command
}
}
$line =~ s/&/&amp;/g; # Translate & to corresponding html code
$line =~ s/</&lt;/g; # <
$line =~ s/</&gt;/g; # >
if( $add ) { print $add; } # Print the hyperlink command
print $line; # Print the element line
}