Peruser System Configuration

On this page, we discuss configuration of the Peruser application container (which usually runs inside cocoon, which runs inside a servlet container like tomcat).

The subject of application configuration is more fun and more interesting.  Everything described on this page exists merely to set up the application context so we can party there without having to write java code.

The best way to start learning about Peruser system configuration is by looking at the conf directory tree in your peruser installation.
Note that a single peruser installation tree may contain configuration options for multiple deployments.
There are five subdirectories of peruser/conf.  

ant_prop

Contains ant properties controlling build and installation.  See Ant Properties Reference.

sh_env

Sets up operating system environment variables: JAVA_HOME, ANT_HOME and PATH.

cocoon

Contains configuration information used to embed peruser inside a cocoon deployment.  Changes to any of this information (except the root sitemap) require a servlet container restart to take effect.

pre_build

Contains configuration used to patch your cocoon installation before it is built.  Changes here require that you rebuild and redeploy cocoon, as well as restart your servlet container, hence these changes are usually kept to a minimum. 

properties

Properties used primarily to enable/disable various cocoon features.

local.blocks.properties

This file enables/disables cocoon blocks.  Our default config disables all blocks that are not used by the peruser samples.  You can enable more blocks to access more cocoon features.

local.build.properties

High level build switches for cocoon.  Peruser disables the cocoon documentation and test-suite.

webxml_patch

These files use the cocoon "xweb" format to patch the web.xml file that configures your servlet container (e.g. tomcat) to handle the cocoon servlet.   Global webapp behavior (for all your nested peruser/cocoon apps) is controlled here.  Ch

peruser_log4j_enable.xweb

Configures the cocoon servlet to use log4j, as configured in cocoon/postbuild/log4j/peruser_log4j.xconf - described below.

peruser_session_timeout.xweb

Sets the HTTP session timeout for the cocoon servlet.  Our default is 90 minutes.  One HTTP session per browser is shared by all your peruser/cocoon applications.

peruser_upload_config.xweb

Sets the maximum file upload size for the cocoon servlet.  Our default is 5 Megabytes.

xconf_patch

These files use the cocoon "xconf" format to patch the cocoon.xconf file which is the hub of low-level cocoon framework config.  Cocoon will apply these .xconf files to produce a patched version of the cocoon.xconf file.   This file is then deployed into yourDeployedCocoonWebappDirectory/WEB-INF/cocoon.xconf.  This file is read during the cocoon webapp startup.  So, to successfully change any of this configuration


peruser_kernel.xconf

Tells cocoon that we want it to load a single instance of PeruserCocoonKernel, to be shared by all peruser applications.  Configures that peruser-cocoon-kernel to have an "indoor_kernel" of type JenaKernel , thereby giving your cocoon applications access to all the RDF management goodies in jena and ARQ (arguably, the main benefit of deploying Peruser today).

This JenaKernel is configured with an RDF model, which by default is the file cocoon_jena_boot.ttl, which is found in the root directory of the application configuration tree below.

peruser_jdbc.xconf

Configures the JDBC datasources available to your peruser applications.  By default, peruser attempts to connect to a MySQL server on the same machine ("localhost") where your servlet container (+ cocoon + peruser) is running.

peruser_input_module.xconf

Sets up the PeruserInputModule as an Input Module (see "step 2 - use it", also see these javadocs, and the "input modules examples" in your cocoon installation or here) for use in your Cocoon sitemaps.  This allows you to use the results of Peruser operations (e.g. SPARQL query results) in sitemap expressions (e.g. URLs, arguments to transformers, etc.).  Not essential, but handy.

peruser_cron_jobs.xconf

Establishes PeruserCocoonCronJob as a schedulable job that can be run like a unix "cron" job, according to the schedule of triggers in peruser_cron_triggers.xconf below.

peruser_cron_triggers.xconf

Defines scheduled triggers to be sent to the PeruserCocoonCronJob defined by peruser_cron_jobs.xconf above.  

post_build

Contains configuration used to patch your cocoon installation after it is built.  Making a change here does not require a cocoon rebuild or redeploy, you can simply run the peruser ant-task "deploy-into-cocoon", and restart your servlet container.

log4j

Configuration of the log4j logging facilities used by peruser and cocoon.  Contains a single file, peruser_log4j.xconf, which uses the Log4J XML Config Format.

sitemap

The biggest advantage of the cocoon framework is the power and flexibility of sitemaps.  Each application you create will have one or more of its own sitemaps.  In this directory, a very simple root sitemap.xmap is setup for the peruser container.  This sitemap simply

  1. Establishes the PeruserTransformer as an available sitemap component.
  2. Delegates all inbound requests to be handled by the appropriate application sitemaps.

standalone

Contains configuration information used to run the peruser as a standalone application (e.g. during unit testing).

Currently, this consists only of a single file:  log4j/log4j.properties, which configures log4j logging for the peruser unit tests.