diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index c41409bc27..5b3881fa11 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -804,6 +804,8 @@ create_website_desc=This wizard helps you create a new web project space. website_details=Web Project Details create_website_step1_title=Step One - Web Project Details create_website_step1_desc=Enter the information about the web project. +website_dnsname=DNS name +validation_invalid_dns_name=Invalid website DNS name, only alpha-numeric characters are accepted. website_forms=Form Templates create_website_step2_title=Step Two - Form Templates create_website_step2_desc=Setup the forms you want to use in this project. diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java index c7502db81f..9e813f1af3 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java @@ -64,6 +64,7 @@ public class CreateWebsiteWizard extends BaseWizardBean private static Log logger = LogFactory.getLog(CreateWebsiteWizard.class); + protected String dnsName; protected String title; protected String name; protected String description; @@ -85,6 +86,7 @@ public class CreateWebsiteWizard extends BaseWizardBean super.init(parameters); this.name = null; + this.dnsName = null; this.title = null; this.description = null; @@ -110,6 +112,8 @@ public class CreateWebsiteWizard extends BaseWizardBean if (logger.isDebugEnabled()) logger.debug("Created website folder node with name: " + this.name); + String avmStore = DNSNameMangler.MakeDNSName(this.dnsName); + // apply the uifacets aspect - icon, title and description props Map uiFacetsProps = new HashMap(4); uiFacetsProps.put(ContentModel.PROP_ICON, AVMConstants.SPACE_ICON_WEBSITE); @@ -149,11 +153,11 @@ public class CreateWebsiteWizard extends BaseWizardBean // build the sandboxes now we have the manager list and complete user list for (UserGroupRole userRole : invitedUserRoles) { - createUserSandbox(this.name, managers, userRole.getAuthority(), userRole.getRole()); + createUserSandbox(avmStore, managers, userRole.getAuthority(), userRole.getRole()); } // create the AVM stores to represent the newly created location website - createStagingSandbox(this.name, managers); + createStagingSandbox(avmStore, managers); // save the list of invited users against the store for (UserGroupRole userRole : invitedUserRoles) @@ -170,7 +174,7 @@ public class CreateWebsiteWizard extends BaseWizardBean } // set the property on the node to reference the AVM store - this.nodeService.setProperty(nodeRef, ContentModel.PROP_AVMSTORE, DNSNameMangler.MakeDNSName(this.name)); + this.nodeService.setProperty(nodeRef, ContentModel.PROP_AVMSTORE, avmStore); // navigate to the Websites folder so we can see the newly created folder this.navigator.setCurrentNodeId(websiteParentId); @@ -212,6 +216,22 @@ public class CreateWebsiteWizard extends BaseWizardBean this.name = name; } + /** + * @return + */ + public String getDnsName() + { + return this.dnsName; + } + + /** + * @param dnsName + */ + public void setDnsName(String dnsName) + { + this.dnsName = dnsName; + } + /** * @return Returns the title. */ diff --git a/source/java/org/alfresco/web/ui/common/Utils.java b/source/java/org/alfresco/web/ui/common/Utils.java index 10da2bdc41..02fc9caac1 100644 --- a/source/java/org/alfresco/web/ui/common/Utils.java +++ b/source/java/org/alfresco/web/ui/common/Utils.java @@ -907,7 +907,7 @@ public final class Utils if (disabled == false) { - Object readOnlyAttr = component.getAttributes().get("disabled"); + Object readOnlyAttr = component.getAttributes().get("readonly"); if (readOnlyAttr != null) { readOnly = readOnlyAttr.equals(Boolean.TRUE); diff --git a/source/web/jsp/wcm/create-website-wizard/details.jsp b/source/web/jsp/wcm/create-website-wizard/details.jsp index d99eb5f94b..3277617c19 100644 --- a/source/web/jsp/wcm/create-website-wizard/details.jsp +++ b/source/web/jsp/wcm/create-website-wizard/details.jsp @@ -57,9 +57,16 @@ if (finishButtonPressed) { finishButtonPressed = false; - return validateName(document.getElementById("wizard:wizard-body:name"), + var valid = validateName(document.getElementById("wizard:wizard-body:name"), '', true); + if (valid == true) + { + valid = validateRegex(document.getElementById("wizard:wizard-body:dnsname"), + "^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$", true, null, + '', true); + } + return valid; } else { @@ -94,6 +101,24 @@ + + + + + + + + + + + + + + + + +