Dovetail Survey Site Example

Kevin Gilpin
Last Updated...

Contents

Overview

The Survey Site example is meant to serve as a comprehensive example of the features and usage of Dovetail. It implements a web site which poses survey questions and records the responses. Users can optionally be required to log in to submit a response, the example site also implements user login and new user registration.

It consists of:

Build File

This example includes an Ant build.xml file. Once you have obtained the necessary software described in the Installation Guide, you are ready to build the Survey Site. From the examples directory, run the following commands:
prompt% ant
prompt% ant java-tests
The first command will do everything necessary to build the Survey Site into the build directory. The second command will run a few example tests ( t-survey-1.xml and t-survey-2.xml, located in the xml directory ) on some sample data.

If you have problems with the build, make sure that your mysql database server is running. Please use the SourceForge-hosted Help forum if you have trouble getting things to work.

Database Schema Document

The Survey Site database schema is described in the survey-schema.xml document. It consists of three tables:
RegisteredUser
Stores information about the site users, including a login name (userID), and password
Survey
Stores survey questions. Each Survey also specifies whether the site user must log in before submitting a response
SurveyResponse
Stores a set of responses for each survey question
Some of the Dovetail features which are demonstrated in this document are:

Web Site Document

The Survey Site web site is described in the survey-site.xml document. It contains two directories, auth and surveys.

The auth directory contains two pages that are used to login and register site users:

login
Consists of a Form into which the user enters her userID and password. The login is verified by a server-side Java bean, VerifyLogin.
register
This page is used by new users to register with the site. They submit a userID, password, and some additional information about themselves to the Survey Site. This information is processed by the Register bean.

The surveys directory contains three pages that are used to collect and display survey results

survey-ask
Poses a survey question and lists the responses. The user's response is processed by the SurveyRespond bean, and the user is then sent to the survey-results page.
survey-results
This page displays a summary of the survey results
survey-thanks
This is a simple HTML page which thanks the user for submitting a survey response

Some of the Dovetail features which are demonstrated in this document are:

Home