UserPreferences

DevelopersManual


This describes Deme's technical internal workings for administrators and developers.

THIS IS OUTDATED AS OF DEME 0.4.0

For your own safety, always be careful to look at "last edited on" date at the bottom of the page...

  1. Overview
  2. Deme Architecture
  3. Storage: Database schema
  4. Storage: Directory Layout
  5. Folio items, Meeting area data
    1. comments
    2. folio items
      1. OOP -vs- SQL annoyances
      2. the folio items
  6. Meeting Area Interface
  7. Other features
  8. Administration scripts
  9. Random development tips
  10. For PIECE developers

1. Overview

First of all, make sure to be familiar with Deme from a user's point of view. Learn from the live tutorial referenced on www.groupspace.org .

Deme runs on an apache/php/mysql platform on open-source unixes. So far it has only been tested on Linux (Redhat 9, php 4.2.2, mysql 3.23.58, apache 2.0.40)

Installation directions... currently, look at the README file.

A Deme installation on the server provides group spaces for any number of groups. A single Deme group is supposed to consist of a real-life group of people. Each group gets a set of its own resources:

Each user can sign up for an account for the entire Deme installation. A user once signed in, then must join a group to participate in it.

A meeting area contains a number of folio items and a number of comments which may be associated with particular folio items.

2. Deme Architecture

Deme is programmed in PHP using a MySQL relational database as well as the filesystem to store data. It makes liberal use of Javascript, CSS, frames, and other client-side browser technologies to create a more dynamic interface than can be done in pure HTML.

Architecture diagram:

http://groupspace.org/dev-manual-files/architecture.gif

One somewhat unique aspect of Deme is that, especially for the meeting area, lots of UI logic exists not as PHP code, but rather as Javascript embedded through php files. The client's browser's javascript/dhtml engine actually does more UI work than the server's php engine, for the meeting area.

A design deficiency is that the main/ and marea/ php pages may interact either directly with the database (by executing SQL queries) or else indirectly through the object wrapper layer. Consistency through the object wrapper layer would be preferable, but it's often more convenient to directly execute queries from a php page. (For example, newpoll.php inserts a new poll row in the database directly, instead of creating a new Poll object than calling an store-in-database method.)

3. Storage: Database schema

important to know is there's a Meta database, which holds information about users and other things related to the entire Deme installation. There's also any number of Group databases, one per each group.

The schemas are in the .skel.sql files. The setup scripts use them to create new databases.

XXX describe the entire 0.2.0 schema?...

4. Storage: Directory Layout

Each group has its own subdirectory, in parallel layout to code/. The subdirectories in code/ are usually not used, but rather are templates to set up the subdirectories. An exception is for interface and operations that happen outside any one particular group, e.g. a user's home page.

[XXX andrew is this current and correct?]

5. Folio items, Meeting area data

Folio items are things that can be viewed and discussed in the meeting area. Folio items are viewed and navigated in the left pane; Comments on them are viewed and navigated in the right pane.

5.1. comments

There are a number of comments belonging to the meeting area. Each one may or may not be associated with an individual folio item.

An individual message is represented as a row in the msgs table. It has its message text and references to its parent and the folio item it may refer to.

5.2. folio items

5.2.1. OOP -vs- SQL annoyances

Note that usually we think of data objects "containing" a list of objects. In a relational databse, representing this can take two forms:

  1. have one column "list_of_bla" of a text/string type, with a format of being comma-separated, or a serialized php array, etc.

  2. have a separate table for the subitems, with a who's-the-owner table. Thus every message in msgs knows which marea is its owner; the one specified by discoowner_id. (This is a bad quirky naming scheme; in all other subitem tables, the column name is just the same column name as in the owner type; thus table docs has a column marea_id denoting to which marea each individual doc belongs.)

5.2.2. the folio items

Current folio item types include

XXX go through every single one and explain their oddities as well as marea/ related code.

XXX new-poll.php is crazy, see comments there

XXX make sure to explain the model for Decision system and php "polymorphism". The nascent command line testing framework for decision making code.

6. Meeting Area Interface

See /MeetingAreaInterface

7. Other features

library, member list, bulk subscribe....

8. Administration scripts

addgroup.sh, rmgroup.sh

see README for their usages

9. Random development tips

MassiveFindAndReplace

10. For PIECE developers

See PiecePrivate/DemeDevelopers