com.xmlserv.app.contentmanagement
Class AppContentManager

java.lang.Object
  |
  +--com.xmlserv.app.contentmanagement.AppContentManager
All Implemented Interfaces:
ContentManager

public class AppContentManager
extends java.lang.Object
implements ContentManager

A ContentManager implementation reading its configuration from the DB. The configuration table has the following format:

 rolegroup	INT
 context		VARCHAR(255)	NOT NULL
 classname	VARCHAR(255)	NOT NULL
 
The rolegroup is a reference to the users rolegroup, context is the part of the site this module entry refers to, classname is the implementing class (implementing the interface BackendModule.
The context (using the default context separator) looks like this:
/<rolegroupid>/context path 1/context path 2/.../context path n
i.e. it looks like a path with the rolegroup id prepended. This is used to locate BackendModules that are configured in the various hierarchy layers.
An example:
The context /0/party/agenda/list.xml leads to the following contexts being evaluated:
  1. /0/party/agenda/list.xml
  2. /0/party/agenda
  3. /0/party
  4. /0
This can be used to define site wide defaults (context /0, defaults for parts of the site (/0/party) etc.

See Also:
BackendModule, ContentManager, ContentManagerConfig

Constructor Summary
AppContentManager()
           
 
Method Summary
 void clearCache()
          Clean cache, re-read config in case configuration is cached.
 void destroy()
          Called before shutdown.
 void init()
          Initialize.
 void process(java.lang.String requestPath, org.jdom.Document document, javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest req, SecurityManager securityManager)
          Called for postprocessing each backends output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppContentManager

public AppContentManager()
Method Detail

init

public void init()
          throws XMLServException
Initialize. This is called once before any requests are serviced.
Specified by:
init in interface ContentManager

process

public void process(java.lang.String requestPath,
                    org.jdom.Document document,
                    javax.servlet.ServletContext servletContext,
                    javax.servlet.http.HttpServletRequest req,
                    SecurityManager securityManager)
             throws XMLServException
Called for postprocessing each backends output.
Specified by:
process in interface ContentManager
Parameters:
requestPath - The request path without the servlet context path and without any get parameters.
document - The JDOM Document representign the Backends output. This is augmented with additional Elements directly under the document root.
servletContext - The Servlet Context.
req - The Servlet Request.
securityManager - The SecurityManager.

clearCache

public void clearCache()
                throws XMLServException
Clean cache, re-read config in case configuration is cached.
Specified by:
clearCache in interface ContentManager

destroy

public void destroy()
Called before shutdown. Should release all resources held by this object. Exceptions may be written to System.out, but may not be thrown (in case of a shutdown, this is not of great concern anyway).
Specified by:
destroy in interface ContentManager