Class NewsletterLocalURIResolver
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.transformation.LocalURIResolver
-
- org.ametys.web.editor.LocalURIResolver
-
- org.ametys.plugins.newsletter.testsending.NewsletterLocalURIResolver
-
- All Implemented Interfaces:
URIResolver,Contextualizable,LogEnabled,Serviceable
public class NewsletterLocalURIResolver extends LocalURIResolver
Resolver for local uri in newsletters
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ametys.cms.transformation.LocalURIResolver
LocalURIResolver.URIInfo
-
-
Field Summary
Fields Modifier and Type Field Description static StringNEWSLETTER_LOCAL_DATA_TYPEresolver data type for newsletter local-
Fields inherited from class org.ametys.web.editor.LocalURIResolver
_prefixHandler
-
Fields inherited from class org.ametys.cms.transformation.LocalURIResolver
_ametysObjectResolver, _context
-
-
Constructor Summary
Constructors Constructor Description NewsletterLocalURIResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String_resolve(String uri, boolean download, boolean absolute, boolean internal, String suffix)Resolves a link URI for rendering purposes.
The output must be a properly encoded path, relative to the webapp context, accessible from a browser.protected String_resolveImageAsBase64(String uri, int height, int width, int maxHeight, int maxWidth, int cropHeight, int cropWidth)Resolve image as base 64StringgetType()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.StringresolveBoundedImageAsBase64(String uri, int maxHeight, int maxWidth)Resolve an image and return it as a base64-encoded string.StringresolveCroppedImage(String uri, int cropHeight, int cropWidth, 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.StringresolveCroppedImageAsBase64(String uri, int cropHeight, int cropWidth)Resolve an image and return it as a base64-encoded string.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.StringresolveImageAsBase64(String uri, int height, int width)Resolve an image and return it as a base64-encoded string.voidservice(ServiceManager manager)-
Methods inherited from class org.ametys.web.editor.LocalURIResolver
_resolve
-
Methods inherited from class org.ametys.cms.transformation.LocalURIResolver
checkLink, contextualize, getInfos, getLabel, resolveImageAsBase64
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
NEWSLETTER_LOCAL_DATA_TYPE
public static final String NEWSLETTER_LOCAL_DATA_TYPE
resolver data type for newsletter local- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NewsletterLocalURIResolver
public NewsletterLocalURIResolver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classLocalURIResolver- Throws:
ServiceException
-
getType
public String getType()
Description copied from interface:URIResolverReturns the type of links handled by thisURIResolver.- Specified by:
getTypein interfaceURIResolver- Overrides:
getTypein classLocalURIResolver- Returns:
- the type of links handled by this
URIResolver.
-
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 classLocalURIResolver- 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.
-
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 classLocalURIResolver- 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.
-
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 classLocalURIResolver- 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.
-
resolveCroppedImage
public String resolveCroppedImage(String uri, int cropHeight, int cropWidth, 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:
resolveCroppedImagein interfaceURIResolver- Overrides:
resolveCroppedImagein classLocalURIResolver- Parameters:
uri- the link URI.cropHeight- the crop heightcropWidth- the crop 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.
-
resolveImageAsBase64
public String resolveImageAsBase64(String uri, int height, int width)
Description copied from interface:URIResolverResolve an image and return it as a base64-encoded string.- Specified by:
resolveImageAsBase64in interfaceURIResolver- Overrides:
resolveImageAsBase64in classLocalURIResolver- Parameters:
uri- the link URI.height- the height of the image.width- the width of the image- Returns:
- a base64-encoded string representing the image.
-
resolveBoundedImageAsBase64
public String resolveBoundedImageAsBase64(String uri, int maxHeight, int maxWidth)
Description copied from interface:URIResolverResolve an image and return it as a base64-encoded string.- Specified by:
resolveBoundedImageAsBase64in interfaceURIResolver- Overrides:
resolveBoundedImageAsBase64in classLocalURIResolver- Parameters:
uri- the link URI.maxHeight- the max heightmaxWidth- the max width- Returns:
- a base64-encoded string representing the image.
-
resolveCroppedImageAsBase64
public String resolveCroppedImageAsBase64(String uri, int cropHeight, int cropWidth)
Description copied from interface:URIResolverResolve an image and return it as a base64-encoded string.- Specified by:
resolveCroppedImageAsBase64in interfaceURIResolver- Overrides:
resolveCroppedImageAsBase64in classLocalURIResolver- Parameters:
uri- the link URI.cropHeight- the crop heightcropWidth- the crop width- Returns:
- a base64-encoded string representing the image.
-
_resolve
protected String _resolve(String uri, boolean download, boolean absolute, boolean internal, String suffix)
Resolves a link URI for rendering purposes.
The output must be a properly encoded path, relative to the webapp context, accessible from a browser.- Overrides:
_resolvein classLocalURIResolver- 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.suffix- The suffix to add to the resolved path- Returns:
- the path to the resource.
-
_resolveImageAsBase64
protected String _resolveImageAsBase64(String uri, int height, int width, int maxHeight, int maxWidth, int cropHeight, int cropWidth)
Resolve image as base 64- Parameters:
uri- the link URI.height- the specified height. Ignored if 0.width- the specified width. Ignored if 0.maxHeight- the maximum image height. Ignored if height or width is specified.maxWidth- the maximum image width. Ignored if height or width is specified.cropHeight- the cropping height. Ignored if 0.cropWidth- the cropping width. Ignored if 0.- Returns:
- a base64-encoded string representing the image.
-
-