Class DigilibBean


  • public class DigilibBean
    extends Object
    Java bean providing access to digilib configuration for JSPs.
    Author:
    robcast
    • Constructor Detail

      • DigilibBean

        public DigilibBean()
        Constructor for DigilibBean.
      • DigilibBean

        public DigilibBean​(javax.servlet.ServletConfig conf)
    • 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
      • getRequest

        public DigilibServletRequest getRequest()
        Returns the dlRequest.
        Returns:
        the DigilibServletRequest