Package org.ametys.web.editor
Class PageAttachmentURIResolver
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.transformation.AttachmentURIResolver
-
- org.ametys.web.editor.AttachmentURIResolver
-
- org.ametys.web.editor.PageAttachmentURIResolver
-
- All Implemented Interfaces:
URIResolver,Contextualizable,LogEnabled,Serviceable
public class PageAttachmentURIResolver extends AttachmentURIResolver
URIResolverfor type "attachment-page".
These links point to a file from the attachments of the current Page.
-
-
Field Summary
-
Fields inherited from class org.ametys.web.editor.AttachmentURIResolver
_webPrefixHandler
-
Fields inherited from class org.ametys.cms.transformation.AttachmentURIResolver
__PLUGIN_CONTENT_PATTERN, _context, _prefixHandler, _resolver
-
-
Constructor Summary
Constructors Constructor Description PageAttachmentURIResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String_getUrl(String uri, boolean download, boolean absolute, boolean internal, String keyword, String addBeforeExtension)I18nizableTextgetLabel(String uri)Get an URI label.StringgetType()Returns the type of links handled by thisURIResolver.Stringresolve(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.StringresolveBoundedImage(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.StringresolveImage(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.-
Methods inherited from class org.ametys.web.editor.AttachmentURIResolver
contextualize, getUriPrefix, service
-
Methods inherited from class org.ametys.cms.transformation.AttachmentURIResolver
_resolveImage, checkLink, resolveBoundedImageAsBase64, resolveCroppedImage, resolveCroppedImageAsBase64, resolveImageAsBase64, resolveImageAsBase64
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
PageAttachmentURIResolver
public PageAttachmentURIResolver()
-
-
Method Detail
-
getType
public String getType()
Description copied from interface:URIResolverReturns the type of links handled by thisURIResolver.- Specified by:
getTypein interfaceURIResolver- Overrides:
getTypein classAttachmentURIResolver- Returns:
- the type of links handled by this
URIResolver.
-
_getUrl
private String _getUrl(String uri, boolean download, boolean absolute, boolean internal, String keyword, String addBeforeExtension)
-
resolve
public String resolve(String uri, boolean download, boolean absolute, boolean internal)
Description copied from interface:URIResolverResolves a link URI for rendering purposes.
The output must be a properly encoded path, relative to the webapp context, accessible from a browser.- Specified by:
resolvein interfaceURIResolver- Overrides:
resolvein classAttachmentURIResolver- Parameters:
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.- Returns:
- the path to the resource.
-
resolveBoundedImage
public String resolveBoundedImage(String uri, int maxHeight, int maxWidth, boolean download, boolean absolute, boolean internal)
Description copied from interface:URIResolverResolves a link URI for rendering image.
The output must be a properly encoded path, relative to the webapp context, accessible from a browser.- Specified by:
resolveBoundedImagein interfaceURIResolver- Overrides:
resolveBoundedImagein classAttachmentURIResolver- Parameters:
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.- Returns:
- the path to the image.
-
resolveImage
public String resolveImage(String uri, int height, int width, boolean download, boolean absolute, boolean internal)
Description copied from interface:URIResolverResolves a link URI for rendering image.
The output must be a properly encoded path, relative to the webapp context, accessible from a browser.- Specified by:
resolveImagein interfaceURIResolver- Overrides:
resolveImagein classAttachmentURIResolver- Parameters:
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.- Returns:
- the path to the image.
-
getLabel
public I18nizableText getLabel(String uri)
Description copied from interface:URIResolverGet an URI label.- Specified by:
getLabelin interfaceURIResolver- Overrides:
getLabelin classAttachmentURIResolver- Parameters:
uri- the uri which label to get.- Returns:
- the label.
-
-