Casebox Server Architecture

Once deployed on a server, Casebox (CB) can serve many instances (called 'cores'). It's similar to "WordPress multisite" that allows management of multiple sites from one WordPress installation. This aspect of CB is not an addon, but an architectural decision. The aim was to easily deploy an SAAS version on a physical server.

A core is represented by:

  • one MySql database.
  • one SOLR core

There is one global mysql database 'casebox', where CB stores it's configuration. The table casebox.cores lists all cores on the server. The URL of a core is www.domain.com/[coreName]/. The name of the mysql database of a core starts with 'cb_'. Example: cb_demo

The overall architecture is illustrated:

Folder structure

casebox
 +-data
 |  +-files               All files are stores in this subfolder per core
 |  |  +-[core1]
 |  |  |...
 |  |  +-[coreN]
 |  |
 |  +-solr                Global SOLR config and indexes
 |  |  +-conf
 |  |  +-data
 |  |  |  +-[core1]
 |  |  |  |...
 |  |  |  +-[coreN]
 |  +-tmp
 +-httpsdocs              DocumentRoot for apache
 |  +-classes             All custom code is located here
 |  +-cores
 |  |  +-[core1]          Each core can define PHP, JS, etc.
 |  |  |...               The configuration of a core is in MySql table casebox.cores
 |  |  +-[coreN]
 |  +-js                  Web Interface JS classes based on ExtJS
 |  +-libx
 |  +-config.ini          mysql/solr connection params
 |  +-system.ini          mostly used to set path to unoconv util
 +-install
 +-logs                   Each core has its own error log
 +-sys                    Crontab php scripts and utilities

In red the folders specific to one core are highlighted. Each core may have custom PHP connected to CB, CSS/JS files etc.

Platform configuration

The configuration of CB is stored in mysql table casebox.config. Here is the list of most important settings

param value
action_log The config of action_log module (solr core, number of retention days). See Action Log
comments_config comments module config: email account to listen to
debug_hosts list of IPs for which all serverside warnings will be displayed. Used by developers only. See Debugging
default_facet_configs List of facets available in all cores. See Faceting
node_facets Which filters are available for an object in the tree and all its children. See Faceting
default_language which language is used in all cores if none specified at the core level
languages list of languages available in CB
language_[lang] the settings for one language: date/time format, etc
max_files_version_count How many versions of a file to keep, based on file extension. See Versioning
default_object_plugins what plugins are available for all objects. See Object Plugins
object_type_plugins list of plugins based on object type. See Object Plugins
webdav_files list of file extensions that can be accessed via webDav protocol
webdav_url the URL template used to generate webDAV links. See WebDAV access

Core configuration

The configuration of a core is stored in mysql table cb_coreName.config. Here is the list of most important settings

param value
api Serverside methods invoked in Web client via ExtJS
css CSS files to be loaded in Web client
css CSS files to be loaded in Web client
default_file_template What templateId to use for uploaded files (if none is specified). See Templates section
default_language What is the language of the Web Client if none is specified by the user
facet_configs The definition of all facets used in Filter panel. See Faceting
node_facets Which filters are available for an object in the tree and all its children. See Faceting
folder_templates Which type of objects to display in the Tree
js Custom JS files to be loaded by Web Client
languages Comma separated list of languages available in Web Client
listeners Attach custom PHP code to server side events. See Events
max_files_version_count How many versions of a file to keep, based on file extension. See Versioning
project_name_[lang] Project title displayed in browser window title per language
templateIcons List of CSS classes for template icons

MySql database schema of a core

Table Description
actions_log all system events (adding/deleting content. login/logout are tracked here) need revision
config configuration
crons it's just a log file should be moved to a general log table/file?
file_previews Previews of .DOC, .XLS files are generated by LibreOffice and saved to disk.
files basic information about files
files_content more detailed file info why having 2 tables? migrate files_content to files?
files_versions version history
menu The "Create New" menu items
notifications user notifications based on subscribtion and action_log need revision
objects objects stored in JSON format
tasks_* Tree nodes of type Task are saved in this table
templates Content types
templates_structure content type fields
tree the main table that holds the tree structure contains deprecated columns, need revision
tree_acl permissions system
user_groups_* Users and Groups in permission model

General MySql database

Casebox uses a global [prefix]__casebox database and one database with the [prefix]_ per core. The default prefix=cb.

cb__casebox database contains global config, translations and the list of cores.

[prefix]__casebox is created and populated by import.php script

TODO: how to remove 'local' definer dependency ?!
Notice: Casebox is using MySql Stored Procedures. The sql dumps of 'cb__casebox' and 'cb_[core]' databases are using username 'local' as the definer of stored procedures:

CREATE DEFINER=`local`@`localhost` PROCEDURE ...
You have to add the 'local' username in MySql and grant access to Casebox databases from localhost. (and we have to find a way how to avoid it)

Copyright (C) KETSE, HURIDOCS