org.alfresco.repo.action.executer
Class TransformActionExecuter

java.lang.Object
  extended by org.alfresco.repo.action.CommonResourceAbstractBase
      extended by org.alfresco.repo.action.ParameterizedItemAbstractBase
          extended by org.alfresco.repo.action.executer.ActionExecuterAbstractBase
              extended by org.alfresco.repo.action.executer.TransformActionExecuter
All Implemented Interfaces:
ActionExecuter, org.springframework.beans.factory.BeanNameAware
Direct Known Subclasses:
ImageTransformActionExecuter

public class TransformActionExecuter
extends ActionExecuterAbstractBase

Transfor action executer


Field Summary
static java.lang.String ERR_OVERWRITE
           
static java.lang.String NAME
           
static java.lang.String PARAM_ASSOC_QNAME
           
static java.lang.String PARAM_ASSOC_TYPE_QNAME
           
static java.lang.String PARAM_DESTINATION_FOLDER
           
static java.lang.String PARAM_MIME_TYPE
           
static java.lang.String PARAM_OVERWRITE_COPY
           
 
Fields inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase
actionDefinition, applicableTypes, publicAction
 
Fields inherited from class org.alfresco.repo.action.ParameterizedItemAbstractBase
DISPLAY_LABEL, runtimeActionService
 
Fields inherited from class org.alfresco.repo.action.CommonResourceAbstractBase
name
 
Fields inherited from interface org.alfresco.repo.action.executer.ActionExecuter
PARAM_RESULT
 
Constructor Summary
TransformActionExecuter()
           
 
Method Summary
protected  void addParameterDefinitions(java.util.List paramList)
          Add parameter definitions
protected  void doTransform(Action ruleAction, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.ContentReader contentReader, org.alfresco.service.cmr.repository.NodeRef destinationNodeRef, org.alfresco.service.cmr.repository.ContentWriter contentWriter)
          Executed in a new transaction so that failures don't cause the entire transaction to rollback.
protected  void executeImpl(Action ruleAction, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
          Execute the action implementation
 void setCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService)
          Set the service to determine check-in and check-out status
 void setContentService(ContentService contentService)
          Set the content service
 void setCopyService(CopyService copyService)
          Set the copy service
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
          Set the dictionary service
 void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
          Set the mime type service
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
          Set the node service
static java.lang.String transformName(org.alfresco.service.cmr.repository.MimetypeService mimetypeService, java.lang.String original, java.lang.String newMimetype, boolean alwaysAdd)
          Transform a name from original extension to new extension, if appropriate.
 
Methods inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase
createActionDefinition, execute, getActionDefinition, getIgnoreLock, getQueueName, getTrackStatus, init, setApplicableTypes, setBaseNodeService, setIgnoreLock, setLockService, setPublicAction, setQueueName, setTrackStatus
 
Methods inherited from class org.alfresco.repo.action.ParameterizedItemAbstractBase
checkMandatoryProperties, getAdhocPropertiesAllowed, getDescriptionKey, getParamDisplayLabel, getParameterDefintions, getTitleKey, setRuntimeActionService, toString
 
Methods inherited from class org.alfresco.repo.action.CommonResourceAbstractBase
setBeanName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERR_OVERWRITE

public static final java.lang.String ERR_OVERWRITE
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

PARAM_MIME_TYPE

public static final java.lang.String PARAM_MIME_TYPE
See Also:
Constant Field Values

PARAM_DESTINATION_FOLDER

public static final java.lang.String PARAM_DESTINATION_FOLDER
See Also:
Constant Field Values

PARAM_ASSOC_TYPE_QNAME

public static final java.lang.String PARAM_ASSOC_TYPE_QNAME
See Also:
Constant Field Values

PARAM_ASSOC_QNAME

public static final java.lang.String PARAM_ASSOC_QNAME
See Also:
Constant Field Values

PARAM_OVERWRITE_COPY

public static final java.lang.String PARAM_OVERWRITE_COPY
See Also:
Constant Field Values
Constructor Detail

TransformActionExecuter

public TransformActionExecuter()
Method Detail

setMimetypeService

public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
Set the mime type service


setNodeService

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


setCheckOutCheckInService

public void setCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService)
Set the service to determine check-in and check-out status


setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service


setContentService

public void setContentService(ContentService contentService)
Set the content service


setCopyService

public void setCopyService(CopyService copyService)
Set the copy service


addParameterDefinitions

protected void addParameterDefinitions(java.util.List paramList)
Add parameter definitions

Specified by:
addParameterDefinitions in class ParameterizedItemAbstractBase
Parameters:
paramList - the parameter definitions list

executeImpl

protected void executeImpl(Action ruleAction,
                           org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Description copied from class: ActionExecuterAbstractBase
Execute the action implementation

Specified by:
executeImpl in class ActionExecuterAbstractBase
Parameters:
ruleAction - the action
actionedUponNodeRef - the actioned upon node
See Also:
org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef)

doTransform

protected void doTransform(Action ruleAction,
                           org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
                           org.alfresco.service.cmr.repository.ContentReader contentReader,
                           org.alfresco.service.cmr.repository.NodeRef destinationNodeRef,
                           org.alfresco.service.cmr.repository.ContentWriter contentWriter)
Executed in a new transaction so that failures don't cause the entire transaction to rollback.


transformName

public static java.lang.String transformName(org.alfresco.service.cmr.repository.MimetypeService mimetypeService,
                                             java.lang.String original,
                                             java.lang.String newMimetype,
                                             boolean alwaysAdd)
Transform a name from original extension to new extension, if appropriate. If the original name seems to end with a reasonable file extension, then the name will be transformed such that the old extension is replaced with the new. Otherwise the name will be returned unaltered.

The original name will be deemed to have a reasonable extension if there are one or more characters after the (required) final dot, none of which are spaces.

Parameters:
mimetypeService - the mimetype service
original - the original name
newMimetype - the new mime type
alwaysAdd - if the name has no extension, then add the new one
Returns:
name with new extension as appropriate for the mimetype


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