org.alfresco.repo.thumbnail
Class SimpleThumbnailer

java.lang.Object
  extended by org.alfresco.repo.transaction.TransactionListenerAdapter
      extended by org.alfresco.repo.thumbnail.SimpleThumbnailer
All Implemented Interfaces:
ContentServicePolicies.OnContentUpdatePolicy, ClassPolicy, Policy, TransactionListener, org.springframework.beans.factory.InitializingBean

public class SimpleThumbnailer
extends TransactionListenerAdapter
implements ContentServicePolicies.OnContentUpdatePolicy, org.springframework.beans.factory.InitializingBean

A simplistic policy that generates all applicable thumbnails for content as it is added or updated. As this is done synchronously, this is not recommended for production use.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Field Summary
 
Fields inherited from interface org.alfresco.repo.content.ContentServicePolicies.OnContentUpdatePolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Constructor Summary
SimpleThumbnailer()
           
 
Method Summary
 void afterCommit()
          Invoked after transaction commit.
 void afterPropertiesSet()
          Registers the policy behaviour methods.
 void onContentUpdate(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean newContent)
          When content changes, thumbnails are (re)generated.
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
          Sets the node service.
 void setPolicyComponent(PolicyComponent policyComponent)
          Sets the policy component.
 void setThumbnailService(ThumbnailService thumbnailService)
          Sets the thumbnail service.
 void setTransactionService(TransactionService transactionService)
          Sets the transaction service.
 
Methods inherited from class org.alfresco.repo.transaction.TransactionListenerAdapter
afterRollback, beforeCommit, beforeCompletion, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleThumbnailer

public SimpleThumbnailer()
Method Detail

setPolicyComponent

public void setPolicyComponent(PolicyComponent policyComponent)
Sets the policy component.

Parameters:
policyComponent - used for registrations

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the node service.

Parameters:
nodeService - the node service

setTransactionService

public void setTransactionService(TransactionService transactionService)
Sets the transaction service.

Parameters:
transactionService - the transaction service

setThumbnailService

public void setThumbnailService(ThumbnailService thumbnailService)
Sets the thumbnail service.

Parameters:
thumbnailService - the thumbnail service

afterPropertiesSet

public void afterPropertiesSet()
Registers the policy behaviour methods.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

onContentUpdate

public void onContentUpdate(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                            boolean newContent)
When content changes, thumbnails are (re)generated.

Specified by:
onContentUpdate in interface ContentServicePolicies.OnContentUpdatePolicy
Parameters:
nodeRef - the node ref
newContent - is the content new?

afterCommit

public void afterCommit()
Description copied from class: TransactionListenerAdapter
Invoked after transaction commit.

Any exceptions generated here will cause the transaction to rollback.

Although all transaction resources are still available, this method should be used only for cleaning up resources after a commit has occured.

Specified by:
afterCommit in interface TransactionListener
Overrides:
afterCommit in class TransactionListenerAdapter


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.