diff --git a/config/alfresco/messages/bootstrap-spaces.properties b/config/alfresco/messages/bootstrap-spaces.properties
index dc4d4601ab..15188af254 100644
--- a/config/alfresco/messages/bootstrap-spaces.properties
+++ b/config/alfresco/messages/bootstrap-spaces.properties
@@ -27,6 +27,12 @@ spaces.templates.content.description=Presentation templates
spaces.templates.email.name=Email Templates
spaces.templates.email.description=Email templates
+spaces.invite_templates.email.name=Email Invite Templates
+spaces.invite_templates.email.description=Email Invite templates
+
+spaces.notify_templates.email.name=Email Notify Templates
+spaces.notify_templates.email.description=Email Notify templates
+
spaces.templates.rss.name=RSS Templates
spaces.templates.rss.description=RSS templates
diff --git a/config/alfresco/messages/invitation-service.properties b/config/alfresco/messages/invitation-service.properties
index 5c16d9dc91..ca4bea46a5 100644
--- a/config/alfresco/messages/invitation-service.properties
+++ b/config/alfresco/messages/invitation-service.properties
@@ -9,4 +9,5 @@ invitation.invite.already_member "The user , {0} is already a member of {1} and
invitation.cancel.not_site_manager "Current user, {0}, cannot cancel invitation: {1} because they are not a Site Manager for site: {2}
invitation.invite.not_site_manager "Current user, {0}, is not a Site Manager for site: {1}
invitation.invite.unable_generate_id "Unable to generate a user name for invitee, which doesn't already belong to someone else firstName:{0} lastName:{1} email:{2}"
-invitation.invite.already_finished "Invitation, {0} has already been accepted, cancelled or rejected"
\ No newline at end of file
+invitation.invite.already_finished "Invitation, {0} has already been accepted, cancelled or rejected"
+invitation.invite.authentication_chain "Authentication chain does not allow creation of new accounts"
\ No newline at end of file
diff --git a/config/alfresco/messages/patch-service.properties b/config/alfresco/messages/patch-service.properties
index 5bfc5c4c94..93a1a303a2 100644
--- a/config/alfresco/messages/patch-service.properties
+++ b/config/alfresco/messages/patch-service.properties
@@ -74,6 +74,12 @@ patch.emailTemplatesFolder.description=Ensures the existence of the 'Email Templ
patch.emailTemplatesFolder.result.exists=The email templates folder already exists: {0}
patch.emailTemplatesFolder.result.created=The email templates folder was successfully created: {0}
+patch.emailInviteAndNotifyTemplatesFolder.description=Ensures the existence of the 'Email Invite Templates' and 'Email Notify Templates' folders.
+patch.emailNotifyTemplatesFolder.result.exists=The Email Notify Templates folder already exists: {0}
+patch.emailNotifyTemplatesFolder.result.created=The Email Notify Templates folder was successfully created: {0}
+patch.emailInviteTemplatesFolder.result.exists=The Email Invite Templates folder already exists: {0}
+patch.emailInviteTemplatesFolder.result.created=The Email Invite Templates folder was successfully created: {0}
+
patch.emailTemplatesContent.description=Loads the email templates into the Email Templates folder.
patch.emailTemplatesContent.result=Imported the Email Templates into the default folder.
diff --git a/config/alfresco/patch/patch-services-context.xml b/config/alfresco/patch/patch-services-context.xml
index 63c770e875..13eccd77fa 100644
--- a/config/alfresco/patch/patch-services-context.xml
+++ b/config/alfresco/patch/patch-services-context.xml
@@ -320,6 +320,20 @@
+
+ * This uses the bootstrap importer to get the paths to look for. If not present, + * the required structures are created. + *
+ *
+ * @author valerysh
+ *
+ */
+public class EmailTemplatesInviteAndNotifyFoldersPatch extends AbstractPatch {
+
+ public static final String PROPERTY_COMPANY_HOME_CHILDNAME = "spaces.company_home.childname";
+ public static final String PROPERTY_DICTIONARY_CHILDNAME = "spaces.dictionary.childname";
+ public static final String PROPERTY_EMAIL_TEMPLATES_FOLDER_CHILDNAME = "spaces.templates.email.childname";
+ public static final String PROPERTY_EMAIL_NOTIFY_TEMPLATES_FOLDER_CHILDNAME = "spaces.templates.email.notify.childname";
+ public static final String PROPERTY_EMAIL_INVITE_TEMPLATES_FOLDER_CHILDNAME = "spaces.templates.email.invite1.childname";
+ private static final String PROPERTY_EMAIL_NOTIFY_TEMPLATES_FOLDER_NAME = "spaces.notify_templates.email.name";
+ private static final String PROPERTY_EMAIL_NOTIFY_TEMPLATES_FOLDER_DESCRIPTION = "spaces.notify_templates.email.description";
+ private static final String PROPERTY_EMAIL_INVITE_TEMPLATES_FOLDER_NAME = "spaces.invite_templates.email.name";
+ private static final String PROPERTY_EMAIL_INVITE_TEMPLATES_FOLDER_DESCRIPTION = "spaces.invite_templates.email.description";
+
+ private static final String NOTIFY_TEMPLATE_NAME = "notify_user_email.ftl";
+ private static final String INVITE_TEMPLATE_NAME = "invite_user_email.ftl";
+
+ private static final String MSG_EMAIL_INVITE_TEMPLATES_FOLDER_EXISTS = "patch.emailInviteTemplatesFolder.result.exists";
+ private static final String MSG_EMAIL_INVITE_TEMPLATES_FOLDER_CREATED = "patch.emailInviteTemplatesFolder.result.created";
+ private static final String MSG_EMAIL_NOTIFY_TEMPLATES_FOLDER_EXISTS = "patch.emailNotifyTemplatesFolder.result.exists";
+ private static final String MSG_EMAIL_NOTIFY_TEMPLATES_FOLDER_CREATED = "patch.emailNotifyTemplatesFolder.result.created";
+
+ private static final String PROPERTY_ICON = "space-icon-default";
+
+ private ImporterBootstrap importerBootstrap;
+ private MessageSource messageSource;
+
+ protected NodeRef emailNotifyTemplatesFolderNodeRef;
+ protected NodeRef emailInviteTemplatesFolderNodeRef;
+
+ protected Properties configuration;
+ protected NodeRef emailTemplatesFolderNodeRef;
+
+ private String emaiemailTemplatesFolderXPath;
+
+ public void setImporterBootstrap(ImporterBootstrap importerBootstrap)
+ {
+ this.importerBootstrap = importerBootstrap;
+ }
+
+ public void setMessageSource(MessageSource messageSource)
+ {
+ this.messageSource = messageSource;
+ }
+
+ /**
+ * Ensure that required common properties have been set
+ */
+ protected void checkCommonProperties() throws Exception
+ {
+ checkPropertyNotNull(importerBootstrap, "importerBootstrap");
+ checkPropertyNotNull(messageSource, "messageSource");
+ }
+
+ /**
+ * Extracts pertinent references and properties that are common to execution
+ * of this and derived patches.
+ */
+ protected void setUp() throws Exception
+ {
+ // get the node store that we must work against
+ StoreRef storeRef = importerBootstrap.getStoreRef();
+ if (storeRef == null)
+ {
+ throw new PatchException("Bootstrap store has not been set");
+ }
+ NodeRef storeRootNodeRef = nodeService.getRootNode(storeRef);
+
+ this.configuration = importerBootstrap.getConfiguration();
+
+ // get the association names that form the path
+ String companyHomeChildName = configuration.getProperty(PROPERTY_COMPANY_HOME_CHILDNAME);
+ if (companyHomeChildName == null || companyHomeChildName.length() == 0)
+ {
+ throw new PatchException("Bootstrap property '" + PROPERTY_COMPANY_HOME_CHILDNAME + "' is not present");
+ }
+ String dictionaryChildName = configuration.getProperty(PROPERTY_DICTIONARY_CHILDNAME);
+ if (dictionaryChildName == null || dictionaryChildName.length() == 0)
+ {
+ throw new PatchException("Bootstrap property '" + PROPERTY_DICTIONARY_CHILDNAME + "' is not present");
+ }
+ String emailTemplatesChildName = configuration.getProperty(PROPERTY_EMAIL_TEMPLATES_FOLDER_CHILDNAME);
+ if (emailTemplatesChildName == null || emailTemplatesChildName.length() == 0)
+ {
+ throw new PatchException("Bootstrap property '" + PROPERTY_EMAIL_TEMPLATES_FOLDER_CHILDNAME + "' is not present");
+ }
+
+ String emailNotifyTemplatesChildName = configuration.getProperty(PROPERTY_EMAIL_NOTIFY_TEMPLATES_FOLDER_CHILDNAME);
+ if (emailNotifyTemplatesChildName == null || emailNotifyTemplatesChildName.length() == 0)
+ {
+ throw new PatchException("Bootstrap property '" + PROPERTY_EMAIL_NOTIFY_TEMPLATES_FOLDER_CHILDNAME + "' is not present");
+ }
+
+ String emailInviteTemplatesChildName = configuration.getProperty(PROPERTY_EMAIL_INVITE_TEMPLATES_FOLDER_CHILDNAME);
+ if (emailInviteTemplatesChildName == null || emailInviteTemplatesChildName.length() == 0)
+ {
+ throw new PatchException("Bootstrap property '" + PROPERTY_EMAIL_INVITE_TEMPLATES_FOLDER_CHILDNAME + "' is not present");
+ }
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("/").append(companyHomeChildName)
+ .append("/").append(dictionaryChildName)
+ .append("/").append(emailTemplatesChildName);
+ emaiemailTemplatesFolderXPath = sb.toString();
+
+ // get the email templates node
+ List