Package org.ametys.plugins.flipbook
Class Attribute2FlipbookUriResolver
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.transformation.AbstractURIResolver
-
- org.ametys.cms.transformation.AttributeURIResolver
-
- org.ametys.web.editor.AttributeURIResolver
-
- org.ametys.plugins.flipbook.Attribute2FlipbookUriResolver
-
- All Implemented Interfaces:
URIResolver,PluginAware,Contextualizable,LogEnabled,Serviceable
public class Attribute2FlipbookUriResolver extends AttributeURIResolver implements PluginAware
URIResolverfor type "attribute-flipbook".
These links point to a document file from the resource explorer converted to flash.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classAttribute2FlipbookUriResolver.CacheThread-
Nested classes/interfaces inherited from class org.ametys.cms.transformation.AttributeURIResolver
AttributeURIResolver.AttributeInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected Logger_loggerThe logger .protected ConvertMetadata2ImagesComponent_metadataComponentMetadata to images convertor.protected String_pluginNameThe plugin name.-
Fields inherited from class org.ametys.web.editor.AttributeURIResolver
_prefixHandler
-
Fields inherited from class org.ametys.cms.transformation.AttributeURIResolver
_context, _resolver
-
-
Constructor Summary
Constructors Constructor Description Attribute2FlipbookUriResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String_resolveImage(String uri, String uriArgument, boolean absolute)voidenableLogging(Logger logger)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.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 serviceManager)voidsetPluginInfo(String pluginName, String featureName, String id)Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.-
Methods inherited from class org.ametys.web.editor.AttributeURIResolver
getUri
-
Methods inherited from class org.ametys.cms.transformation.AttributeURIResolver
_getAttributeInfo, _resolve, checkLink, contextualize, getLabel, resolveImageAsBase64
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_pluginName
protected String _pluginName
The plugin name.
-
_metadataComponent
protected ConvertMetadata2ImagesComponent _metadataComponent
Metadata to images convertor.
-
-
Constructor Detail
-
Attribute2FlipbookUriResolver
public Attribute2FlipbookUriResolver()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAttributeURIResolver- Throws:
ServiceException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAwareSets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfoin interfacePluginAware- Parameters:
pluginName- Unique identifier for the plugin hosting the extensionfeatureName- Unique feature identifier (unique for a given pluginName)id- Unique identifier of this component
-
enableLogging
public void enableLogging(Logger logger)
- Specified by:
enableLoggingin interfaceLogEnabled- Overrides:
enableLoggingin classAbstractLogEnabled
-
getType
public String getType()
Description copied from interface:URIResolverReturns the type of links handled by thisURIResolver.- Specified by:
getTypein interfaceURIResolver- Overrides:
getTypein classAttributeURIResolver- 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 classAbstractURIResolver- 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
private String _resolveImage(String uri, String uriArgument, boolean absolute)
-
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 classAbstractURIResolver- 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 classAbstractURIResolver- 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 classAbstractURIResolver- 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 classAbstractURIResolver- 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 classAbstractURIResolver- 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 classAbstractURIResolver- Parameters:
uri- the link URI.cropHeight- the crop heightcropWidth- the crop width- Returns:
- a base64-encoded string representing the image.
-
-