Package digilib.conf

Class DigilibServletConfiguration

All Implemented Interfaces:
EventListener, javax.servlet.ServletContextListener
Direct Known Subclasses:
DigilibServlet3Configuration, ManifestServletConfiguration, PDFServletConfiguration, TextServletConfiguration

public class DigilibServletConfiguration extends DigilibConfiguration implements javax.servlet.ServletContextListener
Class to hold the digilib servlet configuration parameters. The parameters can be read from the digilib-config file and be passed to other servlets or beans.
errorImgFileName: image file to send in case of error.
denyImgFileName: image file to send if access is denied.
baseDirs: array of base directories in order of preference (prescaled versions first).
useAuth: use authentication information.
authConfPath: authentication configuration file.
...
Author:
casties
  • Field Details

  • Constructor Details

    • DigilibServletConfiguration

      public DigilibServletConfiguration()
      Constructs DigilibServletConfiguration and defines all parameters and their default values.
  • Method Details

    • getClassVersion

      public static String getClassVersion()
    • getVersion

      public String getVersion()
      Overrides:
      getVersion in class DigilibConfiguration
    • readConfig

      public void readConfig(javax.servlet.ServletContext c) throws SAXException, IOException
      read parameter list from the file WEB-INF/digilib-config.xml or digilib.properties in class path.
      Parameters:
      c - the ServletContext
      Throws:
      IOException - on error
      SAXException - on error
    • readConfigEntries

      protected void readConfigEntries(javax.servlet.ServletContext ctx, Map<String,String> conf)
      Parameters:
      ctx - the ServletContext
      conf - the config
    • configure

      public void configure(javax.servlet.ServletContext context)
    • contextInitialized

      public void contextInitialized(javax.servlet.ServletContextEvent cte)
      Specified by:
      contextInitialized in interface javax.servlet.ServletContextListener
    • contextDestroyed

      public void contextDestroyed(javax.servlet.ServletContextEvent cte)
      Specified by:
      contextDestroyed in interface javax.servlet.ServletContextListener
    • setContextConfig

      protected void setContextConfig(javax.servlet.ServletContext context)
      Sets the current DigilibConfiguration in the context.
      Parameters:
      context - the ServletContext
    • getContextConfig

      public static DigilibServletConfiguration getContextConfig(javax.servlet.ServletContext context, String dlconfigKey)
      Returns the DigilibConfiguration with the given key from the context.
      Parameters:
      context - the ServletContext
      dlconfigKey - the context key for the configuration
      Returns:
      the DigilibConfiguration
    • getCurrentConfig

      public static DigilibServletConfiguration getCurrentConfig(javax.servlet.ServletContext context)
      Returns the current DigilibConfiguration from the context.
      Parameters:
      context - the ServletContext
      Returns:
      the DigilibConfiguration
    • getContextConfig

      protected DigilibServletConfiguration getContextConfig(javax.servlet.ServletContext context)
      Returns the current DigilibConfiguration from the context. (non-static method, for Java inheritance)
      Parameters:
      context - the ServletContext
      Returns:
      the DigilibConfiguration
    • expandBaseDirList

      protected String[] expandBaseDirList(String[] dirs, javax.servlet.ServletContext c)
      Resolve all paths in the basedir-list. See ServletOps.getFile(File, ServletContext) for resolution logic.
    • setupLogging

      protected void setupLogging(javax.servlet.ServletContext context)
      Initialize the logging implementation.
      Parameters:
      context -