Package org.ametys.plugins.flipbook
Class Metadata2FlipbookUriResolver
- java.lang.Object
-
- org.ametys.cms.transformation.MetadataURIResolver
-
- org.ametys.web.editor.MetadataURIResolver
-
- org.ametys.plugins.flipbook.Metadata2FlipbookUriResolver
-
- All Implemented Interfaces:
URIResolver
,PluginAware
,Contextualizable
,LogEnabled
,Serviceable
public class Metadata2FlipbookUriResolver extends MetadataURIResolver implements PluginAware, LogEnabled
URIResolver
for type "metadata-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 class
Metadata2FlipbookUriResolver.CacheThread
-
Nested classes/interfaces inherited from class org.ametys.cms.transformation.MetadataURIResolver
MetadataURIResolver.MetaInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected Logger
_logger
The logger .protected ConvertMetadata2ImagesComponent
_metadataComponent
Metadata to images convertor.protected String
_pluginName
The plugin name.-
Fields inherited from class org.ametys.web.editor.MetadataURIResolver
_prefixHandler
-
Fields inherited from class org.ametys.cms.transformation.MetadataURIResolver
_context, _resolver
-
-
Constructor Summary
Constructors Constructor Description Metadata2FlipbookUriResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Binary
_getBinary(String dataPath, Content content)
void
enableLogging(Logger logger)
String
getType()
Returns the type of links handled by thisURIResolver
.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.void
service(ServiceManager serviceManager)
void
setPluginInfo(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.MetadataURIResolver
getUri
-
Methods inherited from class org.ametys.cms.transformation.MetadataURIResolver
_getMetaInfo, _resolveImage, checkLink, contextualize, getBinaryMetadata, getLabel, resolveBoundedImageAsBase64, resolveCroppedImage, resolveCroppedImageAsBase64, resolveImageAsBase64, resolveImageAsBase64
-
-
-
-
Field Detail
-
_pluginName
protected String _pluginName
The plugin name.
-
_metadataComponent
protected ConvertMetadata2ImagesComponent _metadataComponent
Metadata to images convertor.
-
-
Constructor Detail
-
Metadata2FlipbookUriResolver
public Metadata2FlipbookUriResolver()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classMetadataURIResolver
- Throws:
ServiceException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAware
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.- Specified by:
setPluginInfo
in 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:
enableLogging
in interfaceLogEnabled
-
getType
public String getType()
Description copied from interface:URIResolver
Returns the type of links handled by thisURIResolver
.- Specified by:
getType
in interfaceURIResolver
- Overrides:
getType
in classMetadataURIResolver
- 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:URIResolver
Resolves 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:
resolve
in interfaceURIResolver
- Overrides:
resolve
in classMetadataURIResolver
- 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:URIResolver
Resolves 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:
resolveImage
in interfaceURIResolver
- Overrides:
resolveImage
in classMetadataURIResolver
- 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:URIResolver
Resolves 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:
resolveBoundedImage
in interfaceURIResolver
- Overrides:
resolveBoundedImage
in classMetadataURIResolver
- 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.
-
_getBinary
private Binary _getBinary(String dataPath, Content content)
-
-