Assignment #4

Assignment 4

This objective of this exercise is to learn to learn some other basic features of Cold Fusion and get a feel for developing database driven Web applications. In this assignment, we will use a new database called "SportingGoods." It is a simpler database than the one we used earlier, but the exercises we will do will be different. In addition, I will not provide you with the type of help I provided in the earlier assignment (by providing much of the code you needed in the example application). Download the database that is used in this example. Double click on the downloaded file and unzip it to a directory of your choice.

This could turn out to be a very time-consuming exercise for those of you who have little technical (web & database) experience. I suggest that you begin working on it right away. Expect to spend a good deal of time on it.

First, make sure you really understand the SportingGoods database. The tables, relationships, and keys (primary and external) are particularly important. The Cold Fusion name for the database is "SportingGoods."

  1. Develop a set of pages (form and results) that will allow a user to find the distributors in a given state by providing the state abbreviation. If no distributors are available in a state, your output should tell the visitor that. When one or more distributors exist, your output will provide the company name, address, city, state and zip code.
     
  2. Develop a set of pages that will allow users to search for products that meet certain characteristics. So, for example, if the user searches for "100% cotton," you will list all products that have 100% cotton in their description, along with the company name of firms that provide such clothing.
     
  3. Develop a set of pages that will allow a user (probably your staff) to enter information for new distributors as you develop relationships with them. It will allow a user to enter data for all the fields in the Distributors table, except for the Distributor_ID field which is a auto numbered field and it entered automatically. Your system will check to make certain that you do not have duplicate company "names and addresses," (i.e., there cannot be the exact same company at the same address) and when there is a duplicate, will inform the user that it is a duplicate. Your system will also make certain that a user enters information in each of the input boxes. After you have added a new distributor, you should check for the new distributor by trying to find them using your solution to number 1 of this assignment.

    In addition to inserting a new distributor in the database, the page that does the insert will send an e-mail message to temp@dossantos2.cbpa.louisville.edu using as your SMTP server smtp.louisville.edu and your name and e-mail address as the Sender. The body of the e-mail message will include all the new information entered in the database and the URL of the page from which the message is being sent (environment variable). To make sure that this is working as required, you may also want to have the page send you the same email message.

I will provide a link on the more page that will enable you to reset the database to its original form when you wish to do so, so that you do not have to deal with records that have been entered by others as they work on number 3. The reset will take a few minutes to become operational as it requires that the database cache be expunged from memory.

The experience you gain from this exercise will further improve your understanding of what it takes to develop online database driven applications.

Please note that this is just a start. Commercial applications will require numerous controls and extensions to safeguard against potential problems.

© 1999 Brian L. Dos Santos