Package org.ametys.plugins.flipbook
Class Attachment2FlipbookUriResolver
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.transformation.AbstractURIResolver
-
- org.ametys.cms.transformation.AttachmentURIResolver
-
- org.ametys.web.editor.AttachmentURIResolver
-
- org.ametys.plugins.flipbook.Attachment2FlipbookUriResolver
-
- All Implemented Interfaces:
URIResolver,PluginAware,Configurable,Contextualizable,LogEnabled,Serviceable
public class Attachment2FlipbookUriResolver extends AttachmentURIResolver implements PluginAware, Configurable
URIResolverfor type "attachment-content-flipbook".
These links point to a document file from the attachments of the current Content converted it to flash.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classAttachment2FlipbookUriResolver.CacheThread
-
Field Summary
Fields Modifier and Type Field Description protected ConvertContentAttachment2ImagesComponent_attachmentComponentThe ametys object resolver.protected String_pluginNameThe plugin name.protected String_typeThe type.-
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 Attachment2FlipbookUriResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String_resolveImage(String uri, String uriArgument, int height, int width, boolean download, boolean absolute, boolean internal)voidconfigure(Configuration configuration)StringgetType()Returns the type of links handled by thisURIResolver.protected StringgetUriPrefix(AmetysObject object, boolean download, boolean absolute, boolean internal)Get the URI prefixStringresolve(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.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.AttachmentURIResolver
contextualize
-
Methods inherited from class org.ametys.cms.transformation.AttachmentURIResolver
_resolve, checkLink, getLabel, resolveImageAsBase64
-
Methods inherited from class org.ametys.cms.transformation.AbstractURIResolver
resolveBoundedImageAsBase64, resolveCroppedImage, resolveCroppedImageAsBase64, resolveImageAsBase64
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_pluginName
protected String _pluginName
The plugin name.
-
_attachmentComponent
protected ConvertContentAttachment2ImagesComponent _attachmentComponent
The ametys object resolver.
-
-
Constructor Detail
-
Attachment2FlipbookUriResolver
public Attachment2FlipbookUriResolver()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAttachmentURIResolver- 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
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
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.
-
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
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.
-
_resolveImage
private String _resolveImage(String uri, String uriArgument, int height, int width, boolean download, boolean absolute, boolean internal)
-
getUriPrefix
protected String getUriPrefix(AmetysObject object, boolean download, boolean absolute, boolean internal)
Description copied from class:AttachmentURIResolverGet the URI prefix- Overrides:
getUriPrefixin classAttachmentURIResolver- Parameters:
object- The objectdownload- true if the pointed resource is to be downloaded.absolute- true to get an internal URI.internal- true if the url must be absolute- Returns:
- the URI prefix
-
-