CourseWork is a Java Servlet Web Application which provides course
management services, including a coursehomepage, syllabus, announcements,
schedule, on-line course materials, assignments, discussion boards,
and a gradebook. This document describes the basic system architecture
of the current implementation of CourseWork at Stanford University.
CourseWork application is comprised of two tiers:
A servlet-based Web Application running under Apache Tomcat.
2) An Oracle 8i database.
are utilizing Apache Tomcat 3.2.3 as our Java Servlet engine. CourseWork
has been tested using both Java 1.3 and Java 1.4.
database component of CourseWork was designed to run as a single
user schema inside an Oracle 8i instance. We are currently using
are using the JDBC drivers which come with Oracle 8.1.7. We have
used both the Thin driver and the OCI-8 driver. These drivers are
contained in the file classes12.zip which comes with Oracle 8.1.7.
We repackaged these as a JAR file to include inside the /lib directory
of our web app, though that is not absolutely necessary if you want
to manually adjust your CLASSPATH to include the zip file.
is supported by a single SQL database schema. The schema can be
divided into a "Core" set of tables used by the entire
CourseWork application, and individual sets of tables used by each
schemas can be found here.
web application is distributable as a single WAR (web application
archive) file. We build the WAR file using the Apache Ant tool.
The web application is comprised of a set of servlets, supporting
Java packages, a library of JAR files, configuration files, static
HTML files, and a set of templates which control the user interface
for the application. These templates are used in conjunction with
a templating engine called "Dynamic Templating Language",
or DTL, that was developed here at Stanford University by Highwire
Press. DTL will be discussed in more detail later in this document.
developer directory has the following structure:
/conf - configuration
files for developer webapp
/devprodconf - conf files for the prod webapp on your dev server
/preprodconf - conf files for the preprod server
/prodconf - conf files for the production server(s)
/etc - web.xml file
/dtl - dtl templates
/lib - 3rd party JAR files
/src - CourseWork Java code
/web - static HTML files
build.xml - Ant build specifications
build - Ant build file
Java code includes servlets and supporting Java packages.
servlets control core functionality of CourseWork - creating and
editing courses, site-level user administration, etc. These servlets
of the servlets are Tool servlets. Each tool typically has two servlets
- the student view, <tool>.java,
and the Admin View, Admin<tool>.java.
For example, the Announcements tool is composed of Announcements.java
B. Core Packages
The supporting Java packages are all under edu.stanford.coursework.*
There are two "core" packages which support core functionality
throughout the CourseWork system: edu.stanford.coursework.core and
edu.stanford.coursework.common. "Core" contains the four
main objects for CourseWork - Nexus, Person, Tool, and Content.
The Nexus object represents a course, a section of a course, or
a department. The Person object represents a user of CourseWork.
The Tool object represents a tool in the CourseWork system (as represented
by a button in the NavBar). Finally, the Content object represents
a single piece of content (either an uploaded file or a URL) used
in CourseWork. Person, Tool, and Content objects can all be associated
with one or more Nexus objects (except Content objects where the
relationship is always to a single Nexus).
in CourseWork, including these core objects, have three associated
java classes - the object, a controller, and an SQL file. The object
contains constructor methods, get and set methods for each field,
and a "toDTLObject" method which creates a DTL object
from the object. The Controller class contains static methods to
get, create, save, remove objects from the database, as well as
other methods to manipulate objects. The SQL class contains static
string fields for each of the SQL query statements used in preparedStatements
to execute database transactions. For example, the Person object
model is comprised of "Person.java", "PersonController.java"
other objects used throughout the CourseWork system besides the
four core objects. These include an abstract "BaseServlet"
class, a SessionController to read and modify a user's HttpSession,
and the NavTrail object used to construct the "bread-crumb"
trail at the top of each CourseWork page.
C. Tool Packages
Each tool also
has an associated package:
To create a
new tool for CourseWork would require the introduction of a new
package for the tool as well as the student and admin view servlets.
The object model
used in the current CourseWork tool follows very closely the object
model for the core objects, eg, Announcement.java, AnnouncementController.java,
For more information
on particular Java packages, please consult the CourseWork
Dynamic Templating Language (DTL)
utilizes a Java-based system called Dynamic Templating Language,
or DTL, to render all HTML output. DTL was developed at Stanford's
Highwire Press (www.highwire.org) and is included as part of the
open source distribution of CourseWork as a JAR file (lib/dtl.jar).
DTL allows the CourseWork code to create DTLObjects from regular
Java objects and pass these to a DTL template, where tags within
the template get replaced by the DTLObject variable definitions
to create HTML output. DTL is extremely fast and efficient and contains
rich functionality for doing variable replacements.
This font color is <FONT COLOR=[[$COLOR]]>grey</FONT>.
Or in Java Code:
DTLObject mainDTL = new DTLObject();
more instructions for how to use DTL, the following are available: