CS 549, Spring 2008
Assignment #5
(total = 20 pts., due on May 14, Wednesday)

You must work individually on this assignment.

Part I: Checking out Required Software (0 pts.)

  1. If your Unix prompt does not indicate the host name and the full path of your working directory, add the following statement to your ~/.bashrc on an ENGR Linux machine or to your ~/.profile on shell.onid.orst.edu.
      export PS1="\h \w \!% "
    
    Then issue Unix command source ~/.bashrc or open a new terminal.

  2. If you do not have files .bash_profile and .bashrc, you may copy these files from ~minoura on an ENGR machine or ~minourat on shell.onid.orst.edu and change minoura or minourat to your login name.

  3. Update the files previously checked out from the CVS repository by issuing the following commands:
      cd ~/public_html/ms_apps/fishing_v2
      cvs up -d
      cd ~/public_html/drupal-6.2/sites/all/modules/custom
      cvs up -d
    
    Note that the files under drupal-6.2/sites/all/modules/custom were originally checked out from drupal_6.x_custom_modules.

Part II Drupal Site for Fishing

We are interested in creating a Drupal site for fishing, integrating content management (CM), social networking (SN), and Web-based GIS/database features.

In particular we want to complete the following tasks.

  1. To provide an artistic design of the site.

  2. To organize general documents on fishing.

  3. To create a template for generating a module that works for a non-core table as modules node_example and announcement do.

    1. The primary key should match the primary key nid of table node. You do not need to consider attributes modified_date, modified_by, and row_owner_id.

    2. Use the table name as the module name. The major functions to be modified are as follows:

      1. hook_node_info() -- provides information on the node type defined by the module.

      2. hook_form() -- defines a form configuration.

      3. hook_validate() -- checks form parameters submitted.

      4. hook_insert(), hook_update(), hook_delete(), and hook_load() -- performs operations on additional tables other than table node.

      5. hook_theme() -- provides information on the theme functions and templates defined.

      6. theme_xxx or xxx.tpl.php -- each theme function or template with theme ID xxx.

      7. template_preprocess_xxx() -- prepares variables used by the template with theme ID xxx.

    3. An example of handling the date type can be found in announcement.install and announcement.module in module custom/announcement.

  4. To convert ms_apps/web_gen/tmpl/config.tmpl into form_gen.tmpl so that it can generate the definition of a form, i.e., hook_form(), for a database table.

  5. Once the module template and the form_gen.tmpl are completed, each student can work on one major table and the tables associated with it in the fishing_v2 database. SQL statements for creating tables in the fishing_v2database can be found in file create_fishing_tables.sql in ~/public_html/ms_apps/fishing_v2/sql_queries/.



  6. To implement module set_params. This module accepts parameters from a form displayed as a block and sets those parameters in global variables. The parameters will be used by queries. For example, if the fishing zone is set to "Willamette", a search for fishing spots will be restricted to the Willamette zone.

    1. The parameters to be supported are ODFW Zone, Waterbody Type, Waterbody, Fish Type, Fish Species, Fishing Season, and Fishing Method,

    2. When a ODFW Zone and/or a Waterbody Type are selected only the waterbodies related to the selected ODFW Zone and/or Waterbody Type are available as options for Waterbody.

    3. When a value of Fish Type is selected only the fish species of the selected Fish Type are availabe as options for Fish Species.

    4. The parameters selected need be stored as the session variables and as the global variables.

    5. The values of these parameters can be used to eliminate dropdown-menu layers. The options of each of these layers are restricted to one because of the parameters, and hence the menu layer is not necessary. They also can be used in the where clause of an SQL query to restrict the range of the query.

  7. To convert the scripts in ~minoura/public_html/ms_apps/fishing_v2/forms/dropdown_menu2 to a Drupal module, or you may locate a Drupal module that implements a horizontal dropdown menu and modify it.

    1. The structure of the dropdown menu must be dynamically changed based on the parameters set as global variables by module set_params. For example, if the fishing zone is set to "Willamette", the menu layer for selecting a fishing zone must be skipped. This can be done by modifying the array dynamically defined in file dropdown_menu.config.

    2. Make it possible to retrieve optionally the data for children nodes only when their parent node is selected.