diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 81d2dd0502..2552fc71ec 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -979,6 +979,12 @@ website_dnsname=DNS name website_deployto=Deploy To validation_invalid_dns_name=Invalid website DNS name: only alpha-numeric and non-initial/final hyphen characters are allowed (max length < 64). website_webapp=Default Webapp +website_createfrom=Create From Existing Web Project +create_website_step2_title=Step Two - Create From Existing Web Project +create_website_step2_desc=Optionally select an existing project to be used as the template for this website +website_create_empty=Create a new empty Web Project +website_create_existing=Create a Web Project based on an existing one. The Staging Sandbox structure, Web Forms, Workflow and Users will be copied from the selected Web Project +website_sourcewebsite=Created from Web Project website_selected_forms=Selected Web Content Forms website_web_content_forms=Web Content Forms website_save_location=Save Location @@ -996,22 +1002,22 @@ form_template_templates=Configure Templates form_template_templates_desc=Setup the Templates you want to use for the Web Form {0} in Web Project {1}. form_template_workflow=Configure Workflow form_template_workflow_desc=Configure the workflow defaults for this Web Project -create_website_step2_title=Step Two - Configure Web Content Forms -create_website_step2_desc=Select and configure web forms for generating site content. +create_website_step3_title=Step Three - Configure Web Content Forms +create_website_step3_desc=Select and configure web forms for generating site content. website_select_form=Select Web Forms website_select_templates=Select Templates website_selected_templates=Selected Templates website_settings=Configure Workflow -create_website_step3_title=Step Three - Configure Workflow -create_website_step3_desc=Select and configure workflow for non-form generated assets. +create_website_step4_title=Step Four - Configure Workflow +create_website_step4_desc=Select and configure workflow for non-form generated assets. website_select_workflows=Select Workflows website_selected_workflows=Selected Workflows website_invite=Add Users -create_website_step4_title=Step Four - Add Users -create_website_step4_desc=Select users and their roles. +create_website_step5_title=Step Five - Add Users +create_website_step5_desc=Select users and their roles. website_notify=Email Users -create_website_step5_title=Step Five - Email Users -create_website_step5_desc=Notify the invited users. +create_website_step6_title=Step Six - Email Users +create_website_step6_desc=Notify the website users. create_website_finish_instruction=To close this wizard and create your web project space click Finish. To review or change your selections click Back. create_website_summary_users=Users and Roles edit_website_title=Edit Web Project Wizard diff --git a/config/alfresco/web-client-config-properties.xml b/config/alfresco/web-client-config-properties.xml index bc7d3b04f8..88e3ff0c32 100644 --- a/config/alfresco/web-client-config-properties.xml +++ b/config/alfresco/web-client-config-properties.xml @@ -596,7 +596,7 @@ - + diff --git a/config/alfresco/web-client-config-wizards.xml b/config/alfresco/web-client-config-wizards.xml index 5df9e0695f..e06dd3e495 100644 --- a/config/alfresco/web-client-config-wizards.xml +++ b/config/alfresco/web-client-config-wizards.xml @@ -16,30 +16,36 @@ description-id="create_website_step1_desc" instruction-id="default_instruction" /> - - + - - + - - + - - + + + + deployTo; + protected String createFrom = null; + protected String[] sourceWebProject = null; + protected ExpiringValueCache> webProjectsList; protected AVMService avmService; protected WorkflowService workflowService; @@ -101,6 +121,10 @@ public class CreateWebsiteWizard extends BaseWizardBean protected AVMLockingService avmLockingService; protected FormsService formsService; + /** set true when an option in the Create From screen is changed - this is used as an + indicator to reload the wizard data model from the selected source web project */ + private boolean createFromValueChanged; + /** datamodel for table of selected forms */ protected DataModel formsDataModel = null; @@ -144,6 +168,16 @@ public class CreateWebsiteWizard extends BaseWizardBean this.title = null; this.description = null; this.deployTo = null; + clearFormsWorkflowsAndUsers(); + this.createFrom = CREATE_EMPTY; + // requry existing web projects list every 10 seconds + this.webProjectsList = new ExpiringValueCache>(1000L*10L); + this.sourceWebProject = null; + this.createFromValueChanged = false; + } + + private void clearFormsWorkflowsAndUsers() + { this.formsDataModel = null; this.forms = new ArrayList(8); this.workflowsDataModel = null; @@ -200,15 +234,27 @@ public class CreateWebsiteWizard extends BaseWizardBean outcome = wiz.finish(); if (outcome != null) { + // if the user selected Create From existing web project we will branch from it + String branchStoreId = null; + if (CREATE_EXISTING.equals(this.createFrom) && + (this.sourceWebProject != null && this.sourceWebProject.length != 0)) + { + NodeRef sourceNodeRef = new NodeRef(this.sourceWebProject[0]); + branchStoreId = (String)this.nodeService.getProperty(sourceNodeRef, WCMAppModel.PROP_AVMSTORE); + } + // create the AVM staging store to represent the newly created location website - this.sandboxInfo = SandboxFactory.createStagingSandbox(avmStore, nodeRef); + this.sandboxInfo = SandboxFactory.createStagingSandbox(avmStore, nodeRef, branchStoreId); // create the default webapp folder under the hidden system folders - final String stagingStore = AVMUtil.buildStagingStoreName(avmStore); - final String stagingStoreRoot = AVMUtil.buildSandboxRootPath(stagingStore); - this.avmService.createDirectory(stagingStoreRoot, webapp); - this.avmService.addAspect(AVMNodeConverter.ExtendAVMPath(stagingStoreRoot, webapp), - WCMAppModel.ASPECT_WEBAPP); + if (branchStoreId == null) + { + final String stagingStore = AVMUtil.buildStagingStoreName(avmStore); + final String stagingStoreRoot = AVMUtil.buildSandboxRootPath(stagingStore); + this.avmService.createDirectory(stagingStoreRoot, webapp); + this.avmService.addAspect(AVMNodeConverter.ExtendAVMPath(stagingStoreRoot, webapp), + WCMAppModel.ASPECT_WEBAPP); + } // set the property on the node to reference the root AVM store this.nodeService.setProperty(nodeRef, WCMAppModel.PROP_AVMSTORE, avmStore); @@ -351,6 +397,132 @@ public class CreateWebsiteWizard extends BaseWizardBean } } + /** + * Restore the forms, templates and workflows from the model for a web project. Can also + * optional restore the basic node propetries and user details. + * + * @param nodeRef NodeRef to the web project to load model from + * @param loadProperties Load the basic properties such as name, title, DNS. + * @param loadUsers Load the user details. + */ + protected void loadWebProjectModel(NodeRef nodeRef, boolean loadProperties, boolean loadUsers) + { + // simple properties are optionally loaded + if (loadProperties) + { + Map props = this.nodeService.getProperties(nodeRef); + this.name = (String)props.get(ContentModel.PROP_NAME); + this.title = (String)props.get(ContentModel.PROP_TITLE); + this.description = (String)props.get(ContentModel.PROP_DESCRIPTION); + this.dnsName = (String)props.get(WCMAppModel.PROP_AVMSTORE); + this.webapp = (String)props.get(WCMAppModel.PROP_DEFAULTWEBAPP); + this.deployTo = (List)props.get(WCMAppModel.PROP_DEPLOYTO); + } + + if (loadUsers) + { + InviteWebsiteUsersWizard wiz = getInviteUsersWizard(); + wiz.reset(); + + // load the users assigned to the web project + List userInfoRefs = this.nodeService.getChildAssocs( + nodeRef, WCMAppModel.ASSOC_WEBUSER, RegexQNamePattern.MATCH_ALL); + for (ChildAssociationRef ref : userInfoRefs) + { + NodeRef userRef = ref.getChildRef(); + String username = (String)this.nodeService.getProperty(userRef, WCMAppModel.PROP_WEBUSERNAME); + String userrole = (String)this.nodeService.getProperty(userRef, WCMAppModel.PROP_WEBUSERROLE); + wiz.addAuthorityWithRole(username, userrole); + } + } + + // load the form templates + List webFormRefs = this.nodeService.getChildAssocs( + nodeRef, WCMAppModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL); + for (ChildAssociationRef ref : webFormRefs) + { + NodeRef formRef = ref.getChildRef(); + + String name = (String)this.nodeService.getProperty(formRef, WCMAppModel.PROP_FORMNAME); + try + { + Form formImpl = this.formsService.getForm(name); + FormWrapper form = new FormWrapper(formImpl); + form.setTitle((String)this.nodeService.getProperty(formRef, ContentModel.PROP_TITLE)); + form.setDescription((String)this.nodeService.getProperty(formRef, ContentModel.PROP_DESCRIPTION)); + form.setOutputPathPattern((String)this.nodeService.getProperty(formRef, WCMAppModel.PROP_OUTPUT_PATH_PATTERN)); + + // the single workflow attached to the form + List workflowRefs = this.nodeService.getChildAssocs( + formRef, WCMAppModel.ASSOC_WORKFLOWDEFAULTS, RegexQNamePattern.MATCH_ALL); + if (workflowRefs.size() == 1) + { + NodeRef wfRef = workflowRefs.get(0).getChildRef(); + String wfName = (String)this.nodeService.getProperty(wfRef, WCMAppModel.PROP_WORKFLOW_NAME); + WorkflowDefinition wfDef = this.workflowService.getDefinitionByName(wfName); + if (wfDef != null) + { + WorkflowWrapper wfWrapper = new WorkflowWrapper(wfName, wfDef.getTitle(), wfDef.getDescription()); + wfWrapper.setParams((Map)AVMWorkflowUtil.deserializeWorkflowParams(wfRef)); + if (wfDef.startTaskDefinition != null) + { + wfWrapper.setType(wfDef.startTaskDefinition.metadata.getName()); + } + form.setWorkflow(wfWrapper); + } + } + + // the templates attached to the form + List templateRefs = this.nodeService.getChildAssocs( + formRef, WCMAppModel.ASSOC_WEBFORMTEMPLATE, RegexQNamePattern.MATCH_ALL); + for (ChildAssociationRef tChildRef : templateRefs) + { + NodeRef templateRef = tChildRef.getChildRef(); + String renderingEngineTemplateName = (String)this.nodeService.getProperty( + templateRef, WCMAppModel.PROP_BASE_RENDERING_ENGINE_TEMPLATE_NAME); + RenderingEngineTemplate ret = formImpl.getRenderingEngineTemplate(renderingEngineTemplateName); + if (ret != null) + { + String outputPathPattern = (String)this.nodeService.getProperty( + templateRef, WCMAppModel.PROP_OUTPUT_PATH_PATTERN); + form.addTemplate(new PresentationTemplate(ret, outputPathPattern)); + } + } + + this.forms.add(form); + } + catch (FormNotFoundException fnfe) + { + // ignore as we cannot do anything about a missing form + if (logger.isDebugEnabled()) + logger.debug("Unable to find Web Form named '" + fnfe.getFormName() + + "' as referenced in web project: " + nodeRef.toString()); + } + } + + // load the workflows associated with the website + List workflowRefs = this.nodeService.getChildAssocs( + nodeRef, WCMAppModel.ASSOC_WEBWORKFLOWDEFAULTS, RegexQNamePattern.MATCH_ALL); + for (ChildAssociationRef wChildRef : workflowRefs) + { + NodeRef wfRef = wChildRef.getChildRef(); + String wfName = (String)this.nodeService.getProperty(wfRef, WCMAppModel.PROP_WORKFLOW_NAME); + WorkflowDefinition wfDef = this.workflowService.getDefinitionByName(wfName); + if (wfDef != null) + { + WorkflowWrapper wfWrapper = new WorkflowWrapper(wfName, wfDef.getTitle(), wfDef.getDescription()); + wfWrapper.setParams((Map)AVMWorkflowUtil.deserializeWorkflowParams(wfRef)); + wfWrapper.setFilenamePattern((String)this.nodeService.getProperty(wfRef, + WCMAppModel.PROP_FILENAMEPATTERN)); + if (wfDef.startTaskDefinition != null) + { + wfWrapper.setType(wfDef.startTaskDefinition.metadata.getName()); + } + this.workflows.add(wfWrapper); + } + } + } + // ------------------------------------------------------------------------------ // Service setters @@ -510,7 +682,120 @@ public class CreateWebsiteWizard extends BaseWizardBean { this.deployTo = deployTo; } + + /** + * @return the create from selection value + */ + public String getCreateFrom() + { + return this.createFrom; + } + /** + * @param createFrom the create from selection value + */ + public void setCreateFrom(String createFrom) + { + if (createFrom != null && createFrom.equals(this.createFrom) == false) + { + this.createFromValueChanged = true; + } + this.createFrom = createFrom; + } + + /** + * @return the existing Web Project to use + */ + public String[] getSourceWebProject() + { + return this.sourceWebProject; + } + + /** + * @param existingWebProject the existing Web Project to set + */ + public void setSourceWebProject(String[] existingWebProject) + { + if (this.sourceWebProject != null && this.sourceWebProject.length != 0) + { + if ((existingWebProject == null || existingWebProject.length == 0) || + (existingWebProject[0].equals(this.sourceWebProject[0]) == false)) + { + this.createFromValueChanged = true; + } + } + else + { + if (existingWebProject != null || existingWebProject.length != 0) + { + this.createFromValueChanged = true; + } + } + this.sourceWebProject = existingWebProject; + } + + /** + * @return name of the source web project selected - or null if none set + */ + public String getSourceWebProjectName() + { + String name = null; + if (CREATE_EXISTING.equals(this.createFrom) && + (this.sourceWebProject != null && this.sourceWebProject.length != 0)) + { + NodeRef sourceNodeRef = new NodeRef(this.sourceWebProject[0]); + name = (String)this.nodeService.getProperty(sourceNodeRef, ContentModel.PROP_NAME); + } + return name; + } + + /** + * @return the existingWebProjects + */ + public List getWebProjectsList() + { + List webProjects = this.webProjectsList.get(); + if (webProjects == null) + { + FacesContext fc = FacesContext.getCurrentInstance(); + + // construct the query to retrieve all web projects + String path = Application.getRootPath(fc) + "/" + Application.getWebsitesFolderName(fc) + "/*"; + String query = "PATH:\"/" + path + "\" +TYPE:\"{" + NamespaceService.WCMAPP_MODEL_1_0_URI + "}webfolder\""; + + ResultSet results = null; + try + { + // execute the query + results = searchService.query(Repository.getStoreRef(), + SearchService.LANGUAGE_LUCENE, query); + webProjects = new ArrayList(results.length()); + for (ResultSetRow row : results) + { + NodeRef ref = row.getNodeRef(); + String name = (String)this.nodeService.getProperty(ref, ContentModel.PROP_NAME); + String desc = (String)this.nodeService.getProperty(ref, ContentModel.PROP_DESCRIPTION); + UIListItem item = new UIListItem(); + item.setLabel(name); + item.setDescription(desc); + item.setValue(ref.toString()); + item.setImage(WebResources.IMAGE_WEBPROJECT_32); + webProjects.add(item); + } + } + finally + { + if (results != null) + { + results.close(); + } + } + + this.webProjectsList.put(webProjects); + } + return webProjects; + } + /** * @return the deploy to help text that gets displayed if the user * clicks the Help icon @@ -518,12 +803,44 @@ public class CreateWebsiteWizard extends BaseWizardBean public String getDeployToHelp() { String pattern = Application.getMessage(FacesContext.getCurrentInstance(), - "deploy_to_help"); + MSG_DEPLOY_TO_HELP); String defaultAlfPort = Integer.toString(AVMUtil.getRemoteRMIRegistryPort()); String defaultReceiverPort = Integer.toString(AVMUtil.getRemoteReceiverRMIPort()); return MessageFormat.format(pattern, new Object[] {defaultReceiverPort, defaultAlfPort}); } + /** + * @see org.alfresco.web.bean.wizard.BaseWizardBean#next() + */ + @Override + public String next() + { + String stepName = Application.getWizardManager().getCurrentStepName(); + if (STEP_FORMS.equals(stepName)) + { + // if we have just entered the Forms page and the Create From page data has changed + // then we need to pre-populate the Forms etc. from the template web project + if (this.createFromValueChanged) + { + if (CREATE_EXISTING.equals(this.createFrom)) + { + if (this.sourceWebProject != null && this.sourceWebProject.length != 0) + { + clearFormsWorkflowsAndUsers(); + loadWebProjectModel(new NodeRef(this.sourceWebProject[0]), false, true); + } + } + else + { + clearFormsWorkflowsAndUsers(); + } + + this.createFromValueChanged = false; + } + } + return super.next(); + } + /** * @return summary text for the wizard */ @@ -822,10 +1139,6 @@ public class CreateWebsiteWizard extends BaseWizardBean } - // ------------------------------------------------------------------------------ - // Helper methods - - // ------------------------------------------------------------------------------ // Inner classes diff --git a/source/java/org/alfresco/web/bean/wcm/EditWebsiteWizard.java b/source/java/org/alfresco/web/bean/wcm/EditWebsiteWizard.java index 6eafc2032f..60ab07d429 100644 --- a/source/java/org/alfresco/web/bean/wcm/EditWebsiteWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/EditWebsiteWizard.java @@ -34,14 +34,8 @@ import org.alfresco.model.ContentModel; import org.alfresco.model.WCMAppModel; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; -import org.alfresco.service.cmr.workflow.WorkflowDefinition; -import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.RegexQNamePattern; import org.alfresco.web.app.AlfrescoNavigationHandler; -import org.alfresco.web.forms.Form; -import org.alfresco.web.forms.FormNotFoundException; -import org.alfresco.web.forms.FormsService; -import org.alfresco.web.forms.RenderingEngineTemplate; /** * Backing bean for the Edit Web Project wizard. @@ -69,109 +63,7 @@ public class EditWebsiteWizard extends CreateWebsiteWizard throw new IllegalArgumentException("Edit Web Project wizard requires action node context."); } - loadWebProjectModel(websiteRef); - } - - /** - * Restore the forms, templates and workflows from the model for this web project - * - * @param nodeRef NodeRef to the web project - */ - private void loadWebProjectModel(NodeRef nodeRef) - { - // simple properties - Map props = this.nodeService.getProperties(nodeRef); - this.name = (String)props.get(ContentModel.PROP_NAME); - this.title = (String)props.get(ContentModel.PROP_TITLE); - this.description = (String)props.get(ContentModel.PROP_DESCRIPTION); - this.dnsName = (String)props.get(WCMAppModel.PROP_AVMSTORE); - this.webapp = (String)props.get(WCMAppModel.PROP_DEFAULTWEBAPP); - this.deployTo = (List)props.get(WCMAppModel.PROP_DEPLOYTO); - - // load the form templates - List webFormRefs = this.nodeService.getChildAssocs( - nodeRef, WCMAppModel.ASSOC_WEBFORM, RegexQNamePattern.MATCH_ALL); - for (ChildAssociationRef ref : webFormRefs) - { - NodeRef formRef = ref.getChildRef(); - - String name = (String)this.nodeService.getProperty(formRef, WCMAppModel.PROP_FORMNAME); - try - { - final Form formImpl = this.formsService.getForm(name); - FormWrapper form = new FormWrapper(formImpl); - form.setTitle((String)this.nodeService.getProperty(formRef, ContentModel.PROP_TITLE)); - form.setDescription((String)this.nodeService.getProperty(formRef, ContentModel.PROP_DESCRIPTION)); - form.setOutputPathPattern((String)this.nodeService.getProperty(formRef, WCMAppModel.PROP_OUTPUT_PATH_PATTERN)); - - // the single workflow attached to the form - List workflowRefs = this.nodeService.getChildAssocs( - formRef, WCMAppModel.ASSOC_WORKFLOWDEFAULTS, RegexQNamePattern.MATCH_ALL); - if (workflowRefs.size() == 1) - { - NodeRef wfRef = workflowRefs.get(0).getChildRef(); - String wfName = (String)this.nodeService.getProperty(wfRef, WCMAppModel.PROP_WORKFLOW_NAME); - WorkflowDefinition wfDef = this.workflowService.getDefinitionByName(wfName); - if (wfDef != null) - { - WorkflowWrapper wfWrapper = new WorkflowWrapper(wfName, wfDef.getTitle(), wfDef.getDescription()); - wfWrapper.setParams((Map)AVMWorkflowUtil.deserializeWorkflowParams(wfRef)); - if (wfDef.startTaskDefinition != null) - { - wfWrapper.setType(wfDef.startTaskDefinition.metadata.getName()); - } - form.setWorkflow(wfWrapper); - } - } - - // the templates attached to the form - List templateRefs = this.nodeService.getChildAssocs( - formRef, WCMAppModel.ASSOC_WEBFORMTEMPLATE, RegexQNamePattern.MATCH_ALL); - for (ChildAssociationRef tChildRef : templateRefs) - { - final NodeRef templateRef = tChildRef.getChildRef(); - final String renderingEngineTemplateName = (String) - this.nodeService.getProperty(templateRef, - WCMAppModel.PROP_BASE_RENDERING_ENGINE_TEMPLATE_NAME); - final RenderingEngineTemplate ret = formImpl.getRenderingEngineTemplate(renderingEngineTemplateName); - if (ret != null) - { - final String outputPathPattern = (String) - this.nodeService.getProperty(templateRef, WCMAppModel.PROP_OUTPUT_PATH_PATTERN); - form.addTemplate(new PresentationTemplate(ret, outputPathPattern)); - } - } - - this.forms.add(form); - } - catch (FormNotFoundException fnfe) - { - //ignore - logger.debug(fnfe.getMessage(), fnfe); - } - } - - // load the workflows associated with the website - List workflowRefs = this.nodeService.getChildAssocs( - nodeRef, WCMAppModel.ASSOC_WEBWORKFLOWDEFAULTS, RegexQNamePattern.MATCH_ALL); - for (ChildAssociationRef wChildRef : workflowRefs) - { - NodeRef wfRef = wChildRef.getChildRef(); - String wfName = (String)this.nodeService.getProperty(wfRef, WCMAppModel.PROP_WORKFLOW_NAME); - WorkflowDefinition wfDef = this.workflowService.getDefinitionByName(wfName); - if (wfDef != null) - { - WorkflowWrapper wfWrapper = new WorkflowWrapper(wfName, wfDef.getTitle(), wfDef.getDescription()); - wfWrapper.setParams((Map)AVMWorkflowUtil.deserializeWorkflowParams(wfRef)); - wfWrapper.setFilenamePattern((String)this.nodeService.getProperty(wfRef, - WCMAppModel.PROP_FILENAMEPATTERN)); - if (wfDef.startTaskDefinition != null) - { - wfWrapper.setType(wfDef.startTaskDefinition.metadata.getName()); - } - this.workflows.add(wfWrapper); - } - } + loadWebProjectModel(websiteRef, true, false); } /** diff --git a/source/java/org/alfresco/web/bean/wcm/SandboxFactory.java b/source/java/org/alfresco/web/bean/wcm/SandboxFactory.java index 0faad0bcc5..38ac6053b4 100644 --- a/source/java/org/alfresco/web/bean/wcm/SandboxFactory.java +++ b/source/java/org/alfresco/web/bean/wcm/SandboxFactory.java @@ -73,31 +73,44 @@ public final class SandboxFactory * DNS: .dns. = * Website Name: .website.name = website name * - * @param storeId The store name to create the sandbox for + * @param storeId The store name to create the sandbox for. * @param webProjectNodeRef The noderef for the webproject. + * @param branchStoreId The ID of the store to branch this staging store from. */ - public static SandboxInfo createStagingSandbox(final String storeId, - final NodeRef webProjectNodeRef) + public static SandboxInfo createStagingSandbox(String storeId, + NodeRef webProjectNodeRef, + String branchStoreId) { - final ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance()); - final AVMService avmService = services.getAVMService(); - final PermissionService permissionService = services.getPermissionService(); + ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance()); + AVMService avmService = services.getAVMService(); + PermissionService permissionService = services.getPermissionService(); // create the 'staging' store for the website - final String stagingStoreName = AVMUtil.buildStagingStoreName(storeId); + String stagingStoreName = AVMUtil.buildStagingStoreName(storeId); avmService.createStore(stagingStoreName); if (logger.isDebugEnabled()) logger.debug("Created staging sandbox store: " + stagingStoreName); - // create the system directories 'www' and 'avm_webapps' - avmService.createDirectory(stagingStoreName + ":/", JNDIConstants.DIR_DEFAULT_WWW); + // we can either branch from an existing staging store or create a new structure + if (branchStoreId != null) + { + String branchStorePath = AVMUtil.buildStagingStoreName(branchStoreId) + ":/" + + JNDIConstants.DIR_DEFAULT_WWW; + avmService.createBranch(-1, branchStorePath, + stagingStoreName + ":/", JNDIConstants.DIR_DEFAULT_WWW); + } + else + { + // create the system directories 'www' and 'avm_webapps' + avmService.createDirectory(stagingStoreName + ":/", JNDIConstants.DIR_DEFAULT_WWW); + avmService.createDirectory(AVMUtil.buildStoreRootPath(stagingStoreName), + JNDIConstants.DIR_DEFAULT_APPBASE); + } + // apply READ permissions for all users NodeRef dirRef = AVMNodeConverter.ToNodeRef(-1, AVMUtil.buildStoreRootPath(stagingStoreName)); permissionService.setPermission(dirRef, PermissionService.ALL_AUTHORITIES, PermissionService.READ, true); - avmService.createDirectory(AVMUtil.buildStoreRootPath(stagingStoreName), - JNDIConstants.DIR_DEFAULT_APPBASE); - // tag the store with the store type avmService.setStoreProperty(stagingStoreName, SandboxConstants.PROP_SANDBOX_STAGING_MAIN, @@ -114,7 +127,7 @@ public final class SandboxFactory // create the 'preview' store for the website - final String previewStoreName = AVMUtil.buildStagingPreviewStoreName(storeId); + String previewStoreName = AVMUtil.buildStagingPreviewStoreName(storeId); avmService.createStore(previewStoreName); if (logger.isDebugEnabled()) logger.debug("Created staging preview sandbox store: " + previewStoreName + @@ -180,18 +193,18 @@ public final class SandboxFactory * @param role Role permission for the user * @return Summary information regarding the sandbox */ - public static SandboxInfo createUserSandbox(final String storeId, - final List managers, - final String username, - final String role) + public static SandboxInfo createUserSandbox(String storeId, + List managers, + String username, + String role) { - final ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance()); - final AVMService avmService = services.getAVMService(); - final PermissionService permissionService = services.getPermissionService(); + ServiceRegistry services = Repository.getServiceRegistry(FacesContext.getCurrentInstance()); + AVMService avmService = services.getAVMService(); + PermissionService permissionService = services.getPermissionService(); // create the user 'main' store - final String userStoreName = AVMUtil.buildUserMainStoreName(storeId, username); - final String previewStoreName = AVMUtil.buildUserPreviewStoreName(storeId, username); + String userStoreName = AVMUtil.buildUserMainStoreName(storeId, username); + String previewStoreName = AVMUtil.buildUserPreviewStoreName(storeId, username); if (avmService.getStore(userStoreName) != null) { @@ -203,7 +216,7 @@ public final class SandboxFactory } avmService.createStore(userStoreName); - final String stagingStoreName = AVMUtil.buildStagingStoreName(storeId); + String stagingStoreName = AVMUtil.buildStagingStoreName(storeId); if (logger.isDebugEnabled()) logger.debug("Created user sandbox store: " + userStoreName + " above staging store " + stagingStoreName); diff --git a/source/java/org/alfresco/web/bean/wizard/InviteUsersWizard.java b/source/java/org/alfresco/web/bean/wizard/InviteUsersWizard.java index b556e5d5ae..dcfeaced31 100644 --- a/source/java/org/alfresco/web/bean/wizard/InviteUsersWizard.java +++ b/source/java/org/alfresco/web/bean/wizard/InviteUsersWizard.java @@ -370,52 +370,60 @@ public abstract class InviteUsersWizard extends BaseWizardBean if (results != null) { String role = (String)rolePicker.getValue(); - if (role != null) { for (int i=0; i +<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> +<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %> +<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %> + + + + + + + +
+ + + +
+
+
\ No newline at end of file diff --git a/source/web/jsp/wcm/create-website-wizard/details.jsp b/source/web/jsp/wcm/create-website-wizard/details.jsp index 9a8faae7ec..1e6659ddc5 100644 --- a/source/web/jsp/wcm/create-website-wizard/details.jsp +++ b/source/web/jsp/wcm/create-website-wizard/details.jsp @@ -160,7 +160,7 @@ value="/images/icons/Help_icon.gif" style="cursor:help; padding-left: 4px; vertical-align: -4px;" onclick="javascript:toggleDeployToHelp()" /> -