NOTE

NOTE: PRES is very much end-of-life. It is old software, and I would not advise starting a new installation. If you're actually using it for something and need support, I can and will support it.


About PRES

PRES (the Press Release System) is a simple content management system, essentially targeted at producing a news and information site. Managing a PRES system is designed to be simple. However, presentation is sophisticated and flexible. An elementary knowledge of IT would be useful but expertise in designing and managing websites is not a requirement. PRES can be used for anything from private 'blogging' to corporate news systems.

Features

Flexible Presentation
All content is generated as XML which is styled at server side with XSL-T stylesheets to provide the final look and feel of your pages. This permits an almost infinite variety of presentations. Furthermore, different XSL-T transforms can be associated with different 'categories', allowing you to have different styling for different parts of your site.
Caching
Content is generated on request, but in order to limit the computational load on busy sites all content is cached for a limited period (by default twenty minutes).
Subscription
PRES allows users to 'subscribe' to 'categories' - effectively sections of the site. When new stories are posted to a section you're subscribed to, you will automatically get email with a link to the story.
Syndication
PRES makes its headlines available as a syndication feed, using both RSS 0.91 and RSS 1.0. This allows other news sites to automatically incorporate live headlines from a PRES site into their content.
Threaded Discussion
PRES optionally allows registered users to add comments to stories in a threaded manner, similar to sites like Slashdot.
Moderation
PRES optionally allows registered users to 'moderate' other users' comments.

PRES in Action

There are Several PRES installations on corporate Intranets. PRES systems which are on the public Internet include

Alasdair Morgan MSP
Alasdair Morgan was the original customer for whom the PRES system was built. At the time of writing his site is running PRES 1.6 running on Debian Linux with Tomcat 4.04. Alasdair Morgan's site uses several customised templates.
Wired for Ideas Ltd
At the time of writing this is PRES 1.7pre2 running on Windows 2000 Server with Tomcat 4.1 linked to IIS. At the time of writing Wired For Ideas Ltd are using a very slight modification on the distribution XSL templates but a substantial modification of the distribution CSS stylesheet.
Stewartry Wheelers
My cycling club. At the time of writing this is running PRES 1.8rc1 on Debian Linux with Tomcat 4.0.3 and Postgres 7.2.1. This site uses a modification of the 'pregister' theme from the PRES 1.8 installer.

If you would like your PRES system listed in this section please write to me.

System requirements

PRES is delivered as a Java WebApp - that is, a collection of Java, XML and HTML resources intended to be served from inside a Servlet 2.3 specification Servlet Container, such as Tomcat 5 (indeed, although PRES should work with any compliant servlet container, the ones we test against and recommend are Tomcat versions 4 or 5).

It needs to have access to a relational database engine, and the only one which is really supported is Postgres 7. We know people who use PRES with MS SQL Server and with Oracle, and we're sure many other databases are possible; but we use, support and recommend Postgres.

For automatic thumbnailing of images to work on UN*X-like platforms, you should use a Java Development Kit later than 1.4.2 and the script which starts the Servlet container should pass the parameters

-Djava.awt.headless=true -Xmx128M -server

to the Java Virtual Machine (you will probably find this is the default). If you cannot do this, automatic thumbnails of uploaded pictures will

not work.

Your License

PRES is Free Software and is licensed to you under the General Public License. If you download the binary distribution from us using the instructions below, you will also receive the following components upon which PRES depends:

Components shipped with PRES
File Contents Produced by License
activation.jar Java Activation Framework Sun Microsystems Sun Microsystems, Inc. Binary Code License Agreement
crimson.jar Apche Crimson XML Parser Apache Software Foundation Apache License
jacquard.jar Jacquard Toolkit Web Engineering Factory and Toolworks BSD
jtds.jar jTDS (MS SQL Server JDBC Driver) CDS Networks LGPL
mail.jar Java Mail Sun Microsystems Sun Microsystems, Inc. Binary Code License Agreement
postgresql.jar Postgres JDBC Driver PostgreSQL Global Development Group BSD
regexp.jar Regular Expression parser The Apache Foundtion Apache
saxon.jar SAXON XSLT Processor Michael Kay Mozilla
SourceForge.net Logo
Hosted at SourceForge.

Getting and building the source

You can download source distribution bundles of PRES from here. As of version 1.7 PRES is now developed with eclipse and built with ant. To build the source, untar the distribution, connect to the distribution directory,.and just run

ant installer

This will build the installer which should be identical to the one you can download from SourceForge


Contributing and Taking Part

I would welcome active collaborators in developing PRES further. If you'd like to join in, the project page is here.


and how to configure it

These instructions assume you're running Tomcat version 5 and Postgres version 7. If you're running a different servlet container and/or database engine, you may find things are slightly more complex, but you should be able to work it out.

To install PRES, you should first set up your database by typing

createdb databasename

at the command line on the machine on which you're running Postgres, where databasename is the name you choose for the database.

Then download the installer from here; then run the installer, either by selecting its icon or by running

java -jar pres-1.8.minor-version-installer.jar

and answering all the questions.

If you request the installer to initialise the database it will set up the appropriate tables and data. If you encounter a problem go on to What to do if the database install script fails, below. Once the database installation is completed (again, it may take a few seconds) you should be able to try

http://your.host.name:8080/pres/

Your PRES system is now installed, and you should go to

http://your.host.name:8080/pres/admin

to administer it (use the Editor's username and password that you typed into our form). As a final test that everything's OK, go to

http://your.host.name:8080/pres/articles

You will find we've already set one article up for you. Select Edit This! and you will see a form headed Add or Edit a Story. Scroll to the bottom of the form and you will find a heading Pictures illustrating this article, below which you will find a link Add a new PICTURE. Select this link, and you will see a form Add or Edit a Picture. Actually if you can see the form at all that confirms that the installation has completed OK, but for your own satisfaction find a picture on your local machine to upload to PRES. If you can't see the form go to What to do if the WAR didn't unpack, below.

That's it! You're up and running. Enjoy!


Things which could go wrong

What to do if you can't connect to the database

You must create a database to hold PRES' data. It does not matter what this database is called, but it must be accessible via JDBC. This discussion assumes you will use Postgres. You don't have to use Postgres; in principle PRES should work with any database engine which supports views and transactions and which is accessible via JDBC. It is fairly easy to get PRES working with Oracle, somewhat less easy with MS SQL Server. With other databases you're on your own.

Firstly, you must ensure that Postgres is listening on a port, usually 5432. The simplest way to do this is to run the postmaster with the -i flag (see the postmaster man page). However, many packaged postgres installations nowadays have configuration files to control this sort of thing so you should check the configuration files of your particular installation. You must also allow your database to be connected to from the machine which runs the servlet container. Note that the database engine does not need to be running on the same server as the servlet container, but bear in mind that JDBC connections pass passwords over unencrypted network connections so if they are not on the same machine you need to be confident that the network between them cannot be snooped. To allow connections over the network, you need to edit the pg_hba.conf configuration file of your postgres installation, to add a line like:

host pres 192.168.4.72 255.255.255.248 password

where

So this example would allow the subnet consisting of the six machines from 192.168.1.73 to 192.168.1.78 to connect. To test that you have configured this correctly, first run

createdb pres

on the machine on which postgres is running to create the database. Then, from the machine which runs your servlet engine, run

psql -h database.machine.address -i 5432 pres

where

If this call succeeds and you get the database prompt your database is set up correctly. If it isn't, sort it out before going on to the next stage.

Special note it you're using Oracle

We do not ship Oracle JDBC drivers with PRES for copyright reasons. To install them, after the war file has been unpacked, drop the Oracle JDBC driver archive file which came with your Oracle installation into pres/WEB-INF/lib, where pres is the name you gave the PRES web application. You will not be able to run the firsttime servlet until you have done this and restarted the web application.

What to do if the database install script fails

The database install script, called when you run the firsttime servlet, can fail. It will fail if

Don't panic, this is not a disaster. The script which the database is setup from will be found in the unpacked war file.

in each case where pres is the name you gave to the PRES web application. Using either the database engine's interactive command line tool (e.g. psql, Query Analyser, sqldba) or use a JDBC tool such as SQL Workbench/J, copy and paste individual SQL statements from the database script in turn and run them against the database. Note where one fails and fix the problem before going on to the next.

What to do if the WAR didn't unpack

In order to maintain its cache and to store uploaded pictures and templates, PRES needs the servlet container in which it is run to unpack the WAR file. The servlet specification doesn't require this - it's optional. Tomcat 5.0.24 does unpack war files by default, but some versions of Tomcat 4 don't, and the copy you have may have been configured differently in any case.

The simplest thing to do if you have this problem (the symptom is you can't get the picture or template servlet to work), is to unpack the war file by hand. Go to the directory into which the war file has been put, and create a new subdirectory with the same base name as the war file (i.e., if the war file is called pres.war the directory should be called pres). Unpack the contents of the war file into that directory using either the jar utility, or any zip unpacking tool such as winzip or ark. If you do this you should ensure that the directory you created and all of its contents are owned by the user which your servlet engine runs as.

If you want to configure Tomcat, either version 4 or version 5, to automatically unpack war files, you can edit the server.xml configuration file, and find the host element for the virtual host your PRES system will run in. you must set its unpackWARs attribute to true.

<!-- Define the default virtual host -->

<Host name="your.server.name" debug="0"

appBase="webapps" unpackWARs="true">

If you are in doubt which virtual host is appropriate, there should be no harm in setting unpackWARs to true for all of them. If you are not the administrator of your Tomcat installation you may have to ask the system administrator to do this.

Alternatively, in later versions of Tomcat 4 and in Tomcat 5, you can use the Tomcat Web Server Administration Tool. In the tool, click on the host icon for the appropriate host entry in the tree view (unless you are doing something quite complex, there will only be one host entry). Set 'Unpack Wars' to 'True' and click 'Save'. Then click 'Commit Changes'.

If you don't run Tomcat, of course, you must configure the servlet container you do run to unpack war files. I don't know of any servlet containers which won't allow you to unpack war files. If you have one then at present you can't run PRES.

Enquiries and support

If you need support getting PRES running please feel free to contact me.

Reporting Bugs

If you find bugs in PRES, or have suggestions for improvements or new features, you can use this form



SourceForge.net Logo Now hosted at SourceForge.