Package digilib.servlet
Class DigilibBean
- java.lang.Object
-
- digilib.servlet.DigilibBean
-
public class DigilibBean extends Object
Java bean providing access to digilib configuration for JSPs.- Author:
- robcast
-
-
Constructor Summary
Constructors Constructor Description DigilibBean()
Constructor for DigilibBean.DigilibBean(javax.servlet.ServletConfig conf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocuDirectory
getDirectory()
Returns the current DocuDirectory.DigilibServletConfiguration
getDlConfig()
Returns the dlConfig.String
getFilepath()
Returns the current filepath (fn).ImageSet
getImageSet()
Returns the current ImageSet.int
getNumPages()
get the number of pages/files in the directoryint
getNumPages(DigilibServletRequest request)
get the number of image pages/files in the directoryDigilibServletRequest
getRequest()
Returns the dlRequest.boolean
isAuthorized()
check if the request is allowed to access filepathboolean
isAuthorized(DigilibServletRequest request)
check if the request is allowed to access filepathboolean
isAuthRequired()
check if the request must be authorized to access filepathboolean
isAuthRequired(DigilibServletRequest request)
check if the request must be authorized to access filepathboolean
isUseAuthorization()
Returns if authorization is configured.void
setConfig(javax.servlet.ServletConfig conf)
Initializes the bean with the default DigilibServletConfiguration from the context.void
setConfig(javax.servlet.ServletConfig conf, String dlconfKey)
Initializes the bean with the DigilibConfiguration from the context under the given key.void
setRequest(DigilibServletRequest dlRequest)
Sets the current DigilibRequest.void
setRequest(javax.servlet.http.HttpServletRequest request)
Sets the current DigilibRequest using a HttpServletRequest.
-
-
-
Method Detail
-
setConfig
public void setConfig(javax.servlet.ServletConfig conf, String dlconfKey) throws javax.servlet.ServletException
Initializes the bean with the DigilibConfiguration from the context under the given key.- Parameters:
conf
-dlconfKey
-- Throws:
javax.servlet.ServletException
-
setConfig
public void setConfig(javax.servlet.ServletConfig conf) throws javax.servlet.ServletException
Initializes the bean with the default DigilibServletConfiguration from the context.- Parameters:
conf
-- Throws:
javax.servlet.ServletException
-
isUseAuthorization
public boolean isUseAuthorization()
Returns if authorization is configured.- Returns:
- use authorization
-
isAuthRequired
public boolean isAuthRequired() throws AuthOpException
check if the request must be authorized to access filepath- Returns:
- is auth required
- Throws:
AuthOpException
- on error
-
isAuthRequired
public boolean isAuthRequired(DigilibServletRequest request) throws AuthOpException
check if the request must be authorized to access filepath- Parameters:
request
- the DigilibServletRequest- Returns:
- is auth required
- Throws:
AuthOpException
- on error
-
isAuthorized
public boolean isAuthorized() throws AuthOpException
check if the request is allowed to access filepath- Returns:
- is authorized
- Throws:
AuthOpException
- on error
-
isAuthorized
public boolean isAuthorized(DigilibServletRequest request) throws AuthOpException
check if the request is allowed to access filepath- Parameters:
request
- the DigilibServletRequest- Returns:
- is authorized
- Throws:
AuthOpException
- on error
-
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request) throws Exception
Sets the current DigilibRequest using a HttpServletRequest.- Parameters:
request
- the HttpServletRequest- Throws:
Exception
- on error
-
setRequest
public void setRequest(DigilibServletRequest dlRequest) throws Exception
Sets the current DigilibRequest.- Parameters:
dlRequest
- The dlRequest to set.- Throws:
Exception
- on error
-
getNumPages
public int getNumPages() throws Exception
get the number of pages/files in the directory- Returns:
- the num pages
- Throws:
Exception
- on error
-
getNumPages
public int getNumPages(DigilibServletRequest request) throws Exception
get the number of image pages/files in the directory- Parameters:
request
- the DigilibServletRequest- Returns:
- the num pages
- Throws:
Exception
- on error
-
getDirectory
public DocuDirectory getDirectory()
Returns the current DocuDirectory.- Returns:
- the DocuDirectory
-
getImageSet
public ImageSet getImageSet()
Returns the current ImageSet.- Returns:
- the ImageSet
-
getFilepath
public String getFilepath()
Returns the current filepath (fn).- Returns:
- the fn
-
getDlConfig
public DigilibServletConfiguration getDlConfig()
Returns the dlConfig.- Returns:
- the DigilibConfiguration
-
getRequest
public DigilibServletRequest getRequest()
Returns the dlRequest.- Returns:
- the DigilibServletRequest
-
-