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 String
static final String
static final String
static final String
static final String
final Long
the time the webapp (i.e.Fields inherited from class digilib.conf.DigilibConfiguration
isLoggingConfigured, logger, propertiesFileName
Fields inherited from class digilib.util.ParameterMap
options, params
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs DigilibServletConfiguration and defines all parameters and their default values. -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(javax.servlet.ServletContext context) void
contextDestroyed
(javax.servlet.ServletContextEvent cte) void
contextInitialized
(javax.servlet.ServletContextEvent cte) protected String[]
expandBaseDirList
(String[] dirs, javax.servlet.ServletContext c) Resolve all paths in the basedir-list.static String
protected DigilibServletConfiguration
getContextConfig
(javax.servlet.ServletContext context) Returns the current DigilibConfiguration from the context.static DigilibServletConfiguration
getContextConfig
(javax.servlet.ServletContext context, String dlconfigKey) Returns the DigilibConfiguration with the given key from the context.static DigilibServletConfiguration
getCurrentConfig
(javax.servlet.ServletContext context) Returns the current DigilibConfiguration from the context.void
readConfig
(javax.servlet.ServletContext c) read parameter list from the file WEB-INF/digilib-config.xml or digilib.properties in class path.protected void
readConfigEntries
(javax.servlet.ServletContext ctx, Map<String, String> conf) protected void
setContextConfig
(javax.servlet.ServletContext context) Sets the current DigilibConfiguration in the context.protected void
setupLogging
(javax.servlet.ServletContext context) Initialize the logging implementation.Methods inherited from class digilib.conf.DigilibConfiguration
configure, readConfig, setSpecialValueFromString, setupLogging
Methods 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:
getVersion
in 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:
contextInitialized
in interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent cte) - Specified by:
contextDestroyed
in 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
-
-