public class PageAttachmentURIResolver extends AttachmentURIResolver
URIResolver
for type "attachment-page"._webPrefixHandler
__PLUGIN_CONTENT_PATTERN, _context, _prefixHandler, _resolver
Constructor and Description |
---|
PageAttachmentURIResolver() |
Modifier and Type | Method and Description |
---|---|
private String |
_getUrl(String uri,
boolean download,
boolean absolute,
boolean internal,
String keyword,
String addBeforeExtension) |
I18nizableText |
getLabel(String uri)
Get an URI label.
|
String |
getType()
Returns the type of links handled by this
URIResolver . |
String |
resolve(String uri,
boolean download,
boolean absolute,
boolean internal)
Resolves a link URI for rendering purposes.
The output must be a properly encoded path, relative to the webapp context, accessible from a browser. |
String |
resolveBoundedImage(String uri,
int maxHeight,
int maxWidth,
boolean download,
boolean absolute,
boolean internal)
Resolves a link URI for rendering image.
The output must be a properly encoded path, relative to the webapp context, accessible from a browser. |
String |
resolveImage(String uri,
int height,
int width,
boolean download,
boolean absolute,
boolean internal)
Resolves a link URI for rendering image.
The output must be a properly encoded path, relative to the webapp context, accessible from a browser. |
contextualize, getUriPrefix, service
_resolveImage, checkLink, resolveBoundedImageAsBase64, resolveCroppedImage, resolveCroppedImageAsBase64, resolveImageAsBase64, resolveImageAsBase64
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
public PageAttachmentURIResolver()
public String getType()
URIResolver
URIResolver
.getType
in interface URIResolver
getType
in class AttachmentURIResolver
URIResolver
.private String _getUrl(String uri, boolean download, boolean absolute, boolean internal, String keyword, String addBeforeExtension)
public String resolve(String uri, boolean download, boolean absolute, boolean internal)
URIResolver
resolve
in interface URIResolver
resolve
in class AttachmentURIResolver
uri
- the link URI.download
- true if the pointed resource is to be downloaded.absolute
- true if the url must be absoluteinternal
- true to get an internal URI.public String resolveBoundedImage(String uri, int maxHeight, int maxWidth, boolean download, boolean absolute, boolean internal)
URIResolver
resolveBoundedImage
in interface URIResolver
resolveBoundedImage
in class AttachmentURIResolver
uri
- the link URI.maxHeight
- the max heightmaxWidth
- the max widthdownload
- true if the pointed resource is to be downloaded.absolute
- true if the url must be absoluteinternal
- true to get an internal URI.public String resolveImage(String uri, int height, int width, boolean download, boolean absolute, boolean internal)
URIResolver
resolveImage
in interface URIResolver
resolveImage
in class AttachmentURIResolver
uri
- the link URI.height
- the height of the image.width
- the width of the imagedownload
- true if the pointed resource is to be downloaded.absolute
- true if the url must be absoluteinternal
- true to get an internal URI.public I18nizableText getLabel(String uri)
URIResolver
getLabel
in interface URIResolver
getLabel
in class AttachmentURIResolver
uri
- the uri which label to get.