TAU Portal information

From Tau Wiki
Revision as of 00:43, 11 March 2014 by Scottb (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

1. TAU Portal dependences 2. Deploying the TAU Portal 3. Configuring the TAU Portal 4. Understanding the code structure


== TAU Portal dependences

Ruby has a efficient package management systems called Ruby Gems. It is the easiest way to get the packages required for the TAU Portal. A ruby gem can be install with the 'sudo gem install <package name>' command. The TAU Portal requires the following packages:

rails (2.0.2 or greater) crypt 1.1.4 capistrano 1.3.0 magic_multi_connections 1.0.0 mysql 2.7 rake 0.7.3 termios 0.9.4


== Deploying the TAU Portal

Deployment of the TAU Portal is handled by the capistrano package. the basic commands are: 'rake deploy' - deploy the application to the location specified in the /config/deploy.rb file.

'rake rollback' - rolls back the last deployment to the previous one--just in case you have made a mistake.

More information about deploying a Rails application can be found at capistrano website: www.capify.org.


== Configuring the TAU Portal

Most of the configurations need to setup the TAU Portal are specified in the the /config/enviroment.rb file. Some variables you make need to change are:

  • Setting for the ActionMailer::Base class (to setup the email mailing system).

The following GLOBAL VARIABLES:

  • REMOTE_HOST (the host where the TAU Portal is running ).
  • CONNECTION_HOST (the host where the Mysql database is running).
  • CONNECTION_USERNAME (the administrator username for the Mysql database.)
  • CONNECTION_PASSWORD (the administrator password for the Mysql database.)
  • DATA_DIRECTORY (the path to the directory where the cached PPK files should be stored.
 The PPK files will be stored in the subdirectories 0,1,...,9 which will need to be created as well).
  • TMP_DIRECTORY (the directory where the Portal will store temporary files.)
  • USER_PRIVILEGES (the privileges given to users for accessing the mysql databases.)
  • PERFDMF_LOADTRIAL (the path to the perfdmf_loadtrial script.)
  • MYSQL_JAR (the path to the mysql jar file.)
  • PERFDMF_PYTHON (the path to the perfdmfdb.py script.)
  • JAVA_CODEBASE (URL to the the java web start jar file location.)

The mysql database configuration is set in /config/database.yaml. You will specify setting for the development/test/production set depending on which version you want to run. As well you need to set up some 'default' settings that the Portal will use to connection to the perfdmf database before the user has selected a workspace. It should have the schema of a regular perfdmf database but it will not contain any records.

== Understanding the code structure

Rails applications follow the standard Model-View-Controller scheme where potions of the website are divided up by their function.

= Models The model interfaces with the database and performs basic operation on the database records. The record are then available to the rest of the application as Ruby objects. The model classes that interface with the perfdmf database do so through the perfdmf model. Which database it connects to determined by which workspace the user is using (see Portal Controller below).

= Views Each web page is created using ruby's .rhtml format which allows ruby code to be imbedded into regular html pages. Views which name begins with an underscore (_) are called partials and rendered by other view with the "render :partial => 'some_partial'" command.

= Controllers The controllers specify actions that should be taken with each HTTP request. They define methods that correspond to the to the name of the view which will be send as HTTP Response. Ruby object variables (those beginning with '@') are persisted and are available to the do be use later by the views. The Portal Controller from which all other controller descend manages the authentication and database connections for the entire Portal.