Merged DEV/BELARUS/HEAD-2010_02_10 to HEAD

19151: SAIL-298: Implemented subsystem changes.
      - We didn't remove the cifs.serverName property because it is independent of host/port/context/protocol.
   Applied following corrections
      - Removed the email 'chain'. OutboundSMTP and InboundSMTP are separate subsystems and don't need to be chained
      - Added the ability for multiple Spring-initialized subsystems to share the same category
      - No need to expose mailService outside of the OutboundSMTP subsystem as far as I can tell
      - GlobalDeskTopActionConfigBean doesn't need dependencies and no longer exposes the webpath property
      - Fixed construction of contexts in ContentDiskDriver.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19266 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2010-03-12 18:41:09 +00:00
parent 8f0ad2d96f
commit a2c2e215a8
29 changed files with 548 additions and 271 deletions

View File

@@ -134,6 +134,11 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
*/
private String repoRemoteUrl = null;
private boolean sendTestMessage = false;
private String testMessageTo = null;
private String testMessageSubject = "Test message";
private String testMessageText = "This is a test message.";
/**
* Test mode prevents email messages from being sent.
* It is used when unit testing when we don't actually want to send out email messages.
@@ -224,6 +229,43 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
this.repoRemoteUrl = repoRemoteUrl;
}
public void setTestMessageTo(String testMessageTo)
{
this.testMessageTo = testMessageTo;
}
public void setTestMessageSubject(String testMessageSubject)
{
this.testMessageSubject = testMessageSubject;
}
public void setTestMessageText(String testMessageText)
{
this.testMessageText = testMessageText;
}
public void setSendTestMessage(boolean sendTestMessage)
{
this.sendTestMessage = sendTestMessage;
}
@Override
public void init()
{
super.init();
if (sendTestMessage)
{
Map<String, Serializable> params = new HashMap<String, Serializable>();
params.put(PARAM_TO, testMessageTo);
params.put(PARAM_SUBJECT, testMessageSubject);
params.put(PARAM_TEXT, testMessageText);
Action ruleAction = serviceRegistry.getActionService().createAction(NAME, params);
executeImpl(ruleAction, null);
}
}
/**
* Initialise bean
*/
@@ -363,7 +405,12 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
// set the from address
NodeRef person = personService.getPerson(authService.getCurrentUserName());
String fromActualUser = (String)nodeService.getProperty(person, ContentModel.PROP_EMAIL);
String fromActualUser = null;
if (person != null)
{
fromActualUser = (String) nodeService.getProperty(person, ContentModel.PROP_EMAIL);
}
if( fromActualUser != null && fromActualUser.length() != 0)
{
message.setFrom(fromActualUser);