Overview

OpenForum is a web application server that can be edited while running, and in the browser. Similar to how a wiki works, OpenForum can be edited by any authorised editor, but rather than just being able to create content, an editor can also create web services.

Anatomy of a Page

OpenForum is built around the concept of pages. Each page has a URL eg. /OpenForum/Sandbox. The content for the page is contained in a directory and contains a number of standard files that define its content and its behaviour.

Special Page Files and Their Purpose

A page in OpenForum constists of a set of files that generate and support a web page.

page.content (required)

The page content file contains the static content of the page. This can use a mix of OpenForum wiki syntax and html. When saved, it is converted into html and saved as the files page.html and page.html.fragment

page.html contains the file page.html.template that normally adds a standard header and foot to the page, whereas page.html.fragment just contains page.content converted to html. The content of page.html.fragment is generated so the content can be included in another page if required.

page.html.template (optional, inherited)

On most occasions, you will not include a page.html.template file. When a page is built (as when page.content is saved) the page builder will search up the page tree for a page.html.template file. If none is found, it will take the page.html.template from the page ...?

The file page.html.template contains the template used to generate the page. Normally this contains the standard header and footer. Within the header, the script page.js will be imported. See: File inheritance

The same page.html.template file can also be referenced by several pages by referenceing it as a link. This is done by createing a file page.html.template.link that contains the path to the file to include. This can be done with any file that needs to be included in multiple pages from a single source. See: File in linking

page.js (required)

The page.js file contains the script for the current page. The script open-forum.js will also be included. page.js normally includes a definition of the function OpenForum.init that will be run once all page dependencies and content has been loaded.

page.html (generated)

This is the content that will be displayed when the page is requested. eg. If a page /HomePage is requested, the file /HomePage/page.html is served. This file will be overwritten whenever a file is saved in the page, a page refresh is requested or the site is rebuilt.

page.html.fragment (generated)

This is the page.content file, converted to html but without being inserted into the page.html.template file.

data.json (generated)

The data.json file contains information about the current page in a json format. Commonly it just contains the page's path and title, but can contain other data such as information about importing external resources. See: Plugins

access.json (optional, inherited)

The access.json file can be used to set the access rights to the page. Users or Groups can be given access to do perform different actions on a page such as read, update or delete

get.sjs (optional)

The files get.sjs and post.sjs add server side services to a page. If a get.sjs file is present on a page, the get.sjs script is run on the server rather than just returning the content from page.html file. The extension .sjs stands for server side javascript. It can use a number of helper services and plugins to call services on other sites, access databases and call Java apis. See: server side javascript

post.sjs (optional)

Similar to get.sjs but called when a post request is sent to the server.

page.build.js (optional)

Including a page.build.js file on your page will cause this script to be run on the server to build the page rather than the standard build script. See: bespoke page builder

Special Pages and their Purpose

OpenForum

All of the pages, code and services to run and manage an OpenForum server are held in pages under this page.

Configuration

Used to define some of the static information about the server such as the location of the home page, the servers web address and the administrators email address.

Authentication

Contains the server side code to authenticate users when they login.

Authorization

Contains the server side code to check if a user is authorised to access or modifiy pages.

User Administration

A simple implementation of user administration with user and group inormation stored in pages on the server. It is relativly simple to implement integration with other user administration, authentication and authorization services.

Deleted Pages

Contains a copy of all of the deleted pages on the server. No page is truly deleted, it is moved to this page from where it can be undeleted.

history

Each page has a child page called history. This page contains a copy of all the files on a page when they are changed. It acts as a history of a pages changes, so you can rewind a file to a previous version or look at changes made.

private

A page with the name private has special access rights and can currently only be read by the Admin user.

Built in Services

OpenForum has a whole host of built in services. Here is a list of some of them and links to reference documentation: