Package org.alfresco.repo.rendition2
Class RenditionService2Impl
- java.lang.Object
-
- org.alfresco.repo.rendition2.RenditionService2Impl
-
- All Implemented Interfaces:
ContentServicePolicies.OnContentUpdatePolicy,ClassPolicy,Policy,RenditionService2,org.springframework.beans.factory.InitializingBean
public class RenditionService2Impl extends java.lang.Object implements RenditionService2, org.springframework.beans.factory.InitializingBean, ContentServicePolicies.OnContentUpdatePolicy
The Async Rendition service. Replaces the original deprecated RenditionService.- Author:
- adavis
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_ENCODINGstatic java.lang.StringDEFAULT_MIMETYPEstatic org.alfresco.service.namespace.QNameDEFAULT_RENDITION_CONTENT_PROPstatic intRENDITION2_DOES_NOT_EXISTstatic intSOURCE_HAS_NO_CONTENTstatic java.lang.StringTRANSFORMING_ERROR_MESSAGE-
Fields inherited from interface org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy
QNAME
-
-
Constructor Summary
Constructors Constructor Description RenditionService2Impl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()voidconsume(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.io.InputStream transformInputStream, RenditionDefinition2 renditionDefinition, int transformContentHashCode)Takes a transformation (InputStream) and attaches it as a rendition to the source node.voiddeleteRendition(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.lang.String renditionName)voidfailure(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, RenditionDefinition2 renditionDefinition, int transformContentHashCode)org.alfresco.service.cmr.repository.ChildAssociationRefgetRenditionByName(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.lang.String renditionName)This method gets the rendition of thesourceNodeRefidentified by its name.RenditionDefinitionRegistry2getRenditionDefinitionRegistry2()java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef>getRenditions(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef)This method gets all the renditions of thesourceNodeRef.booleanisCreatedByRenditionService2(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.lang.String renditionName)booleanisEnabled()Indicates if renditions are enabled.booleanisRenditionAvailable(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef renditionNode)Indicates if the rendition is available.booleanisThumbnailsEnabled()voidonContentUpdate(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, boolean newContent)voidrender(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.lang.String renditionName)This method asynchronously renders content as specified by therenditionName.voidsetBehaviourFilter(BehaviourFilter behaviourFilter)voidsetContentService(ContentService contentService)voidsetEnabled(boolean enabled)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetPolicyComponent(PolicyComponent policyComponent)voidsetRenditionDefinitionRegistry2(RenditionDefinitionRegistry2 renditionDefinitionRegistry2)voidsetRenditionPreventionRegistry(RenditionPreventionRegistry renditionPreventionRegistry)voidsetRenditionRequestSheduler(PostTxnCallbackScheduler renditionRequestSheduler)voidsetRuleService(RuleService ruleService)voidsetThumbnailsEnabled(boolean thumbnailsEnabled)voidsetTransactionService(TransactionService transactionService)voidsetTransformClient(TransformClient transformClient)
-
-
-
Field Detail
-
TRANSFORMING_ERROR_MESSAGE
public static final java.lang.String TRANSFORMING_ERROR_MESSAGE
- See Also:
- Constant Field Values
-
DEFAULT_RENDITION_CONTENT_PROP
public static final org.alfresco.service.namespace.QName DEFAULT_RENDITION_CONTENT_PROP
-
DEFAULT_MIMETYPE
public static final java.lang.String DEFAULT_MIMETYPE
- See Also:
- Constant Field Values
-
DEFAULT_ENCODING
public static final java.lang.String DEFAULT_ENCODING
- See Also:
- Constant Field Values
-
SOURCE_HAS_NO_CONTENT
public static final int SOURCE_HAS_NO_CONTENT
- See Also:
- Constant Field Values
-
RENDITION2_DOES_NOT_EXIST
public static final int RENDITION2_DOES_NOT_EXIST
- See Also:
- Constant Field Values
-
-
Method Detail
-
setRenditionRequestSheduler
public void setRenditionRequestSheduler(PostTxnCallbackScheduler renditionRequestSheduler)
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
setContentService
public void setContentService(ContentService contentService)
-
setRenditionPreventionRegistry
public void setRenditionPreventionRegistry(RenditionPreventionRegistry renditionPreventionRegistry)
-
setRenditionDefinitionRegistry2
public void setRenditionDefinitionRegistry2(RenditionDefinitionRegistry2 renditionDefinitionRegistry2)
-
getRenditionDefinitionRegistry2
public RenditionDefinitionRegistry2 getRenditionDefinitionRegistry2()
- Specified by:
getRenditionDefinitionRegistry2in interfaceRenditionService2- Returns:
- the
RenditionDefinitionRegistry2being used by the service.
-
setTransformClient
public void setTransformClient(TransformClient transformClient)
-
setPolicyComponent
public void setPolicyComponent(PolicyComponent policyComponent)
-
setBehaviourFilter
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
-
setRuleService
public void setRuleService(RuleService ruleService)
-
setEnabled
public void setEnabled(boolean enabled)
-
setThumbnailsEnabled
public void setThumbnailsEnabled(boolean thumbnailsEnabled)
-
isThumbnailsEnabled
public boolean isThumbnailsEnabled()
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
render
public void render(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.lang.String renditionName)Description copied from interface:RenditionService2This method asynchronously renders content as specified by therenditionName. The content to be rendered is provided bysourceNodeRef.- Specified by:
renderin interfaceRenditionService2- Parameters:
sourceNodeRef- the node from which the content is retrieved.renditionName- the rendition to be performed.
-
failure
public void failure(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, RenditionDefinition2 renditionDefinition, int transformContentHashCode)
-
consume
public void consume(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.io.InputStream transformInputStream, RenditionDefinition2 renditionDefinition, int transformContentHashCode)Takes a transformation (InputStream) and attaches it as a rendition to the source node. Does nothing if there is already a newer rendition. If the transformInputStream is null, this is taken to be a transform failure.
-
isCreatedByRenditionService2
public boolean isCreatedByRenditionService2(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.lang.String renditionName)
-
deleteRendition
public void deleteRendition(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.lang.String renditionName)
-
getRenditions
public java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getRenditions(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef)
Description copied from interface:RenditionService2This method gets all the renditions of thesourceNodeRef.- Specified by:
getRenditionsin interfaceRenditionService2- Returns:
- a list of
ChildAssociationRefs which link thesourceNodeRefto the renditions.
-
isRenditionAvailable
public boolean isRenditionAvailable(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef renditionNode)Indicates if the rendition is available. Failed renditions (there was an error) don't have a contentUrl and out of date renditions or those still being created don't have a matching contentHashCode.
-
getRenditionByName
public org.alfresco.service.cmr.repository.ChildAssociationRef getRenditionByName(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.lang.String renditionName)Description copied from interface:RenditionService2This method gets the rendition of thesourceNodeRefidentified by its name.- Specified by:
getRenditionByNamein interfaceRenditionService2- Parameters:
sourceNodeRef- the source node for the renditionsrenditionName- the renditionName used to identify a rendition.- Returns:
- the
ChildAssociationRefwhich links the source node to the rendition ornullif there is no rendition or it is not up to date.
-
isEnabled
public boolean isEnabled()
Description copied from interface:RenditionService2Indicates if renditions are enabled. Set using thesystem.thumbnail.generatevalue.- Specified by:
isEnabledin interfaceRenditionService2
-
onContentUpdate
public void onContentUpdate(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, boolean newContent)- Specified by:
onContentUpdatein interfaceContentServicePolicies.OnContentUpdatePolicy- Parameters:
sourceNodeRef- the node reference
-
-