Homework 4
CS520, Spring 2009


Due: Friday, May 8

Package all the source files of your project into a zip file using the zip Ant target you developed in Homework 1, and upload the zip file to CSNS. Note that file uploading will be disabled automatically after 11:59PM of the due date, so please turn in your work on time.


[Reading]

[CSNS Blogs]

For this assignment, complete the following features of CSNS Blogs you started in Homework 3:

1. (20pt) Display the list of blogs.

In the top menu Resources, add a menu item Blogs. When a user clicks on Blogs, the system displays a list of existing blogs. For each blog, the list includes the title of the blog, the name of the owner, and the date of the last blog entry. The blog list must support paging with two blogs per page.

2. (30pt) Create a blog.

If a user does not have a blog, when the user visits the blog list page, the system should show a link or a button that says "Create Your Blog". When the user clicks on the link or button, the system displays a form where the user can enter the title and the description of the blog, as well as a URL for the banner image. Validation must be in place to ensure that the title and the description are not empty, and the title of the blog is unique.

Note that anonymous users (i.e. users who are not logged in) should not be able to create blogs. And after a blog is created, the user should be redirected to the blog page (described below) so the user can start blogging.

3. (30pt) Display a blog.

On the blog list page, if a user clicks on the title of a blog, the system should display the blog using a two-column layout as follows:  

Banner Image (optional)
Title
New Entry

The five most recent blog entries in reverse chronological order
Description
Archive

For each blog entry, display the title, content, date, and number of comments for the entry. For archive, display the years and months in which blog entries were posted, and for each month, the number of entries posted in that month. You may want to check out a few blogs on Blogger.com to see what the blog page should look like.

(20pt) Create new blog entry.

When a user clicks on New Entry, the system displays a form where the user can enter the title and the content of the entry. You must use TinyMCE for the content input, but for this assignment you don't need to worry about file attachment. After the user creates a new entry, redirect the user back to the blog page. Note that only the owner of a blog can post new entries to the blog.

(+15pt) Themes.

For the purpose of this assignment, we define a theme as the combination of the layout of the blog page, and the colors of background, blog title, blog entry title, and blog entry text. For extra credit, create two themes and allow a user to choose between these two themes during blog creation.

[About Submission and Grading]

Before submitting your work, commit all the changes to your Subversion repository and create a tag.

If you use any libraries that are not in the original CSNS and are not included in your csns.zip, please upload the library jar files together with csns.zip when you submit your work.

To test your project, we will use the following SQL scripts in your csns.zip to create, populate, and then clear the database:

Please make sure that these scripts are up to date and can be run in their entirety without generating any errors. You can check out http://sun.calstatela.edu/~cysun/public/cs520-grading/instructions.txt for more details about the grading procedure.