public class NewsletterLocalURIResolver extends LocalURIResolver
LocalURIResolver.URIInfo| Modifier and Type | Field and Description |
|---|---|
private Repository |
_repository |
static String |
NEWSLETTER_LOCAL_DATA_TYPE
resolver data type for newsletter local
|
_prefixHandler_ametysObjectResolver, _context| Constructor and Description |
|---|
NewsletterLocalURIResolver() |
| Modifier and Type | Method and Description |
|---|---|
protected Content |
_getContent(String id,
Request request,
Session session)
Retrieve the content, using the request attribute to avoid an additional resolve
|
private String |
_getUriPrefix(Request request,
Content content,
boolean download,
boolean absolute,
boolean internal) |
protected String |
_resolve(String uri,
boolean download,
boolean absolute,
boolean internal,
String pipeline,
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 64
|
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 |
resolveBoundedImageAsBase64(String uri,
int maxHeight,
int maxWidth)
Resolve an image and return it as a base64-encoded string.
|
String |
resolveCroppedImage(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. |
String |
resolveCroppedImageAsBase64(String uri,
int cropHeight,
int cropWidth)
Resolve an image and return it as a base64-encoded string.
|
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. |
String |
resolveImageAsBase64(String uri,
int height,
int width)
Resolve an image and return it as a base64-encoded string.
|
void |
service(ServiceManager manager) |
_getFile, _getMeta, checkLink, contextualize, getInfos, getLabel, getUriPrefix, resolveImageAsBase64enableLogging, getLogger, setupLogger, setupLogger, setupLoggerpublic static final String NEWSLETTER_LOCAL_DATA_TYPE
private Repository _repository
public NewsletterLocalURIResolver()
public void service(ServiceManager manager) throws ServiceException
service in interface Serviceableservice in class LocalURIResolverServiceExceptionpublic String getType()
URIResolverURIResolver.getType in interface URIResolvergetType in class LocalURIResolverURIResolver.public String resolve(String uri, boolean download, boolean absolute, boolean internal)
URIResolverresolve in interface URIResolverresolve in class LocalURIResolveruri - 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 resolveImage(String uri, int height, int width, boolean download, boolean absolute, boolean internal)
URIResolverresolveImage in interface URIResolverresolveImage in class LocalURIResolveruri - 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 String resolveImageAsBase64(String uri, int height, int width)
URIResolverresolveImageAsBase64 in interface URIResolverresolveImageAsBase64 in class LocalURIResolveruri - the link URI.height - the height of the image.width - the width of the imagepublic String resolveBoundedImage(String uri, int maxHeight, int maxWidth, boolean download, boolean absolute, boolean internal)
URIResolverresolveBoundedImage in interface URIResolverresolveBoundedImage in class LocalURIResolveruri - 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 resolveBoundedImageAsBase64(String uri, int maxHeight, int maxWidth)
URIResolverresolveBoundedImageAsBase64 in interface URIResolverresolveBoundedImageAsBase64 in class LocalURIResolveruri - the link URI.maxHeight - the max heightmaxWidth - the max widthpublic String resolveCroppedImage(String uri, int cropHeight, int cropWidth, boolean download, boolean absolute, boolean internal)
URIResolverresolveCroppedImage in interface URIResolverresolveCroppedImage in class LocalURIResolveruri - 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.public String resolveCroppedImageAsBase64(String uri, int cropHeight, int cropWidth)
URIResolverresolveCroppedImageAsBase64 in interface URIResolverresolveCroppedImageAsBase64 in class LocalURIResolveruri - the link URI.cropHeight - the crop heightcropWidth - the crop widthprotected String _resolve(String uri, boolean download, boolean absolute, boolean internal, String pipeline, String suffix)
_resolve in class LocalURIResolveruri - 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.pipeline - The pipeline to use to server the contentsuffix - The suffix to add to the resolved pathprotected Content _getContent(String id, Request request, Session session) throws RepositoryException
id - The content idrequest - The requestsession - The session into which the content should be retrievedRepositoryException - If an error occurredprotected String _resolveImageAsBase64(String uri, int height, int width, int maxHeight, int maxWidth, int cropHeight, int cropWidth)
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.private String _getUriPrefix(Request request, Content content, boolean download, boolean absolute, boolean internal)