Package org.opencms.pdftools
Class CmsPdfLink
java.lang.Object
org.opencms.pdftools.CmsPdfLink
This class is responsbile for creating and parsing links to generated PDFs.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Exception which is thrown when parsing a link as a PDF link fails.<p< -
Field Summary
-
Constructor Summary
ConstructorDescriptionCmsPdfLink
(CmsObject cms, String link) Creates a PDF link object by parsing it from a link string.CmsPdfLink
(CmsObject cms, CmsResource formatter, CmsResource content, String filename) Creates a new PDF link object based on the formatter and content resources and the locale of the current CMS context. -
Method Summary
Modifier and TypeMethodDescriptionReturns the content.Gets the formatter resource.getLink()
Returns the link.Returns the locale.
-
Field Details
-
NOSLASH_GROUP
Group of characters without slashes.- See Also:
-
PDF_LINK_PREFIX
The prefix string for PDF links.- See Also:
-
PDF_LINK_REGEX
Regular expression for parsing PDF links.- See Also:
-
PDF_LINK_REGEX_COMPILED
Compiled regular expression for parsing PDF links.
-
-
Constructor Details
-
CmsPdfLink
public CmsPdfLink(CmsObject cms, CmsResource formatter, CmsResource content, String filename) throws CmsException Creates a new PDF link object based on the formatter and content resources and the locale of the current CMS context.- Parameters:
cms
- the current CMS contextformatter
- the formatter resourcecontent
- the content resourcefilename
- the file name to use for the PDF download link- Throws:
CmsException
- if something goes wrong
-
CmsPdfLink
public CmsPdfLink(CmsObject cms, String link) throws CmsPdfLink.CmsPdfLinkParseException, CmsException Creates a PDF link object by parsing it from a link string.- Parameters:
cms
- the current CMS contextlink
- the link as a string- Throws:
CmsPdfLink.CmsPdfLinkParseException
- if the given link is not a PDF linkCmsException
- if something else goes wrong
-
-
Method Details
-
getContent
Returns the content.- Returns:
- the content
-
getFormatter
Gets the formatter resource.- Returns:
- the formatter resource
-
getLink
Returns the link.- Returns:
- the link
-
getLocale
Returns the locale.- Returns:
- the locale
-