PackageDescription: Glorp-Examples-Calendar
Glorp - Examples - CalendarLast published: November 9, 2010 by 'markr'
Defines 12 Classes
Extends 12 Classes
A simple event calendar web application to illustrate the use of Glorp.
Description
The Calendar application provides a web interface that displays a month calendar allowing you to view, add, and edit a collection of events, and a Glorp interface for persisting the events in a database.
Usage
The Calendar application requires that you first load the Web Toolkit (WTK). With the WTK loaded, open a Server Console (use the Web menu in the VisualWorks Launcher), and click on "Create Server". The Server Console expands to display various options. Select "Smalltalk HTTP Server" for the server type, and 8008 for the port. You may also wish to select "Start server on system startup". When all options have been selected, click on "Create and Start". The server is now running.
In a web browser, open this URL:
http://localhost:8008/servlet/CalendarServlet
The Event Calendar application appears in the web browser, showing the current month. To enable the application to save events in a database, you must set its configuration by clicking on the "Settings" button (upper right corner of the window) and filling in all appropriate options. When finished, click on "Accept" to update the database configuration. The Event Calendar will test the specified database connection and report success or failure.
Implementation
Event objects are represented using the domain class CalendarEvent. The application model CalendarApplication coordinates the database with the web UI. Its API for the web UI may be found in the 'actions' protocol. The descriptor class CalendarDescriptor contains the Glorp mapping metadata. The class CalendarServlet provides the main web UI, with the other servlet classes (its subclasses) providing support functions.