SchoolBell
==========

SchoolBell is a free and open source application to allow groups and
organizations to coordinate schedules and timetables.  Users may manage their
personal calendars, group calendars and calendars for resources, e.g., rooms,
projectors, etc, via a web interface, or using an iCalendar compliant client
such as Mozilla calendar or iCal.

SchoolBell is written in Python, and is a Zope 3 component as well as a
standalone calendaring server.  It is part of the SchoolTool project, funded
by the Shuttleworth Foundation.

Website: http://www.schooltool.org/schoolbell

Mailing list: http://lists.schooltool.org/mailman/listinfo/schooltool

Bug tracker: http://issues.schooltool.org/


System requirements
-------------------

- Python 2.3 or 2.4 (http://www.python.org/)
  (Debian users will need either python2.3 and python2.3-xml, or
  python2.4 and python2.4-xml packages)

- Zope X3 (http://www.zope.org/)
  (Users will require Zope X3 development trunk revision,
  Zope libraries of this revision are included with the distribution)

- libxml2 Python bindings (http://xmlsoft.org/).  Windows users can find
  binaries here:  http://users.skynet.be/sbi/libxml-python/

- (optional) the ReportLab Toolkit (http://www.reportlab.org), and
  Arial and Times New Roman TrueType fonts.  ReportLab is only needed if
  you want to generate PDF calendars.  To enable PDF support you will
  need to specify the path to fonts in the configuration file.

- Development environment and a C compiler
  (pre-compiled binaries are available for Windows users at the SchoolBell
  website)


Building SchoolBell
-------------------

Run 'make build update-translations' to build the necessary extension modules
and translations.  You will need to have gettext installed to compile the
translations.

It is a good idea to run 'make test' and 'make ftest' to check if all the
essential unit and functional tests pass.


Installing and Configuring with Distutils (optional)
----------------------------------------------------

WARNING: distutils does not yet take care of removing old packages or ensuring
that dependencies are correct. If you don't know how to resolve these issues
manually, you should probably use one of the packages or run SchoolBell from
an unpacked tarball/subversion checkout.

It is possible to install SchoolBell using python distutils.  To do this, you
have to use one of the distributed tarballs/zipfiles, which you unpack in a
directory with the tools appropriate to your OS.  First, it is necessary to
install the version of Zope included with the tarballs, this can be done by
running

python setup.py install

from the Zope3/ directory included with the SchoolBell distribution.  From the
top level directory of an unpacked SchoolBell tarball/zipfile SchoolBell can be
installed with:

python setup.py install

Finally, to setup a SchoolBell instance, copy the installed script into a
separate directory and create a config file with the name of the script and an
extension .conf.  A good template can be found in the top level of the tarball
(.conf.in). Running this script will then run an instance in that directory.

Those interested in installing into a non-standard location should investigate
the --paths and --default-config option for the install distutils commands.


Running SchoolBell
------------------

The top-level project directory contains the following executable Python
scripts:

  schoolbell-server.py      starts the SchoolBell server

The SchoolBell server automatically creates an empty database if it cannot find
an existing one.  You can customize the location of the database and a few
other parameters in a configuration file called schoolbell.conf.  There's
an example file called schoolbell.conf.in, you can simply rename it and modify
to suit your needs.

Beware that the file which contains the database, Data.fs, is not given any
special permissions to prevent it from being read by other users by default.
You will have to change the umask or the permissions of the file manually to
prevent unauthorized access.

By default a user with manager privileges is created in the new database.
The username is 'manager', and the password is 'schoolbell'.

The default web application port is 7080.  Once the server is running, you can
connect to it with a web browser.

The Makefile also contains several shortcuts, which are kept mainly for
backwards-compatibility:

  make run                  starts the SchoolBell server
  make build                build SchoolBell and the included Zope 3 libraries
  make test                 run the unit test suite on SchoolBell
  make ftest                run the functional test suite on SchoolBell

These commands are superseded by executable Python scripts in the top-level
directory.


Project structure
-----------------

  GPL                   the GNU General Public License, version 2
  README                this file
  RELEASE               release notes for the latest release

  Makefile              makefile for building extension modules
  setup.py              distutils setup script for building extension modules
  test.py               test runner
  remove-stale-bytecode.py
                        script to remove stale *.pyc files

  schoolbell-server.py  script to start the SchoolBell server
  schoolbell.conf.in    sample configuration file for SchoolBell

  build/                temporary files are placed here during build process
  debian/               Debian packaging support
  doc/                  documentation
  src/                  source code
    schoolbell/         Python 'schoolbell' package
      app/              The SchoolBell application
      calendar/         SchoolBell calendaring library for Zope 3
      relationship/     The SchoolBell relationship library.


Testing
-------

There are two sets of automated tests: unit tests and functional tests.
Unit tests (sometimes also called programmer tests) test individual components
of the system.  Functional tests (also called customer or acceptance tests)
test only externally visible behaviour of the whole system.

Tests themselves are scattered through the whole source tree.  Subdirectories
named 'tests' contain unit tests, while subdirectories named 'ftests' contain
functional tests.

To run all unit tests, do

  python test.py -pv

To run all functional tests, do

  python test.py -fpv

The test runner has more options and features.  To find out about them, do

  python test.py -h

Functional tests are are not completely isolated.  Some functional tests
create named database state snapshots, while other tests reuse those snapshots
of known database state.  The test runner does not know which tests create
which snapshots, so if you want to run just one (or a couple) of functional
tests in isolation, it is likely that you will have first run the full suite
to create the necessary snapshots.  Do not restart the test server, or all
saved snapshots will be gone.


Virtual hosting
---------------

SchoolBell provides support for virtual hosting with Apache's
mod_rewrite and libproxy.  For example, let's say you have two
SchoolBell instances running on ports 7001 and 7002, and you want to
make them available as school1.example.org and school2.example.org, both
on port 80.  In order to do that, add the following to your Apache
configuration file:

  NameVirtualHost *:80

  <VirtualHost *:80>
    ServerName school1.example.org
    RewriteEngine On
    RewriteRule ^/(.*) http://localhost:7001/++vh++http:school1.example.org:80/++/$1 [P]
  </VirtualHost>

  <VirtualHost *:80>
    ServerName school2.example.org
    RewriteEngine On
    RewriteRule ^/(.*) http://localhost:7002/++vh++http:school2.example.org:80/++/$1 [P]
  </VirtualHost>

Also, enable mod_proxy and mod_rewrite.


You can also get SSL support in the same way.

  NameVirtualHost *:443

  <VirtualHost *:443>
    ServerName school1.example.org
    SSLEnable          # Apache 1.3
    # SSLEngine On     # Apache 2.0
    RewriteEngine On
    RewriteRule ^/(.*) http://localhost:7001/++vh++https:school1.example.org:443/++/$1 [P]
  </VirtualHost>

The web application interface also supports virtual hosting in this manner,
the only differing thing would be the local port number.


Copyright information
---------------------

SchoolBell is copyright (c) 2003--2005 Shuttleworth Foundation

All files in the src/schoolbell directory are part of SchoolBell, and are (c)
Shuttleworth Foundation.

Unless otherwise stated, files in src/schoolbell are released under the
terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.

Files in the following directories are (c) their respective owners. See
the individual files and directories for details of the licences.

  Zope3

Files in the same directory as this README file are (c) Shuttleworth
Foundation, with the exception of GPL, which is a copy of the Free Software
Foundation's General Public License, and is (c) FSF.

Files in the debian/ subdirectory are (c) Shuttleworth Foundation and
contributors.


SchoolBell is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

You can find the full copy of the GNU General Public License in a file called
GPL in the project directory.
