public class ThumbnailRegistry extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
Modifier and Type | Class and Description |
---|---|
protected class |
ThumbnailRegistry.RegistryLifecycle
This class hooks in to the spring application lifecycle and ensures that any
ThumbnailDefinitions injected by spring are converted to RenditionDefinitions
and saved.
|
Modifier and Type | Field and Description |
---|---|
protected RenditionService |
renditionService
Rendition service
|
protected TenantAdminService |
tenantAdminService |
protected TransactionService |
transactionService
Transaction service
|
Constructor and Description |
---|
ThumbnailRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
addThumbnailDefinition(ThumbnailDefinition thumbnailDetails)
Add a thumbnail details
|
long |
getMaxSourceSizeBytes(String sourceMimetype,
ThumbnailDefinition thumbnailDefinition)
Returns the maximum source size of any content that may transformed between the supplied
sourceMimetype and thumbnailDefinition's targetMimetype using its transformation options.
|
ThumbnailDefinition |
getThumbnailDefinition(String thumbnailName)
Get the definition of a named thumbnail
|
List<ThumbnailDefinition> |
getThumbnailDefinitions()
Get a list of all the thumbnail definitions
|
List<ThumbnailDefinition> |
getThumbnailDefinitions(String mimetype)
Deprecated.
use overloaded version with sourceSize parameter.
|
List<ThumbnailDefinition> |
getThumbnailDefinitions(String mimetype,
long sourceSize) |
List<ThumbnailDefinition> |
getThumbnailDefinitions(String sourceUrl,
String mimetype,
long sourceSize) |
ThumbnailRenditionConvertor |
getThumbnailRenditionConvertor() |
List<ThumbnailDefinition> |
getThumnailDefintions(String mimetype)
Deprecated.
Use
getThumbnailDefinitions(String) instead. |
void |
initThumbnailDefinitions() |
boolean |
isThumbnailDefinitionAvailable(String sourceUrl,
String sourceMimetype,
long sourceSize,
org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
ThumbnailDefinition thumbnailDefinition)
Checks to see if at this moment in time, the specified
ThumbnailDefinition
is able to thumbnail the source mimetype. |
boolean |
isThumbnailDefinitionAvailable(String sourceUrl,
String sourceMimeType,
long sourceSize,
ThumbnailDefinition thumbnailDefinition)
Checks to see if at this moment in time, the specified
ThumbnailDefinition
is able to thumbnail the source mimetype. |
void |
onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event) |
protected boolean |
redeploy() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setContentService(ContentService contentService)
Content service
|
void |
setRedeployStaticDefsOnStartup(boolean redeployStaticDefsOnStartup) |
void |
setRenditionService(RenditionService renditionService)
Rendition service
|
void |
setTenantAdminService(TenantAdminService tenantAdminService) |
void |
setThumbnailDefinitions(List<ThumbnailDefinition> thumbnailDefinitions)
This method is used to inject the thumbnail definitions.
|
void |
setThumbnailRenditionConvertor(ThumbnailRenditionConvertor thumbnailRenditionConvertor) |
void |
setTransactionService(TransactionService transactionService)
Transaction service
|
protected TransactionService transactionService
protected RenditionService renditionService
protected TenantAdminService tenantAdminService
public void setThumbnailRenditionConvertor(ThumbnailRenditionConvertor thumbnailRenditionConvertor)
public ThumbnailRenditionConvertor getThumbnailRenditionConvertor()
public void setContentService(ContentService contentService)
contentService
- content servicepublic void setTransactionService(TransactionService transactionService)
transactionService
- transaction servicepublic void setRenditionService(RenditionService renditionService)
renditionService
- rendition servicepublic void setTenantAdminService(TenantAdminService tenantAdminService)
public void setRedeployStaticDefsOnStartup(boolean redeployStaticDefsOnStartup)
public void setThumbnailDefinitions(List<ThumbnailDefinition> thumbnailDefinitions)
public void initThumbnailDefinitions()
public List<ThumbnailDefinition> getThumbnailDefinitions()
public List<ThumbnailDefinition> getThumbnailDefinitions(String mimetype)
public List<ThumbnailDefinition> getThumbnailDefinitions(String mimetype, long sourceSize)
public List<ThumbnailDefinition> getThumbnailDefinitions(String sourceUrl, String mimetype, long sourceSize)
@Deprecated public List<ThumbnailDefinition> getThumnailDefintions(String mimetype)
getThumbnailDefinitions(String)
instead.mimetype
- Stringpublic boolean isThumbnailDefinitionAvailable(String sourceUrl, String sourceMimetype, long sourceSize, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, ThumbnailDefinition thumbnailDefinition)
ThumbnailDefinition
is able to thumbnail the source mimetype. Typically used with Thumbnail Definitions
retrieved by name, and/or when dealing with transient ContentTransformer
s.sourceUrl
- The URL of the source (optional)sourceMimetype
- The source mimetypesourceSize
- the size (in bytes) of the source. Use -1 if unknown.sourceNodeRef
- which is set in a copy of the thumbnailDefinition transformation options,
so that it may be used by transformers and debug.thumbnailDefinition
- The ThumbnailDefinition
to check forpublic boolean isThumbnailDefinitionAvailable(String sourceUrl, String sourceMimeType, long sourceSize, ThumbnailDefinition thumbnailDefinition)
ThumbnailDefinition
is able to thumbnail the source mimetype. Typically used with Thumbnail Definitions
retrieved by name, and/or when dealing with transient ContentTransformer
s.sourceUrl
- The URL of the source (optional)sourceMimeType
- The source mimetypesourceSize
- the size (in bytes) of the source. Use -1 if unknown.thumbnailDefinition
- The ThumbnailDefinition
to check forpublic long getMaxSourceSizeBytes(String sourceMimetype, ThumbnailDefinition thumbnailDefinition)
sourceMimetype
- StringthumbnailDefinition
- ThumbnailDefinitionpublic void addThumbnailDefinition(ThumbnailDefinition thumbnailDetails)
thumbnailDetails
- thumbnail detailspublic ThumbnailDefinition getThumbnailDefinition(String thumbnailName)
thumbnailName
- the thumbnail namepublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
protected boolean redeploy()
Copyright © 2005–2017 Alfresco Software. All rights reserved.