Internet Technologies Assignment 2005
(Deadline: 4pm, Thursday 19th Jan, 2006)
Here are the instructions for your assignment for this course.
Note that we are delivering this course to both Final Year Undergraduates
and to Masters level students and that the credit weighting for the course
is greater for the latter. For this reason there is an additional, compulsory,
component to the assignment explicitly for Masters level students only.
Remember, this is an
assessed piece of work. Please do not collude
or plagiarise other peoples work as the standard university penalties for
doing so will be applied. Please contact me if you are unsure about what the
standard university rules on this are.
The goal
It is a tradition in this country for couples who are getting
married to create a list of gifts that would be suitable as wedding
presents. The list is distributed to their friends and family and the
purchasing of items is coordinated somehow so that no single requested gift
is purchased more than once.
Coordinating purchases of gifts can be done reasonably well by distributing
the gift list as a webpage and allowing the users to register the fact that they
are going to or have bought a particular item.
We are going to build a small web application to achieve this task:
- We will design an XML based markup language to store all of the data
regarding users of the site and the list of gifts
- We will write a DTD or XML Schema for this language.
- We will use CSS2 to pretty print the data in Firefox.
- We will use XSLT to transform the stored XML for display and updating.
- We will use a combination of Java servlets and Javascript to dynamically generate and deliver the webpages.
Note:
You will need to know some basic HTML/XHTML for this assignment. This is not being covered
in the lecture material and it is your own responsibility to learn it. I'll point out in the
assignment instructions the places where it is needed.
Specification of the webpages
This specification details what functionality must be provided by
the application. It does this by listing the information which must be provided on a
series of webpages. For convenience, I have numbered these Pages 1 through 3.
Page 1
- There will be a welcome page which allows the user to enter their unique username
for the system. Usernames should be at most 5 characters long and may contain no whitespace.
- Users may be categorised as 'admin'
- Only users who enter a valid username may enter to Page 2.
Page 2
- The user's real name will be displayed as a greeting.
- There will be a list of gift items displayed by name and price.
- Hovering the mouse cursor over a gift name will cause a longer description of the gift to become visible.
- Removing the mouse cursor from over the gift name will cause the longer description to become hidden.
- The number of instances of each gift required will be displayed.
- There will be some kind of input form to allow non-'admin' users to register that they intend to buy a (number of a) particular item.
- For each user, a 'status', i.e. the items for which they have registered an intention to buy and/or have bought will be displayed below the gift list. A total price will be displayed for all of the items. This status must be created at client-side.
- For each item in the status which has not yet been purchased, a delete option will be provided for removing intentions to buy.
- For each item in the status which has not yet been purchased,
a confirm option will be provided to register that the gift has been purchased.
- For 'admin' users, a link to a summary page (Page 3) will be provided.
Page 3
- A list of all items registered as intended purchases will be displayed by the gift
name followed by the real name of the users who registered the intention.
- A list of all items which have been confirmed as purchased will be displayed by the
gift name followed by the real name of the users who purchased it.
The webpages must be generated and served dynamically using Java Servlets.
The changes to the data must be persistent and stored in a single XML file
located at the server.
The instructions
Part One - example markup
Write an example XML document which contains
- the details of a number (minimum three) of users
who will have access to the gift list. Read the specification above carefully to determine
what information is required.
- the details of all of the gifts requested. The sort of information that could be provided here is
- the gift name
- a description of the gift
- the price of the gift
- a link to a website where the gift can be purchased
- the number of instances of this gift requested (e.g. 6 small bowls)
The exact markup you use is up to you. We will be assessing your choice based on its
suitability for meeting the specification and its ease of processing rather than its
suitability for the application domain.
You need to submit a printout of your example XML document.
Part Two - the markup language
Design a markup language for the gift list application.
Write a DTD or XML Schema to describe your markup language.
Be as restrictive in your DTD/Schema as befits this application as more marks
will be given to more precise markup language specifications, where appropriate.
Note that XML Schema actually allow for more precisely specified markup. This is
a benefit of using XML Schema as opposed to DTD. As a consequence, more marks will be
available for solutions using XML Schema.
Your example document
provided in Part One must validate against your DTD/Schema.
You need to submit a printout of your DTD/Schema document.
Part Three - XSLT transform
Write an XSLT transform which takes as input a document which validates against
your DTD/Schema from Part Two and produces as output, an (X)HTML document which can
be used as Page 3 of the assignment specification. You should include
CSS2 stylesheet declarations in your transform output to render the information in a reasonable
manner.
You need to submit a printout of your XSLT transform code.
Part Four - Welcome page in (X)HTML
Write an XHTML (or HTML if necessary) document which will display a welcome
message and provide a form which will accept a username (Page 1
of the specification).
The action of the form should be to call a Java Servlet which we will write in Part Five.
Embed some Javascript in your document to validate the form before submitting
the post to the server.
You need to submit a printout of your (X)HTML document.
Part Five - Java Servlet
This is the core of the application. You need to write a Java Servlet which will do the following:
- Check the username to see if it is an actual stored user, only proceed if it is.
- Transform the stored gift list xml document to be suitable for output as a gift list as per the Page 2 specification.
- Serve the page content as (X)HTML including, styling information and
some embedded Javascript which, when executed in the browser,
will display status information for users as per the Page 2 specification.
- Process updates to the page caused by interaction by the user by updating the stored XML gift document (do not invalidate it), and re-serving the page.
You need to submit a printout of your Java Servlet source code.
Extended assignment for Masters level students
Part Six - RSS feed
Develop an RSS feed
for the application which 'admin' users may subscribe to. The feed
will contain a list of all transactions (i.e. registration of intent
to buy, confirmation of purchase and deletion of intents) and the
user associated with the transactions. This feed should be
automatically updated by the Java Servlet of Part Five.
You need to submit a printout of your (revised) Java Servlet source code
(note there
is no need to submit the solution to Part Five if it is contained in this document also).
You also need to submit a printout of an example feed document created by your code.
Mark Scheme
There are two different mark schemes for this assignment. One
for Final Year Undergraduates and one for Masters level students.
Undergraduate Mark Scheme
- Part One : 5 Marks
- Part Two : 10 Marks
- Part Three : 10 Marks
- Part Four : 5 Marks
- Part Five : 30 Marks
Total: 60 marks, forming 60% of the overall course mark
Masters level Mark Scheme
- Part One : 5 Marks
- Part Two : 5 Marks
- Part Three : 7 Marks
- Part Four : 3 Marks
- Part Five : 25 Marks
- Part Six : 15 Marks
Total: 60 marks, forming 60% of the overall course mark