org.alfresco.repo.action.executer
Class MailActionExecuter

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.MailActionExecuter
All Implemented Interfaces:
ActionExecuter, TestModeable, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean

public class MailActionExecuter
extends ActionExecuterAbstractBase
implements org.springframework.beans.factory.InitializingBean, TestModeable

Mail action executor implementation.


Nested Class Summary
static class MailActionExecuter.URLHelper
           
 
Field Summary
static java.lang.String NAME
          Action executor constants
static java.lang.String PARAM_FROM
           
static java.lang.String PARAM_HTML
           
static java.lang.String PARAM_IGNORE_SEND_FAILURE
           
static java.lang.String PARAM_SUBJECT
           
static java.lang.String PARAM_TEMPLATE
           
static java.lang.String PARAM_TEMPLATE_MODEL
           
static java.lang.String PARAM_TEXT
           
static java.lang.String PARAM_TO
           
static java.lang.String PARAM_TO_MANY
           
 
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
MailActionExecuter()
           
 
Method Summary
protected  void addParameterDefinitions(java.util.List paramList)
          Add the parameter definitions
 void afterPropertiesSet()
          Initialise bean
protected  void executeImpl(Action ruleAction, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
          Send an email message
 void init()
          Init method
 boolean isTestMode()
           
 javax.mail.internet.MimeMessage retrieveLastTestMessage()
          Returns the most recent message that wasn't sent because TestMode had been enabled.
 void setAuthenticationService(AuthenticationService authService)
           
 void setAuthorityService(AuthorityService authorityService)
           
 void setFromAddress(java.lang.String fromAddress)
           
 void setHeaderEncoding(java.lang.String headerEncoding)
           
 void setMailService(org.springframework.mail.javamail.JavaMailSender javaMailSender)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
 void setPersonService(PersonService personService)
           
 void setRepoRemoteUrl(java.lang.String repoRemoteUrl)
           
 void setSendTestMessage(boolean sendTestMessage)
           
 void setServiceRegistry(ServiceRegistry serviceRegistry)
           
 void setTemplateService(TemplateService templateService)
           
 void setTestMessageSubject(java.lang.String testMessageSubject)
           
 void setTestMessageText(java.lang.String testMessageText)
           
 void setTestMessageTo(java.lang.String testMessageTo)
           
 void setTestMode(boolean testMode)
           
 
Methods inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase
createActionDefinition, execute, getActionDefinition, getIgnoreLock, getQueueName, getTrackStatus, 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

NAME

public static final java.lang.String NAME
Action executor constants

See Also:
Constant Field Values

PARAM_TO

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

PARAM_TO_MANY

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

PARAM_SUBJECT

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

PARAM_TEXT

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

PARAM_HTML

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

PARAM_FROM

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

PARAM_TEMPLATE

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

PARAM_TEMPLATE_MODEL

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

PARAM_IGNORE_SEND_FAILURE

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

MailActionExecuter

public MailActionExecuter()
Method Detail

setMailService

public void setMailService(org.springframework.mail.javamail.JavaMailSender javaMailSender)
Parameters:
javaMailSender - the java mail sender

setTemplateService

public void setTemplateService(TemplateService templateService)
Parameters:
templateService - the TemplateService

setPersonService

public void setPersonService(PersonService personService)
Parameters:
personService - the PersonService

setAuthenticationService

public void setAuthenticationService(AuthenticationService authService)
Parameters:
authService - the AuthenticationService

setServiceRegistry

public void setServiceRegistry(ServiceRegistry serviceRegistry)
Parameters:
serviceRegistry - the ServiceRegistry

setAuthorityService

public void setAuthorityService(AuthorityService authorityService)
Parameters:
authorityService - the AuthorityService

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Parameters:
nodeService - the NodeService to set.

setHeaderEncoding

public void setHeaderEncoding(java.lang.String headerEncoding)
Parameters:
headerEncoding - The mail header encoding to set.

setFromAddress

public void setFromAddress(java.lang.String fromAddress)
Parameters:
fromAddress - The default mail address.

setRepoRemoteUrl

public void setRepoRemoteUrl(java.lang.String repoRemoteUrl)
Parameters:
repoRemoteUrl - The default alfresco installation url

setTestMessageTo

public void setTestMessageTo(java.lang.String testMessageTo)

setTestMessageSubject

public void setTestMessageSubject(java.lang.String testMessageSubject)

setTestMessageText

public void setTestMessageText(java.lang.String testMessageText)

setSendTestMessage

public void setSendTestMessage(boolean sendTestMessage)

init

public void init()
Description copied from class: ActionExecuterAbstractBase
Init method

Overrides:
init in class ActionExecuterAbstractBase

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Initialise bean

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

executeImpl

protected void executeImpl(Action ruleAction,
                           org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Send an email message

Specified by:
executeImpl in class ActionExecuterAbstractBase
Parameters:
ruleAction - the action
actionedUponNodeRef - the actioned upon node
Throws:
AlfrescoRuntimeExeption

addParameterDefinitions

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

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

setTestMode

public void setTestMode(boolean testMode)
Specified by:
setTestMode in interface TestModeable

isTestMode

public boolean isTestMode()
Specified by:
isTestMode in interface TestModeable

retrieveLastTestMessage

public javax.mail.internet.MimeMessage retrieveLastTestMessage()
Returns the most recent message that wasn't sent because TestMode had been enabled.



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