Package digilib.conf

Class DigilibServletRequest


  • public class DigilibServletRequest
    extends DigilibRequest
    Class holding the parameters of a digilib user request. The parameters are mostly named like the servlet parameters:
    request_path: url of the page/document.
    fn: url of the page/document.
    pn: page number.
    dw: width of result window in pixels.
    dh: height of result window in pixels.
    wx: left edge of image area (float from 0 to 1).
    wy: top edge of image area (float from 0 to 1).
    ww: width of image area(float from 0 to 1).
    wh: height of image area(float from 0 to 1).
    ws: scale factor.
    mo: special options like 'fit' for gifs.
    mk: list of marks.
    pt: total number of pages (generated by sevlet).
    baseURL: base URL (from http:// to below /servlet).
    ...et al
    Author:
    casties
    • Field Detail

      • image

        protected DocuImage image
        internal DocuImage instance for this request
      • servletRequest

        protected javax.servlet.http.HttpServletRequest servletRequest
        internal ServletRequest
    • Constructor Detail

      • DigilibServletRequest

        public DigilibServletRequest​(javax.servlet.http.HttpServletRequest request)
        Creates a new instance of DigilibRequest with parameters from a ServletRequest. All undefined parameters are set to default values.
        Parameters:
        request - the HttpServletRequest
      • DigilibServletRequest

        public DigilibServletRequest​(javax.servlet.http.HttpServletRequest request,
                                     DigilibConfiguration config)
        Creates a new instance of DigilibRequest with parameters from a ServletRequest. All undefined parameters are set to default values.
        Parameters:
        request - the HttpServletRequest
        config - the DigilibConfiguration
      • DigilibServletRequest

        public DigilibServletRequest​(javax.servlet.http.HttpServletRequest request,
                                     DigilibConfiguration config,
                                     EnumSet<DigilibRequest.ParsingOption> parsingOptions)
        Creates a new instance of DigilibRequest with parameters from a ServletRequest. All undefined parameters are set to default values.
        Parameters:
        request - the HttpServletRequest
        config - the DigilibConfiguration
        parsingOptions - the ParsingOptions
    • Method Detail

      • setWithRequest

        public void setWithRequest​(javax.servlet.http.HttpServletRequest request)
        Populate the request object with data from a ServletRequest. Recognizes digilib API (old and new) and IIIF API style requests.
        Parameters:
        request - the HttpServletRequest
      • setWithOldString

        public void setWithOldString​(String queryString)
        Populate a request from a string in the old "++++" parameter form.
        Parameters:
        queryString - String with paramters in the old "+++" form.
      • getAsString

        public String getAsString()
        Return the request parameters as a String in the parameter form 'fn=/icons&pn=1'. Empty (undefined) fields are not included.
        Overrides:
        getAsString in class DigilibRequest
        Returns:
        String of request parameters in parameter form.
      • getAsString

        public String getAsString​(int type)
        Return the request parameters of a given type type as a String in the parameter form 'fn=/icons&pn=1'. Empty (undefined) fields are not included.
        Overrides:
        getAsString in class DigilibRequest
        Parameters:
        type - the type
        Returns:
        String of request parameters in parameter form.
      • getAsOldString

        public String getAsOldString()
        Returns request parameters in old '++++' form.
        Returns:
        String with parameters in old '++++' form.
      • setWithParamRequest

        public void setWithParamRequest​(javax.servlet.ServletRequest request)
        Set request parameters from javax.servlet.ServletRequest. Uses the Requests getParameter methods for 'fn=foo' style parameters.
        Parameters:
        request - ServletRequest to get parameters from.
      • setBaseURL

        public void setBaseURL​(javax.servlet.http.HttpServletRequest request)
        Set the requests base URL parameter from a javax.sevlet.http.HttpServletRequest.
        Parameters:
        request - HttpServletRequest to set the base URL.
      • getImage

        public DocuImage getImage()
        Returns the image.
        Returns:
        DocuImage
      • setImage

        public void setImage​(DocuImage image)
        Sets the image.
        Parameters:
        image - The image to set
      • getServletRequest

        public javax.servlet.http.HttpServletRequest getServletRequest()
        Returns the ServletRequest.
        Returns:
        the HttpServletRequest