Package digilib.conf
Class DigilibServletConfiguration
java.lang.Object
digilib.util.ParameterMap
digilib.conf.DigilibConfiguration
digilib.conf.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.
...
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringfinal Longthe time the webapp (i.e.Fields inherited from class digilib.conf.DigilibConfiguration
isLoggingConfigured, logger, propertiesFileNameFields inherited from class digilib.util.ParameterMap
options, params -
Constructor Summary
ConstructorsConstructorDescriptionConstructs DigilibServletConfiguration and defines all parameters and their default values. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(javax.servlet.ServletContext context) voidcontextDestroyed(javax.servlet.ServletContextEvent cte) voidcontextInitialized(javax.servlet.ServletContextEvent cte) protected String[]expandBaseDirList(String[] dirs, javax.servlet.ServletContext c) Resolve all paths in the basedir-list.static Stringprotected DigilibServletConfigurationgetContextConfig(javax.servlet.ServletContext context) Returns the current DigilibConfiguration from the context.static DigilibServletConfigurationgetContextConfig(javax.servlet.ServletContext context, String dlconfigKey) Returns the DigilibConfiguration with the given key from the context.static DigilibServletConfigurationgetCurrentConfig(javax.servlet.ServletContext context) Returns the current DigilibConfiguration from the context.voidreadConfig(javax.servlet.ServletContext c) read parameter list from the file WEB-INF/digilib-config.xml or digilib.properties in class path.protected voidreadConfigEntries(javax.servlet.ServletContext ctx, Map<String, String> conf) protected voidsetContextConfig(javax.servlet.ServletContext context) Sets the current DigilibConfiguration in the context.protected voidsetupLogging(javax.servlet.ServletContext context) Initialize the logging implementation.Methods inherited from class digilib.conf.DigilibConfiguration
configure, readConfig, setSpecialValueFromString, setupLoggingMethods inherited from class digilib.util.ParameterMap
cloneInstance, get, getAsBoolean, getAsFile, getAsFloat, getAsInt, getAsString, getInstance, getOptions, getParameters, getParams, getValue, hasOption, hasValue, initOptions, initParams, newParameter, newParameter, put, put, setOptions, setParams, setValue, setValue, setValue, setValueFromString
-
Field Details
-
AUTHN_OP_KEY
- See Also:
-
AUTHZ_OP_KEY
- See Also:
-
IMAGEEXECUTOR_KEY
- See Also:
-
SERVLET_CONFIG_KEY
- See Also:
-
DIR_CACHE_KEY
- See Also:
-
webappStartTime
the time the webapp (i.e. this class) was loaded
-
-
Constructor Details
-
DigilibServletConfiguration
public DigilibServletConfiguration()Constructs DigilibServletConfiguration and defines all parameters and their default values.
-
-
Method Details
-
getClassVersion
-
getVersion
- Overrides:
getVersionin classDigilibConfiguration
-
readConfig
read parameter list from the file WEB-INF/digilib-config.xml or digilib.properties in class path.- Parameters:
c- the ServletContext- Throws:
IOException- on errorSAXException- on error
-
readConfigEntries
- Parameters:
ctx- the ServletContextconf- the config
-
configure
public void configure(javax.servlet.ServletContext context) -
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent cte) - Specified by:
contextInitializedin interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent cte) - Specified by:
contextDestroyedin interfacejavax.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 ServletContextdlconfigKey- the context key for the configuration- Returns:
- the DigilibConfiguration
-
getCurrentConfig
Returns the current DigilibConfiguration from the context.- Parameters:
context- the ServletContext- Returns:
- the DigilibConfiguration
-
getContextConfig
Returns the current DigilibConfiguration from the context. (non-static method, for Java inheritance)- Parameters:
context- the ServletContext- Returns:
- the DigilibConfiguration
-
expandBaseDirList
Resolve all paths in the basedir-list. SeeServletOps.getFile(File, ServletContext)for resolution logic. -
setupLogging
protected void setupLogging(javax.servlet.ServletContext context) Initialize the logging implementation.- Parameters:
context-
-