Content Management - a full example
This sample content management application is one that I wrote many years ago, and has been in active use on my personal site ever since. Some readers may be aware that I wrote a monthly column on PDAs (gadgets, not hugs and kisses!) for PC Pro, which is a well regarded PC magazine in the UK. I kept my column on the web, initially in static html format, then eventually using this application. The initial version was probably written in WebObjects 3.5 or 4.0, and took about two days to write - that version had the content browser session based.
The package consists of three parts, very typical of most WebObjects applications: a framework for the eomodel and eo classes, a direct action based front end, plus a quick and dirty admin application.
The database is oriented around "articles", which break down into "paragraphs" - a typical monthly column would be 2,000 - 3,000 words, covering several different topics, corresponding to a "paragraph" each. A paragraph may have attached "image" records, "keywords", etc. Images are stored in the file system, not the database; the keyword system wasn't used as effectively as it could have been, although that was a data entry problem, not a deficiency in the application.
Points worth noting are some of the data controls typical in content management applications for the text objects - last updated time stamp, publication time stamp, publication flag, etc. I would normally add a record of the updating user and owner in a group application. Paragraph pages are post-processed to expand PLIMG tags; this allows images to be placed within the text as desired.
The only significant extensions to standard EOs in the framework are some manipulation of entered text; a commercial application would do a lot more vetting of content. Note that it expects paragraph text to be entered in a "normal" markup format, with two returns indicating a paragraph, and a single return corresponding to a <BR/> tag. Other markup is accepted in html, although it wouldn't be hard to modify this to use Markdown or Textile. The code was written before regex support was built into Java.
The admin application is so simple that it doesn't have a login panel, just a check to restrict access by IP address range. Page titles aren't set, and all the pages were originally derived from a page wizard, using WODisplayGroups, and no styling whatsoever. Login verification would be easy to add.
The main application uses direct actions, but was initially modelled as a session based application, even using display groups for batch control, and converted to direct actions after being successfully deployed as a session based application for some time.
Befitting it's age, the design doesn't use CSS, and is very simply styled. Extending it to take a stylesheet parameter somehow would allow it to support multiple publications with unique styles - very easily.
The sophistication of the application is partly in the selection of relevant attributes to populate the database, and (mainly) in the use of WebObjects. A simple WebObjects application can be very powerful.
Sample database is being prepared for download.