NPIB1.6 User's Guide

by

Ronald D. Kriz*, Associate Professor
Randy T. Levensalor**, Assistant Research Assistant
* Engineering Science and Mechanics, and ** Computer Science
Virginia Polytechnic Institute and State University
Blacksburg, Virginia 24061


Table of Contents:

  1. Introduction
  2. Installation
  3. Set up "public_html" for JWave and NPIB
  4. "How-to" NPIB-forms tutorials:
  5. Frequently asked questions:
  6. Known bugs:


3.0 Set up "public_html" for JWave and NPIB

With NPIB version 1.6 all NPIB, JWave, and of course *.html files are now located and execute from within the public_html directory off of the user's home directory. In this section we have provided a template that will assist the user in setting up modules that use NPIB and JWave.

  1. Download the STARTUP_public_html.tar from http://www.jwave.vt.edu/npib/STARTUP_public_html/ and put the STARTUP_public_html.tar in the user's home directory.

  2. Extract the contents of the STARTUP_public_html.tar file using the command

    % tar xvf STARTUP_public_html.tar

    !!!! CAUTION !!!! unpacking this tar file will create a public_html directory in the user's home directory.

  3. Go into the newly created public_html directory

    % cd public_html

    Notice that there are three directories: crcd/, jwave/, and npib/.

    In the crcd/ directory there is a bin/ directory where the user must archive all compiled PV-Wave/JWave *.cpr files. This new directory must be added to the JWave manager path by the server system administrator. The crcd/ directory also contains the lectures/, assignments/, and modules/ set up by the user.

    In the jwave/ directory there is a classes/ directory. In this directory there are three JWave *.jar files that were created by the JWave manager. To avoid copying these three *.jar files everytime JWave is reconfigured, the README file in this directory show how to make symbolic links to these files.

    In the npib/ directory there are two directories, AA_PUT_contents_IN_home-bin/ and APP/ and two files: form.jar and npib.commands. The form.jar file is the same form.jar file located in the codebase file directory "server"/npib. The npib.commands file contains one line for each application ("APP" i.e. APP => polar) pointing to the location of the APP.npib file that contains the npib-commands used for that particular application. Here APP can be replaced with the application name, i.e. for module02 APP is replaced with "polar" and in module06 APP is replaced with "edge".

    The AA_PUT_contents_IN_home-bin/ directory contains a script file named "form" which links the user to the form.jar file. Using this script file the user does not have to define the PATH and CLASSPATH to the form.jar file.

    CONTENTS of form: ---------------------------------------------
    
    #!/bin/sh
    java -cp /usr/local/java2/lib:$HOME/public_html/npib/form.jar:. \
    form.FormLoader $
             

    The APP/ directory contains the APP_.d directory and two NPIB files: APP.npib and copyAPP.sh. The APP_.d directory contains all files for execution on remote computer. NOTE: executable files stored here must be compile on the remote computer and stored here, unless you want to include an extra compile command in the remoteAPP.sh script. Speaking of which, the two *.sh script files: remoteAPP.sh and localAPP.sh are shell script files that control the sequence of commands executed on the remote and local computers respectively:

    #!/bin/csh
    #------------------ remoteAPP.sh --------------------
    APP.x
    exit 0
    
    #!/bin/csh
    #-------------------- localAPP.sh  -------------------
    source /usr/local/vni/wave/bin/wvsetup
    #echo env: > temp
    #/bin/env >> temp 
    #echo ' ' >> temp
    #echo set: >> temp
    #set >> temp
    wave create_prop1 > & prop1_foobar
    rm prop1_foobar 
    rm *.x
    rm *.byt
    rm *legend.jpg
    exit 0
         
    The other files in this directory are templates with helpful hints to avoid various pitfalls and other problems we encountered in creating PV-Wave modules.

    The NPIB file, APP.npib, contains the sequence of commands to execute this application.

    CONTENTS of APP.npib: -------------------------------------
    
    lrun /export/home/USER_NAME/public_html/npib/APP/copyAPP.sh
    sput $APP_remote
    srun $APP_remote ./remoteAPP.sh
    sget $APP_remote 
    lrun ./localAPP.sh
             
    Commands in the APP.npib file need more explanation, where $APP_remote was defined in the NPIB Edit - Passwords "Working Window" and used here like an environmental variable with information about the remote computer.

    lrun - run this command or shell script localy
    sput - ssh put files in a directory (date-time) on the remote computer.
    srun - ssh run on the remoteAPP.sh script in this directory.
    sget or sgetd - ssh get or ssh get then delete files from this directory.

    The NPIB file, copyAPP.sh, contains the command to copy contents of the APP_.d directory to the "." directory which is the "server"/output/USER_NAME/APP/unique date-time directory.
     
    CONTENTS of copyAPP.sh: -----------------------------------
    
    #!/bin/sh
    cp /export/home/USER_NAME/public_html/npib/APP/APP_.d/* .
             


Contact: Dr. Ron Kriz
Revised 6/24/01
http://www.jwave.vt.edu/crcd/archives/npib1.6/usersguide/setup_public_html.html