The Fiz community website

Fetching the Fiz community website source code

The website source code is available on the Fiz svn server (svn://fiz.stanford.edu) in a module named fiz-community-website. The trunk directory under this module contains the sources. The basic directory structure is similar to any other Fiz web application (created and managed using the Fiz command-line tool). The rest of this document will assume that your application sources are under a directory named fcw. It should have the following structure:

fcw/
  - antscripts/
  - extensions/
  - sql/
  - src/
  - web/
  - build.xml

Building and running the Fiz website

The Fiz website's build file has the same targets as other Fiz web applications. Run ant build in the application's root directory to build the website. The result of the build should now be available under fcw/out. The contents of fcw/out/fiz-community-website can now be deployed as the root application of a Tomcat server instance.

Setting up the Fiz website's backend database

Login to MySql as a user with the appropriate privileges. Then run the Fiz database initialization script located at fcw/sql/FizCommunity.sql using the command:

mysql> source fcw/sql/FizCommunity.sql

This script creates a database named fiz_community with all the required tables.

Then invoke the following commands to create a user account fiz_community with password abc123that has all privileges on the newly created database (you can use a different user account and password if you wish; just be sure to use the same values in the Fiz configuration file below):

CREATE USER 'fiz_community'@'localhost' IDENTIFIED BY 'abc123';
GRANT ALL PRIVILEGES ON fiz_community.* TO 'fiz_community'@'localhost';

Deploying the Fiz website on Tomcat

  1. Stop your Tomcat server.
  2. Backup the contents of the ROOT application of your Tomcat server.
  3. Replace the contents of the ROOT application with the contents of fcw/out/fiz-community-website.
  4. The website needs to configured to use the database that was set up in the previous section. If you used a database user other than fiz_community or a password other than abc123 when you configured MySQL, open the file located at ROOT/web/WEB-INF/app/config/FizCommunity.yaml_ and replace the values for the user and password properties with the actual user name and password.
  5. Restart your Tomcat server.

You should now be able to use the Fiz website. For example, if the Tomcat server is running locally on port 8080, you should be able to access the website using the URL http://localhost:8080/fiz/home/home.

The Fiz website directory schema

This section describes the directory structure used by the Fiz website to store installers for the Fiz platform as well as extensions. The installers for the Fiz core platform are stored in a directory named FizCore under the application's root directory. FizCore contains a directory named after each version of the Fiz core installer currently available on the server. Here is an example directory structure:

FizCore/
  - 1.0/
    - fiz-1.0.zip
    - fiz-doc-1.0.zip
    - fiz-doc-1.0/
      - index.html
      - ...
  - 1.2/
    - fiz-1.2.zip
    - fiz-doc-1.2.zip
    - fiz-doc-1.2/
      - index.html
      - ...

The file named fiz-1.0.zip is the installers for version 1.0 of Fiz. fiz-doc-1.0.zip is the installer for the javadocs for that version. fiz-doc-1.0/ is the expanded contents of fiz-doc-1.0.zip; this is so that users can view this documentation on the Fiz website without having to download it.

Extensions are stored similarly under the Extensions directory. Extensions contain a directory named after each extension currently available on the server; and each such directory contains directories for each version of the extension. Here is an example directory structure:

Extensions/
  - ext1/
    - 1.0.0/
      - ext1-bin-1.0.0.zip
      - ext1-doc-1.0.0.zip
      - ext1-src-1.0.0.zip
      - ext1-doc-1.0.0/
        - index.html
        - ...
    - 1.0.4/
      - ext1-bin-1.0.4.zip
      - ext1-doc-1.0.4.zip
      - ext1-src-1.0.4.zip
      - ext1-doc-1.0.4/
        - index.html
        - ...
  - ext2
    - 1.0.0/
      - ...
    - 2.0.0/
      - ...

Here, ext1-bin-1.0.0.zip is the installer that contains only the binaries for version 1.0.0 of the extension named ext1. ext1-src-1.0.0.zip is the installer that also includes the source and build scripts for that version. ext1-doc-1.0.0.zip contains the javadocs. The directory ext1-doc-1.0.0/ is the expanded contents of ext1-doc-1.0.0.zip.