Package org.opencms.pdftools
Class CmsPdfThumbnailLink
- java.lang.Object
-
- org.opencms.pdftools.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.
-
-
-
Field Detail
-
MARKER
public static final java.lang.String MARKER
The marker string used to identify PDF thumbnails.- See Also:
- Constant Field Values
-
PARAM_OPTIONS
public static final java.lang.String PARAM_OPTIONS
The name of the request parameter for the thumbnail options.- 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 contextpdfResource
- the PDF resource for which to create a thumbnail linkwidth
- thumbnail widthheight
- thumbnail heightformat
- the thumbnail image format (png, gif..,)
-
CmsPdfThumbnailLink
public CmsPdfThumbnailLink(CmsObject cms, java.lang.String link, java.lang.String options) throws CmsPdfThumbnailLink.ParseException, CmsException
Parses a thumbnail link object from the given link path and options.- Parameters:
cms
- the current CMS contextlink
- the linkoptions
- the options- Throws:
CmsPdfThumbnailLink.ParseException
CmsException
-
-
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
-
-