Class CmsPdfThumbnailLink


  • public class CmsPdfThumbnailLink
    extends java.lang.Object
    Class to generate or parse a link to a PDF thumbnail.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  CmsPdfThumbnailLink.ParseException
      Exception which is thrown when parsing a thumbnail link fails.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String MARKER
      The marker string used to identify PDF thumbnails.
      static java.lang.String PARAM_OPTIONS
      The name of the request parameter for the thumbnail options.
      static java.lang.String REGEX
      The name of the reqex for parsing the thumbnail URI path.
      static java.util.regex.Pattern REGEX_COMPILED
      The compiled regular expression for matching thumbnail URI paths.
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsPdfThumbnailLink​(CmsObject cms, java.lang.String link, java.lang.String options)
      Parses a thumbnail link object from the given link path and options.
      CmsPdfThumbnailLink​(CmsObject cms, CmsResource pdfResource, int width, int height, java.lang.String format)
      Creates a new thumbnail link for the given resource and options.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getFormat()
      Gets the image format.
      int getHeight()
      Returns the height.
      java.lang.String getLinkWithOptions()
      Gets the link, with the options appended as a request parameter.
      int getPage()
      Returns the page.
      int getWidth()
      Returns the width.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MARKER

        public static final java.lang.String MARKER
        The marker string used to identify PDF thumbnails.
        See Also:
        Constant Field Values
      • REGEX

        public static final java.lang.String REGEX
        The name of the reqex for parsing the thumbnail URI path.
        See Also:
        Constant Field Values
      • REGEX_COMPILED

        public static final java.util.regex.Pattern REGEX_COMPILED
        The compiled regular expression for matching thumbnail URI paths.
    • Constructor Detail

      • CmsPdfThumbnailLink

        public CmsPdfThumbnailLink​(CmsObject cms,
                                   CmsResource pdfResource,
                                   int width,
                                   int height,
                                   java.lang.String format)
        Creates a new thumbnail link for the given resource and options.

        Parameters:
        cms - the current CMS context
        pdfResource - the PDF resource for which to create a thumbnail link
        width - thumbnail width
        height - thumbnail height
        format - the thumbnail image format (png, gif..,)
    • Method Detail

      • getFormat

        public java.lang.String getFormat()
        Gets the image format.

        Returns:
        the image format
      • getHeight

        public int getHeight()
        Returns the height.

        Returns:
        the height
      • getLinkWithOptions

        public java.lang.String getLinkWithOptions()
        Gets the link, with the options appended as a request parameter.

        Returns:
        the link with the options
      • getPage

        public int getPage()
        Returns the page.

        Returns:
        the page
      • getWidth

        public int getWidth()
        Returns the width.

        Returns:
        the width