Application "Forums" tutorial
Application "Forums" Application "Forums"

## Overview

- The "Forums" is a World Wide Web application for posting, reading and searching of messages. It is developed under Virtuoso VDBMS using Virtuoso Server Pages (VSP) and server-side XSL-T transformation.
- The messages are classified by interest to forums and sub-forums.
- The posting is allowed only for the registered users. The registration is done by registration form.
- Every registered user can create a new theme, post messages to an existing theme or reply to a message.
- Unregistered users can search and browse and read the existing themes and messages.
- VSP is used to produce an XML document. This is then transformed to HTML using server side XSL-T transformation.
- The design and functionality of this application are separate. The design and appearance of the application depends only on the XSL-T style-sheets.
- Session management is based on URL (poisoning) and persistent HTTP session variables.
- The messages are stored in the Database as XML documents, with a text index over them.

## Application pages

The application has the following pages:

- home.vsp - the main page:

  Shows the forums with the following information:

  - Forums: name of the forum with link to the relevant sub-forums.
  - Total: total of the messages for this forum;
  - New: new messages for the current forum for the last one day;
  - Last msg.: last inserted message to the forum;
  - Total users: the count of all users at the current moment who are registered at the forums;
  - Options: Login if the user is already registered in the forums;
  - Registration: to add a new user;
  - Search: to search in the messages;

- subforums.vsp - Shows the sub-forums of the current forum with the following information:

  - Subforum: name of the sub-forum with link to the relevant themes.
  - Total: total of the messages for this forum;
  - New: new messages for the current forum for the last one day;
  - Last msg.: last inserted message to the forum;
  - Options: Login if the user is already registered in the forums;
  - Registration: to add a new user;
  - Search: to search in the messages;
  - Forums path: links to the home page and to the forum to which belong the current sub-forums;

- forum.vsp - Shows themes of the current sub-forum with the following information:

  - Theme: name of the theme with link to its messages.
  - Total: total of the messages for this theme;
  - New: new messages for the current theme for the last one day;
  - Last msg.: last inserted message to the theme;
  - Options: Login if the user is already registered in the forums;
  - Registration: to add a new user;
  - Search: to search in the messages;
  - Forums path: links to the home page, to the forum and to the sub-forum to which belong the current themes;

- thread.vsp - Shows the messages of the current theme with the following information:

  - Message: name of the messages with link to its properties / text, author / and when the link is activated, the same page is present, but with the tree of the messages for which the current message is parent.
  - Author: the name of the author, posted the current messages;
  - Date of inserting: date of posting the messages;
  - Options: Login if the user is already registered in the forums;
  - Registration: to add a new user;
  - Search: to search in the messages;
  - Forums path: links to the home page, to the forum and to the sub-forum to which belong the current message, also for the current messages which is parent for the other messages, its name is only presented, and lower you go in the tree, you can go back using this path.

## Remarks

- If you are not logged in, you can go on all the pages of the site, but if you want to insert new theme, or new message, you have to login, and automatically the login page is displayed. When you are successfully login, you go directly to the form for inserting messages/themes.
- If you aren't logged-in, the name anonymous is displayed, instead of your email, if you were logged in.

- When you use the search option, you can search in 3 main parts:

  1. Theme title: title of message which is title of theme;
  2. Message title: title of message which has theme as parent theme;
  3. Message body: body of the messages which has as a parent different themes;
- When the search result is displayed, there info how many hits are found, and the result are displayed as following:
- Message title: the title of the current message / when you search in message body, its title is displayed /;
- Time: date of inserting of the message or theme;
- Author: the author of the message or the theme;
- Home: link to the home page;
- User info: if logged in, then the current email, otherwise anonymous.

## Installation

1. Copy /forums and /xslt to the HTTP ServerRoot

2. Execute def.sql script via isql tool with dba privileges. Example:

          [isql tool directory]\isql [server ip or hostname]:[port] dba dba

          Connected to OpenLink Virtuoso VDBMS
          Driver: 02.10.2015 OpenLink Virtuoso ODBC Driver
          OpenLink Interactive SQL (Virtuoso), version 0.9849b.
          Type HELP; for help and EXIT; to exit.
          SQL>load c:\temp\def.sql;
          Done. -- 20 msec.
          . . .
          Done. -- 20 msec.
          . . .
          Done. -- 20 msec.

   Important: Make sure there are no errors.

3. Execute func.sql script. Example:

          SQL>load c:\temp\func.sql;
          Done. -- 20 msec.
          . . .
          Done. -- 20 msec.
          . . .
          Done. -- 20 msec.

   Important: Make sure there are no errors.

4. Check the installation:

          http://[server ip or hostname]:[port]/forums/home.vsp