PTG Assignment 1 : Generating web applications

Note 1: the assignment has changed, I have added a section on security.
Note 2: if there is time to spare, you are very much advised to take a good look at the technologies used to implement WebDSL in this assignment as this will save you a lot of work next week (specifically Stratego/XT, SDF and JSF).
Note 3: this assignment will be combined with the next (about adding RSS to WebDSL). The deadline of this assignment is therefore set to the deadline of the RSS assignment. You will use the results of this assignment in the next.

In this assignment you will implement a web application using the high-level, domain specific web application language WebDSL. The main goal is to demonstrate some of the principles and motivation behind program generation and transformation. It will also address some of the difficulties faced during the program generation.

You will implement a social bookmarking system, which is slightly more generic then most social bookmarking systems. In a social bookmarking system, registered users can define and share bookmarks (online) they like and browse bookmarks defined by others. The main idea is that the bookmarks you have registered defines some of your interests and can by connecting these interestst to interests of others, leas you to new bookmarks you might like.

In this assignment you will focus less on the social aspect of this bookmarking method (though you are free to try). Instead the focus will be on having a richer data model than usual, as to demonstrating the capabilities of WebDSL. You can find a description of the system below. For inspiration, you could look at existing social bookmarking systems. A list of systems can be found on Wikipedia.

For documentation on WebDSL, we refer to this webdsl.org Wiki and to us. We will of course be available at the exercise hours, but feel free to contact or visit us outside these hours to ask questions.

Informal specification of the domain model and the functionality

We have divided the functionality into two parts. A minimal application and optional extensions of this. The first is required to complete the assignment, the latter will improve the result, you are free to use your own imagination to change or provide additions to this extensions list.

Minimal application domain

Below you can find a list of each of the entities that should be available and editable in a minimal application. Their desciptions include some basic actions to allow elementary usage.

Bookmarks The most important entity of the system is the bookmark. A bookmark is not just a registration of a link, but a registration in the more generic sense of the word. Most (if not all) of the entities that can be contained inside the application should be bookmarkable. A bookmark itself holds at least the user that bookmarked it and the date it has been bookmarked.

Users The most obvious entities of the system are the users. Users should consist of some basic user information (name, nickname, emailaddress, website etc.). In addition to this, users can be member of one or more groups and can bookmark any bookmarkable item. The system should provide a means to register new users. Users can be made bookmarkable, but this results in the practical restriction that they require another user to be created. Therefore, you might want to consider to make the user the only non-bookmarkable entity of the system.

Groups A group can contain any numer of users and can have bookmarks associated with it (possibly through the users that participate in it). Similar to users, the system should provide a means to register new groups and to subscribe or unsubscribe users from the group.

Link Links are the most obvious bookmarkable items. in addition to the link itself, they should at least hold a short description of the link.

Images Similar to links images may be bookmarked. These can be images that are stored on an external server and registered via a link, or internal images that are uploaded to the server and displayed directly from the database. Due to restrictions in WebDSL we advice you to mainly look at internal images. Including external images may be an interesting extension.

Minimal application setup

In addition to the above requirements, the application should have a decent navigation and a practical interface. The handin should contain nicely written WebDSL code, which is easy to read and understand (include comments if these clarify the code).

Extending the application

Below you can find a list of suggested additions. Feel free to implement others:

  • Comments (each of the above items may be commented)
  • Tags (as in short topic names for all bookmarkable entities)
  • Friends (connections between two or more users)
  • Videos (using plugins via an HTML escape in the WikiText)
  • Rating (a rating system complete with averages on bookmarkable items)

Adding Security

As a second component of this assignment you will secure your web application by using the WebDSL access control DSL. More information about this DSL can be found here. The security should at least be group and user based and should contain a decent security policy. This means the system must at least have separation of private information, public information and information that can may be made available to 'friends'. This separation should be applied to both groups and users (it is up to you to define the notion of friend for both users and groups).

In addition to these policies, the system should support the regular mechanisms required to make the policy usable. These include functionality like login/logout, user registration, group registration and possibly forced unsubscription of users (kick/ban) and user management within groups. We advice you to take a look at the examples refered on this web page when implementing the login/logout or user registration functionality, these might save you a lot of time.

Setup

To enable a quick start, we have installed all required applications in advance on a virtual machine. You are of course free to install WebDSL and a database server yourself, but we would advice to use the image and start right away. You can download the virtual disc from the downloads page. More information on using this virtual disc can be found here.

The virtual disc has MySQL, WebDSL and JBoss (~/programs/jboss...) pre-installed. It also contains a sample WebDSL application that can be found in ~/programs/email. Try to build and deploy this application first. More information on how to do this can be found on the Getting started page.

While working on this assignment, remember to copy your own source files to another location, to make sure they do not get lost when the virtual machine is removed. You could also mount an external server directly by means of the sshfs command, which comes pre-installed. For example:

sshfs userName@someServer.someDomain:/home/userName someLocalDirectory
<And then to unmount the filesystem in the end, do>
fusermount -u someLocalDirectory

A backup inside the VM may be useful just before unmounting. You never know what might go wrong ;) You are free to change the system setup anyway you please. The root password (and any other password) is: reverse.

Guidelines

These are the most important aspects we will look at when grading the results:

  • Functionality of the application
  • Usability of the application (navigatability, user interfaces, ...)
  • Quality of the domain model
  • Quality of the WebDSL code (readability, maintainability, ...)
  • Creativity of the solution

Hand-in guidelines

The deadline of this assignment is the same deadline as the deadline of the next asignment. The two are combined (you will use the result from this assignment while implementing RSS support)

As deliverables, we would (really) prefer not to receive your virtual discs... Just the application files (uncompiled) and the application.ini will suffice.

The deadline for this and the second assignment is on the 14th of March.

Further information

Also see the course page and the language documentation on this wiki.