NAME

wrm.pl -- Sets WIRM configuration variables and connects to a repository


SYNOPSIS

  require "wrm.pl";

  #Access the WIRM configuration hash
  print "The WRM CGI files are in: $WRM_CONF{wrm_cgi}\n"; # etc

  #Configure, connect and disconnect to a repository
  repo_config(demo_repo);
  repo_connect();
  repo_set(demo_repo);
  repo_disconnect();
  repo_required();


REQUIRES

conf.pl


DESCRIPTION

wrm.pl provides access to the WRM configuration variables, which specify the location of the various WIRM files and directories, the location of the installation-specific cgi-bin and htdocs directories, and the location and file organization of each repository. It also provides subroutines that are called when connecting to a different repository on the same server. Multiple repositories are made possible by requiring all repositories to be installed in the same relative location with respect to the wrm toolkit, and by requiring all directories within a repository to have a standard organization. wrm.pl is the only file that must be required for successful operation of WIRM.

Installation-specific information is specified in the file conf.pl, which must be edited for each installation. All other paths and directories are automatically derived in wrm.pl. Information pertaining to the location of the wrm toolkit files is defined when wrm.pl is required.

Repository-specific information is defined only when the various repo_* subroutines in wrm.pl are called. This allows changing repositories on the fly. repo_configure sets all the configuration variables, and repo_connect connects to the repo_specific dbm hashes as well as the relational database.

No matter how they are set, the configuration variables are all stored in the %WRM_CONF hash, which is globally avaialble once wrm.pl has been required. This hash is used throughout the other wrm scripts.


METHODS

repo_conf($repo_name)

Add repository-specific files and pathnames to the %WRM_CONF hash. These include the location of the installed repository and its subdirectories, the location of the fsa and visualization cache, and the locations, relative to the installation-specific cgi-bin and htdocs directories, which are linked to appropriate subdirectories of the installed repo by conf/repo-init.pl.

repo_connect()

Connect to a specific repository defined after repo_conf has been called. Connects to the relational database, opens associated dbm hashes, requires class-defs, and sets subdirectory paths within the file storage area and the visualization cache. These operations were orginally performed in the separate wrm library functions dealing with each kind of information resource. They are encapsulated here in order to permit changing a repository on the fly.

repo_set($repo_name)

Convenience function which first calls repo_config, then calls repo_connect. It was necessary to separate these two functions because the install scripts need to call these functions separately. But once a repo is installed repo_set is the preferred way to set a repo.

repo_disconnect()

Closes the hashes open by the repo_set comand. Probably not necessary for stateless forms-based interaction, but will be necessary if we make wrm into a server.

repo_required()

Called by the wrm/cgi scripts to be sure that a repository has been set before allowing the user to perform various generic operations such as viewing a schema or exploring the database. Once a repository has been set the name becomes another context variable called cx_repo, which is saved in the global CONTEXT hash, and passed as a hidden form element, or a command line parameter.


AUTHOR

Rex Jakobovits, rex@cs.washington.edu

Modified by Jim Brinkley, brinkley@u.washington.edu


SEE ALSO

conf.pl