FINAL
CS320, Spring 2006


Please upload your files using CSNS. The files should include all the source code, documentation, and an HTML file final.html which contains a link to your application on the CS server. Note that file uploading will be disabled automatically after 10:00PM, and late turnin will not be accepted.

[Introduction]

[CD Storage Box]

I have many CDs, and it would take a lot of space to keep them in their original packages. So instead, I keep my CDs in CD storage boxes, like the one shown in the image on the right  (click on the image to see a larger version). Note that a CD storage box contains a number of CD sleeves, and each sleeve is numbered and can hold one CD.

The problem with a large CD collection is that it's quite difficult to find a CD unless you know exactly where it is. So in this exam, you are going to develop a web application that helps me manage my CD collection, using, of course, JSP without scripting elements. In the rest of the problem description, we will refer to this application as CDList.

[Database]

CDList stores information in a databases, which consists of at lease two tables, one for the boxes and one for the CDs. The box table contains the following information:

For each CD, the CD table keeps the following information:
You may use additional tables and/or fields if necessary. At the end of the exam, you need to turn in a final.sql file which include the SQL statements to create all the tables in the database, and the statements to populate the tables so that there are at least two boxes and four CDs in the database.

[Display]

The main page of the application is CDList.jsp. When this page is requested without any parameters, it displays the CDs currently stored in the database as shown below:

Add New CD | Display All CDs
Box ID Sleeve # Name Serial Operations
101 1 Microsoft Windows XP ABCD-EFGH-HIJK-LMNO
Delete | Edit
101 2 Cannon Digital Camera Driver
Delete | Edit
102 1 Diablo II - CD 1 0123-4567-890A-BCDE
Delete | Edit
102 2 Diablo II - CD 2
DeleteEdit

[Search]

A user may search for CDs by giving a keyword, and the application will display only the CDs whose name contains the keyword (case-insensitive). For example, if a user search for "camera", the application should displays the following:

Add New CD | Display All CDs
Box ID Sleeve Name Serial Operations
101 2 Cannon Digital Camera Driver
Delete | Edit

If the search does not return any result, the application should display the following:

Add New CD | Display All CDs
Sorry, no CDs are found.

The user then may perform another search or simply click on the Display All CDs link to view all the CDs again.

[Add] 

When a user clicks the Add New CD link, the application displays the following page which allows the user to add a new CD:

Box ID:
Sleeve #:
Name
Serial

To receive full credit for the Add feature, your implementation must meet the following requirements:

The application should redirect back to the main CDList.jsp page after a CD is added.

[Delete]

To delete a CD from the database, a user may simply click on the corresponding Delete link.

[Edit]

A user may edit the information about a CD by clicking on the corresponding Edit link. The Edit interface is similar to the Add interface, except that the form should be pre-filled with the current information of the CD (including the right box ID being selected), as shown in the example below:

Box:
Sleeve #:
Name
Serial

And also like in the Add feature, you application should check whether the combination of the box ID and the sleeve number conflicts with any other CD in the database. After the new information of the CD is saved, the application redirects back to CDList.jsp.

[Grading Criteria]