CS 549, Spring 2007
Assignment #1
(total = 5 pts., due on April 6, Friday)

You may work on this assignment as a group of two students. If anything does not work as described here, notify the instructor immediately.

In this assignment, you will set up the directory structure that will be used in future assignments. You also learn how to use WebGen, which can automatically create a Web interface for a database.

  1. If you are not using bash as your shell program, it is highly recommended to change your shell to it.

  2. In order to make the CS 440 CVS repository work for you, add the following lines to your .bashrc file in your home directory:
    export PATH=$PATH:~/bin:.:../../../web_gen
    export CVSROOT=:ext:cs440@amazon.een.orst.edu:/home/cvs_cs440
    export CVS_RSH=ssh
    
    You may also add the following statement to let your Unix prompt indicate the host name and the full path of your working directory:
    export PS1="\h \w \!% "
    
    Then issue Unix command source ~/.bashrc or open a new terminal.

  3. If your shell program is csh or tcsh, make the above changes to file .cshrc as
    set    path=($path ../../../web_gen)
    setenv CVSROOT :ext:cs440@amazon.een.orst.edu:/home/cvs_cs440
    setenv CVS_RSH ssh
    
  4. In your public_html directory, check out from the CVS repository the required modules by issuing the following commands:
    cd ~/public_html
    cvs co -P ms_apps_cs440
    
    Use password CSy549. Please do not check in any modified files without first talking to the instructor.

  5. Delete the erp_cs440 application as follows:
      cd ~/public_html/ms_apps_cs440
      rm -rf erp_cs440
    
  6. From now on, you may periodically update the files checked out from the CVS repository by issuing the following commands. If any WebGen command fails, do this first.
      cd ~/public_html/ms_apps_cs440
      cd framework_v3
      cvs up -d
      cd ../web_gen
      cvs up -d
      cd ../treeview
      cvs up -d
    
    You may also update the directories containing applications such as ms_apps_cs440/mantis and ms_apps_cs440/zen_cart. However, if you have modified any files extensively in a application directory, back up the directory before you issue cvs up -d command as
      cd ~/public_html/ms_apps_cs440/forms/mantis/
      cp -pr forms_mysql forms_mysql.bak
      cd forms_mysql
      cvs up -d
    
    The files updated are flagged with U or P, and those modified by you are flagged with M. If you see files flagged C, the updates made by you and the updates made to the files in the repository after your checked out your copies are not compatible. If you want to keep your updates, copy your copies from the backup directory. If you think that your modifications make the application better, see the instructor before your changes are checked in to the repository.

  7. Change the login name, the database name, and the password in file ~/public_html/ms_apps_cs440/cs275/forms_mysql/datasource.php to yours. The PHP scripts do not access a MySQL or PostgreSQL database directly. Instead, they access a database by using member functions of class DB_Sql defined in file db_mysql.inc or classDB_Pgsql defined in file db_pgsql.inc. The selection of one of these include files based on the DBMS type is performed at the beginning of file framework_v3/common.phtml.

  8. Create table employee by executing SQL script create_employee_my.sql in directory ~/public_html/ms_apps_cs440/cs275/sql_queries.

  9. Visit
    http://nagara.een.orst.edu/~your_login_name/ms_apps_cs440/cs275/forms_mysql/emps
    
    and open PHP script employee_search.phtml. Check that the search, select, and edit forms work correctly. Check also that the Insert operation activated from the select form is correctly executed. The instructor's directory is http://classes.engr.orst.edu/eecs/winter2007/cs440/ms_apps/cs275/forms_mysql/emps

  10. In directory ~/public_html/ms_apps_cs440/cs275/forms_mysql/emps, issue Unix command
        confgen -f employee
    
    The confgen command executes ~/public_html/ms_apps_cs440/web_gen/confgen, which in turn activates ~/public_html/ms_apps_cs440/web_gen/tmpl/config.tmpl, which includes ~/public_html/ms_apps_cs440/framework_v3/db_mysql.inc.

  11. Change the current directory to ~/public_html/ms_apps_cs440/cs275/forms_mysql/emps, and issue Unix command
        webgen employee
    
    PHP scripts employee_search.phtml, employee_select.phtml, employee_edit.phtml, employee_action.phtml, and employee_info.phtml are regenerated. Check with a Web browser that the scripts generated are still working.

  12. Provide a screenshot of your forms, whose URL must be recognizable. The data displayed must indicate that your scripts are connected to your database.