Homework 3
CS520, Spring 2010
Due: Thursday, April 29
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]
- Hibernate Book (Java
Persistence with Hibernate)
- Chapter 1-6 (or corresponding chapters in Hibernate in Action).
You may skip anything related to XDoclet,
Annotation, JPA, and EJB.
- Hibernate
Documentation
- CSNS Source Code
- Model classes under src/csns/model and
src/csns/model/forum.
- Hibernate mapping files under src/hbm and src/hbm/forum.
[CSNS Wiki]
CSNS Wiki is a
new component of CSNS which you will develop in this quarter. In
this homework you are going to implement the model classes
and the database schema based
on the following requirements:
- A wiki page is uniquely identified by its path.
- Any CSNS user can create wiki pages. A wiki page may be protected by a password.
- A wiki page may have file attachments.
- Any CSNS user can edit a wiki page, and each edit creates a new revision of the page. The system must keep track of the author and the date of each revision.
- A user may revert a wiki page to an earlier revision.
- A user may subscribe to a wiki page so that whenever the page is changed, the user will receive an email notification.
- There should be a discussion area associated with each wiki page. To see an example of a discussion area, click on the discussion tab of the CSWiki's main page.
Note that in MediaWiki - the software that powers CSWiki, a discussion
area is implemented as a special wiki page that consists of a number of
sections. In CSNS Wiki, the discussion area should be implemented as a
set of topics in a special forum called Wiki Discussion.
[Model] (30pt)
Design and implement the model classes and place them in the package csns.model.wiki. You may also need to change some existing classes.
Note that in this assignment you only need
to create the model classes. Operations such as creating and editing wiki pages will be implemented later in
subsequent
assignments.
[Hibernate Mapping] (30pt)
Create Hibernate mapping files for the classes you created in
the previous exercise and place them under src/hbm/wiki.
You may also need to change some existing mapping files. Run the hbm2ddl
Ant task to generate a new db/csns.ddl
file and check if the database schema is what you expect.
[Database Scripts] (20pt)
Based on the csns.ddl
file generated in the previous exercise, modify the following database
scripts:
- db/csns-create.sql
- add the SQL statements to create the tables/constraints for the wiki.
- db/csns-drop.sql
- add the SQL statements to drop the tables/constraints for the wiki.
[Subversion]
Commit all the changes to your Subversion repository, and
create a tag called cs520-hw3.