diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 8425143079..2885ae5157 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -803,6 +803,12 @@ website_notify=Email Users create_website_step3_title=Step Three - Notify Users create_website_step3_desc=Notify the invited users. create_website_finish_instruction=To close this wizard and create your website space click Finish. To review or change your selections click Back. +create_website_summary_users=Users and Roles + +# Delete Website Dialog messages +delete_website=Delete Website +delete_website_info=To remove this website and all associated user sandboxes, click OK. +delete_website_confirm=Are you sure you want to delete the website \"{0}\" and all associated user sandboxes? # Browse Website and Sandboxes messages title_browse_website=Browse Website diff --git a/config/alfresco/web-client-config-dialogs.xml b/config/alfresco/web-client-config-dialogs.xml index 4374894265..318351342c 100644 --- a/config/alfresco/web-client-config-dialogs.xml +++ b/config/alfresco/web-client-config-dialogs.xml @@ -179,4 +179,12 @@ description-id="delete_post_info" /> + + + + + + diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java index 61054340fd..18b8ab7543 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java @@ -33,6 +33,7 @@ import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.dictionary.DataTypeDefinition; import org.alfresco.service.cmr.model.FileInfo; import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.security.PermissionService; import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.QName; import org.alfresco.util.GUID; @@ -51,6 +52,10 @@ import org.apache.commons.logging.LogFactory; */ public class CreateWebsiteWizard extends BaseWizardBean { + private static final String MSG_DESCRIPTION = "description"; + private static final String MSG_NAME = "name"; + private static final String MSG_USERROLES = "create_website_summary_users"; + private static final String ROLE_CONTENT_MANAGER = "ContentManager"; private static Log logger = LogFactory.getLog(CreateWebsiteWizard.class); @@ -79,8 +84,7 @@ public class CreateWebsiteWizard extends BaseWizardBean this.description = null; // init the dependant bean we are using for the invite users pages - InviteWebsiteUsersWizard wiz = (InviteWebsiteUsersWizard)FacesHelper.getManagedBean( - FacesContext.getCurrentInstance(), "InviteWebsiteUsersWizard"); + InviteWebsiteUsersWizard wiz = getInviteUsersWizard(); wiz.init(); } @@ -108,9 +112,7 @@ public class CreateWebsiteWizard extends BaseWizardBean uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, this.description); this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, uiFacetsProps); - // invite users with appropriate permissions into this folder - InviteWebsiteUsersWizard wiz = (InviteWebsiteUsersWizard)FacesHelper.getManagedBean( - FacesContext.getCurrentInstance(), "InviteWebsiteUsersWizard"); + InviteWebsiteUsersWizard wiz = getInviteUsersWizard(); wiz.setNode(new Node(nodeRef)); outcome = wiz.finish(); if (outcome != null) @@ -222,15 +224,46 @@ public class CreateWebsiteWizard extends BaseWizardBean */ public String getSummary() { - ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance()); + FacesContext fc = FacesContext.getCurrentInstance(); + ResourceBundle bundle = Application.getBundle(fc); + + // build a summary section to list the invited users and there roles + StringBuilder buf = new StringBuilder(128); + List invitedUserRoles = + (List)getInviteUsersWizard().getUserRolesDataModel().getWrappedData(); + String currentUser = Application.getCurrentUser(fc).getUserName(); + boolean foundCurrentUser = false; + for (UserGroupRole userRole : invitedUserRoles) + { + if (currentUser.equals(userRole.getAuthority())) + { + foundCurrentUser = true; + } + buf.append(userRole.getLabel()); + buf.append("
"); + } + if (foundCurrentUser == false) + { + buf.append(getInviteUsersWizard().buildLabelForUserAuthorityRole(currentUser, ROLE_CONTENT_MANAGER)); + } return buildSummary( - new String[] {bundle.getString("name"), - bundle.getString("description")}, - new String[] {this.name, this.description}); + new String[] {bundle.getString(MSG_NAME), + bundle.getString(MSG_DESCRIPTION), + bundle.getString(MSG_USERROLES)}, + new String[] {this.name, this.description, buf.toString()}); } + /** + * @return the InviteWebsiteUsersWizard delegate bean + */ + private InviteWebsiteUsersWizard getInviteUsersWizard() + { + return (InviteWebsiteUsersWizard)FacesHelper.getManagedBean( + FacesContext.getCurrentInstance(), "InviteWebsiteUsersWizard"); + } + /** * Helper to get the ID of the 'Websites' system folder * @@ -286,11 +319,11 @@ public class CreateWebsiteWizard extends BaseWizardBean // create the system directories 'appBase' and 'avm_webapps' String path = stagingStore + ":/"; - //this.avmService.createDirectory(path, AVMConstants.DIR_APPBASE); - this.fileFolderService.create(AVMNodeConverter.ToNodeRef(-1, path), AVMConstants.DIR_APPBASE, ContentModel.TYPE_AVM_PLAIN_FOLDER); + this.avmService.createDirectory(path, AVMConstants.DIR_APPBASE); + //this.fileFolderService.create(AVMNodeConverter.ToNodeRef(-1, path), AVMConstants.DIR_APPBASE, ContentModel.TYPE_AVM_PLAIN_FOLDER); path += AVMConstants.DIR_APPBASE; - //this.avmService.createDirectory(path, AVMConstants.DIR_WEBAPPS); - this.fileFolderService.create(AVMNodeConverter.ToNodeRef(-1, path), AVMConstants.DIR_WEBAPPS, ContentModel.TYPE_AVM_PLAIN_FOLDER); + this.avmService.createDirectory(path, AVMConstants.DIR_WEBAPPS); + //this.fileFolderService.create(AVMNodeConverter.ToNodeRef(-1, path), AVMConstants.DIR_WEBAPPS, ContentModel.TYPE_AVM_PLAIN_FOLDER); // tag the store with the store type this.avmService.setStoreProperty(stagingStore, diff --git a/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java b/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java index 3250a13e8e..b061bb26ab 100644 --- a/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/EditFilePropertiesDialog.java @@ -81,7 +81,7 @@ public class EditFilePropertiesDialog extends EditContentPropertiesDialog return new Node(this.avmBrowseBean.getAvmNode().getNodeRef()); } -@Override + @Override protected String finishImpl(FacesContext context, String outcome) throws Exception { diff --git a/source/java/org/alfresco/web/bean/wizard/BaseWizardBean.java b/source/java/org/alfresco/web/bean/wizard/BaseWizardBean.java index 8d1a1e914f..fa9933e2c5 100644 --- a/source/java/org/alfresco/web/bean/wizard/BaseWizardBean.java +++ b/source/java/org/alfresco/web/bean/wizard/BaseWizardBean.java @@ -63,7 +63,7 @@ public abstract class BaseWizardBean extends BaseDialogBean implements IWizardBe String msg = Application.getMessage(FacesContext.getCurrentInstance(), MSG_NOT_SET); String notSetMsg = "<" + msg + ">"; - StringBuilder buf = new StringBuilder(256); + StringBuilder buf = new StringBuilder(512); buf.append(""); for (int i=0; i + + + The bean that backs up the Delete Website Space Dialog + + DeleteWebsiteDialog + org.alfresco.web.bean.wcm.DeleteWebsiteDialog + session + + avmService + #{AVMService} + + + navigator + #{NavigationBean} + + + nodeService + #{NodeService} + + + browseBean + #{BrowseBean} + + + dictionaryService + #{DictionaryService} + + +