diff --git a/repository/src/main/java/org/alfresco/repo/security/authentication/ResetPasswordServiceImpl.java b/repository/src/main/java/org/alfresco/repo/security/authentication/ResetPasswordServiceImpl.java index 834fe1bee3..1c7bd9bf34 100644 --- a/repository/src/main/java/org/alfresco/repo/security/authentication/ResetPasswordServiceImpl.java +++ b/repository/src/main/java/org/alfresco/repo/security/authentication/ResetPasswordServiceImpl.java @@ -373,7 +373,7 @@ public class ResetPasswordServiceImpl implements ResetPasswordService final ClientApp clientApp = getClientAppConfig(clientName); Map emailTemplateModel = Collections.singletonMap(FTL_RESET_PASSWORD_URL, - createResetPasswordUrl(clientApp, id, key, userName)); + createResetPasswordUrl(clientApp, id, key)); final String templatePath = emailHelper.getEmailTemplate(clientName, getResetPasswordEmailTemplate(clientApp), @@ -504,7 +504,7 @@ public class ResetPasswordServiceImpl implements ResetPasswordService return UrlUtil.replaceShareUrlPlaceholder(url, sysAdminParams); } - private String getAdwUrl(String url, String propName) + private String getRepoBaseUrl(String url, String propName) { if (url == null) { @@ -516,7 +516,7 @@ public class ResetPasswordServiceImpl implements ResetPasswordService { url = url.substring(0, url.length() - 1); } - return UrlUtil.replaceAdwUrlPlaceholder(url, sysAdminParams); + return UrlUtil.replaceRepoBaseUrlPlaceholder(url, sysAdminParams); } protected String getResetPasswordEmailTemplate(ClientApp clientApp) @@ -532,17 +532,21 @@ public class ResetPasswordServiceImpl implements ResetPasswordService /** * This method creates a URL for the 'reset password' link which appears in the email */ - protected String createResetPasswordUrl(ClientApp clientApp, final String id, final String key, final String userName) + protected String createResetPasswordUrl(ClientApp clientApp, final String id, final String key) { StringBuilder sb = new StringBuilder(100); String pageUrl = clientApp.getProperty("resetPasswordPageUrl"); - if(clientApp.getName().equals("adw")) { - sb.append(getAdwUrl(pageUrl, "")); - LOGGER.warn("Client Name is " + clientApp.getName() + " The url used is " + sb.toString()); - sb.append("?key=").append(key) - .append("&id=").append(BPMEngineRegistry.createGlobalId(ActivitiConstants.ENGINE_ID, id)).append("&userName=").append(userName); + if(clientApp.getName().equals("workspace")) + { + String workspaceUrl = clientApp.getProperty("workspaceUrl"); + + sb.append(getRepoBaseUrl(workspaceUrl,"")); + LOGGER.warn("Client Name is " + clientApp.getName() + " The url used is " + sb.toString()); + sb.append("?key=").append(key) + .append("&id=").append(BPMEngineRegistry.createGlobalId(ActivitiConstants.ENGINE_ID, id)); + } else { diff --git a/repository/src/main/java/org/alfresco/util/UrlUtil.java b/repository/src/main/java/org/alfresco/util/UrlUtil.java index c8d57b7596..27562d6b3e 100644 --- a/repository/src/main/java/org/alfresco/util/UrlUtil.java +++ b/repository/src/main/java/org/alfresco/util/UrlUtil.java @@ -41,6 +41,10 @@ public class UrlUtil public static final Pattern PATTERN = Pattern.compile("\\$\\{shareUrl\\}"); // ${alfrescoUrl} placeholder public static final Pattern REPO_PATTERN = Pattern.compile("\\$\\{alfrescoUrl\\}"); + + public static final Pattern WORKSPACE_PATTERN = Pattern.compile("\\$\\{repoBaseUrl\\}"); + + /** * Builds up the Url to Alfresco based on the settings in the * {@link SysAdminParams}. @@ -153,29 +157,28 @@ public class UrlUtil * @return Adw Url such as https://col.ab.or.ate/#/ * or http://localhost:8081/#/ */ - public static String getAdwUrl(SysAdminParams sysAdminParams) + public static String getWorkspaceUrl(SysAdminParams sysAdminParams) { return buildUrl( sysAdminParams.getAlfrescoProtocol(), sysAdminParams.getAlfrescoHost(), - sysAdminParams.getAlfrescoPort(), - "#"); + sysAdminParams.getAlfrescoPort(),""); } /** - * Replaces the adw url placeholder, namely {@literal ${alfrescoUrl}}, with adw url. + * Replaces the repo base url placeholder, namely {@literal ${repoBaseUrl}}, with workspace url. * - * @param value the string value which contains the share url placeholder + * @param value the string value which contains the repoBase url placeholder * @param sysAdminParams the {@code SysAdminParams} object * @return if the given {@code value} contains share url placeholder, * the placeholder is replaced with share url; otherwise, the given {@code value} is simply returned */ - public static String replaceAdwUrlPlaceholder(String value, SysAdminParams sysAdminParams) + public static String replaceRepoBaseUrlPlaceholder(String value, SysAdminParams sysAdminParams) { if (value != null) { - return REPO_PATTERN.matcher(value).replaceAll(getAdwUrl(sysAdminParams)); + return WORKSPACE_PATTERN.matcher(value).replaceAll(getWorkspaceUrl(sysAdminParams)); } return value; } diff --git a/repository/src/main/resources/alfresco/client/config/repo-clients-apps.properties b/repository/src/main/resources/alfresco/client/config/repo-clients-apps.properties index b47f062167..094074f3f8 100644 --- a/repository/src/main/resources/alfresco/client/config/repo-clients-apps.properties +++ b/repository/src/main/resources/alfresco/client/config/repo-clients-apps.properties @@ -20,13 +20,17 @@ repo.client-app.share.resetPasswordPageUrl=${shareUrl}/page/reset-password repo.client-app.share.confirmResetPasswordTemplatePath= ### Digital workspace template configurations -repo.client-app.workspace.inviteModeratedTemplatePath= -repo.client-app.workspace.workspaceUrl=workspace -repo.client-app.workspace.templateAssetsUrl=${alfrescoUrl}/images +#repo.client-app.workspace.inviteModeratedTemplatePath= + +repo.client-app.workspace.workspaceUrl=${repoBaseUrl}/workspace + +###########repo.client-app.workspace.workspaceUrl=http://customdomain.com/workspace + +repo.client-app.workspace.templateAssetsUrl=${workspaceUrl}/images # reset password request email template path -repo.client-app.adw.requestResetPasswordTemplatePath=alfresco/templates/reset-password-email-templates/forgot-password-email-template.ftl +repo.client-app.workspace.requestResetPasswordTemplatePath=alfresco/templates/reset-password-email-templates/forgot-password-email-template.ftl # reset password UI page url -repo.client-app.adw.resetPasswordPageUrl=${alfrescoUrl}/reset-password/ +repo.client-app.workspace.resetPasswordPageUrl=${workspaceUrl}/reset-password/ # reset password confirmation email template path -repo.client-app.adw.confirmResetPasswordTemplatePath= \ No newline at end of file +repo.client-app.workspace.confirmResetPasswordTemplatePath= \ No newline at end of file