diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties
index 5c982617e3..0ba26b7851 100644
--- a/config/alfresco/messages/webclient.properties
+++ b/config/alfresco/messages/webclient.properties
@@ -790,6 +790,12 @@ create_website_desc=This wizard helps you create a new website space.
website_details=Website Details
create_website_step1_title=Step One - Website Details
create_website_step1_desc=Enter the information about the website.
+website_invite=Invite Users
+create_website_step2_title=Step Two - Invite Users
+create_website_step2_desc=Select users and their roles.
+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.
# Browse Website and Sandboxes messages
diff --git a/config/alfresco/web-client-config-wizards.xml b/config/alfresco/web-client-config-wizards.xml
index 895906a68e..a0c4abd52e 100644
--- a/config/alfresco/web-client-config-wizards.xml
+++ b/config/alfresco/web-client-config-wizards.xml
@@ -15,6 +15,18 @@
description-id="create_website_step1_desc"
instruction-id="default_instruction" />
+
+
+
+
+
+
");
diff --git a/source/java/org/alfresco/web/bean/wcm/AVMNode.java b/source/java/org/alfresco/web/bean/wcm/AVMNode.java
index c2bd838166..3b0ca41a20 100644
--- a/source/java/org/alfresco/web/bean/wcm/AVMNode.java
+++ b/source/java/org/alfresco/web/bean/wcm/AVMNode.java
@@ -49,7 +49,7 @@ public class AVMNode implements Map
public AVMNode(AVMNodeDescriptor avmRef)
{
this.avmRef = avmRef;
- this.version = -1; // TODO: always 1 for now...
+ this.version = -1; // TODO: always -1 for now...
this.path = avmRef.getPath();
getProperties();
diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java
index 5e1b307f50..46b844ae90 100644
--- a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java
+++ b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java
@@ -36,9 +36,13 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.GUID;
+import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application;
+import org.alfresco.web.app.servlet.FacesHelper;
+import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wizard.BaseWizardBean;
+import org.alfresco.web.bean.wizard.InviteUsersWizard.UserGroupRole;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -71,6 +75,11 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.name = null;
this.title = null;
this.description = null;
+
+ // init the dependant bean we are using for the invite users pages
+ InviteWebsiteUsersWizard wiz = (InviteWebsiteUsersWizard)FacesHelper.getManagedBean(
+ FacesContext.getCurrentInstance(), "InviteWebsiteUsersWizard");
+ wiz.init();
}
/**
@@ -97,29 +106,41 @@ public class CreateWebsiteWizard extends BaseWizardBean
uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, this.description);
this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_UIFACETS, uiFacetsProps);
- // TODO: invite users with appropriate permissions into this folder
-
- // create the AVM stores (layers) to represent the newly created location website
- createStagingSandbox(this.name);
-
- // create a sandbox for each user - TODO: based on role?
- List invitedUsers = getInvitedUsernames();
- invitedUsers.add(Application.getCurrentUser(context).getUserName());
- for (String username : invitedUsers)
- {
- createUserSandbox(this.name, username);
+ // invite users with appropriate permissions into this folder
+ InviteWebsiteUsersWizard wiz = (InviteWebsiteUsersWizard)FacesHelper.getManagedBean(
+ FacesContext.getCurrentInstance(), "InviteWebsiteUsersWizard");
+ wiz.setNode(new Node(nodeRef));
+ outcome = wiz.finish();
+ if (outcome != null)
+ {
+ // create the AVM stores (layers) to represent the newly created location website
+ createStagingSandbox(this.name);
+
+ // create a sandbox for each user
+ // TODO: create sandbox appropriately based on role
+ List invitedUsers = getInvitedUsernames(wiz);
+ String currentUser = Application.getCurrentUser(context).getUserName();
+ if (invitedUsers.contains(currentUser) == false)
+ {
+ invitedUsers.add(Application.getCurrentUser(context).getUserName());
+ }
+ for (String username : invitedUsers)
+ {
+ createUserSandbox(this.name, username);
+ }
+
+ // save the list of invited users against the store
+ this.nodeService.setProperty(nodeRef, ContentModel.PROP_USERSANDBOXES, (Serializable)invitedUsers);
+
+ // set the property on the node to reference the AVM store
+ this.nodeService.setProperty(nodeRef, ContentModel.PROP_AVMSTORE, this.name);
+
+ // navigate to the Websites folder so we can see the newly created folder
+ this.navigator.setCurrentNodeId(websiteParentId);
+
+ outcome = AlfrescoNavigationHandler.CLOSE_WIZARD_OUTCOME;
}
-
- // save the list of invited users against the store
- this.nodeService.setProperty(nodeRef, ContentModel.PROP_USERSANDBOXES, (Serializable)invitedUsers);
-
- // set the property on the node to reference the AVM store
- this.nodeService.setProperty(nodeRef, ContentModel.PROP_AVMSTORE, this.name);
-
- // navigate to the Websites folder so we can see the newly created folder
- this.navigator.setCurrentNodeId(websiteParentId);
-
- return "browse";
+ return outcome;
}
/**
@@ -303,6 +324,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
* Identifier for store-types: .sandbox.author.main and .sandbox.author.preview
* Store-id: .sandbox-id. (unique across all stores in the sandbox)
* DNS: .dns. =
+ * Website Name: .website.name = website name
*
* @param name The store name to create the sandbox for
* @param username Username of the user to create the sandbox for
@@ -381,9 +403,15 @@ public class CreateWebsiteWizard extends BaseWizardBean
/**
* @return The list of invited usernames
*/
- private List getInvitedUsernames()
+ private List getInvitedUsernames(InviteWebsiteUsersWizard wizard)
{
- // TODO: add the list of invited users here
- return new ArrayList(1);
+ // add the list of invited users here
+ List users = (List)wizard.getUserRolesDataModel().getWrappedData();
+ List invited = new ArrayList(users.size());
+ for (UserGroupRole u : users)
+ {
+ invited.add(u.getAuthority());
+ }
+ return invited;
}
}
diff --git a/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java b/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java
new file mode 100644
index 0000000000..076460dc13
--- /dev/null
+++ b/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java
@@ -0,0 +1,72 @@
+package org.alfresco.web.bean.wcm;
+
+import java.util.Set;
+
+import javax.faces.context.FacesContext;
+
+import org.alfresco.model.ContentModel;
+import org.alfresco.web.app.Application;
+import org.alfresco.web.bean.repository.Node;
+import org.alfresco.web.bean.wizard.InviteUsersWizard;
+
+/**
+ * Concrete implementation providing the ability to invite users to a space.
+ *
+ * @author gavinc
+ */
+public class InviteWebsiteUsersWizard extends InviteUsersWizard
+{
+ private static final String WIZARD_TITLE_ID = "invite_title";
+ private static final String WIZARD_DESC_ID = "invite_desc";
+ private static final String STEP1_DESCRIPTION_ID = "invite_step1_desc";
+
+ /** Cache of available folder permissions */
+ Set folderPermissions = null;
+
+ private Node website;
+
+ /**
+ * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getWizardDescription()
+ */
+ public String getWizardDescription()
+ {
+ return Application.getMessage(FacesContext.getCurrentInstance(), WIZARD_DESC_ID);
+ }
+
+ /**
+ * @see org.alfresco.web.bean.wizard.AbstractWizardBean#getWizardTitle()
+ */
+ public String getWizardTitle()
+ {
+ return Application.getMessage(FacesContext.getCurrentInstance(), WIZARD_TITLE_ID);
+ }
+
+ @Override
+ protected String getStep1DescriptionText()
+ {
+ return STEP1_DESCRIPTION_ID;
+ }
+
+ @Override
+ protected Set getPermissionsForType()
+ {
+ if (this.folderPermissions == null)
+ {
+ // TODO: get permissions for a website folder type
+ this.folderPermissions = this.permissionService.getSettablePermissions(ContentModel.TYPE_FOLDER);
+ }
+
+ return this.folderPermissions;
+ }
+
+ protected void setNode(Node node)
+ {
+ this.website = node;
+ }
+
+ @Override
+ protected Node getNode()
+ {
+ return this.website;
+ }
+}
diff --git a/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java b/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java
index 302944f17a..a096f306ce 100644
--- a/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java
+++ b/source/java/org/alfresco/web/ui/wcm/component/UIUserSandboxes.java
@@ -303,6 +303,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
String stagingStore = AVMConstants.buildAVMStagingStoreName(storeRoot) + ":/";
// get the UIActions component responsible for rendering context related user actions
+ // TODO: we may need a component per user instance
UIActions uiFileActions = aquireUIActions(ACTIONS_FILE);
UIActions uiFolderActions = aquireUIActions(ACTIONS_FOLDER);
@@ -504,7 +505,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
private UIActionLink aquireAction(FacesContext fc, String store, String username,
String name, String icon, String actionListener, String outcome)
{
- UIActionLink action = findAction(name);
+ UIActionLink action = findAction(name, username);
if (action == null)
{
action = createAction(fc, store, username, name, icon, actionListener, outcome);
@@ -515,14 +516,15 @@ public class UIUserSandboxes extends SelfRenderingComponent
/**
* Locate a child UIActionLink component by name.
*
- * @param name Of the action component to find
+ * @param name Of the action component to find
+ * @param username Username of the user owner of the action
*
* @return UIActionLink component if found, else null if not created yet
*/
- private UIActionLink findAction(String name)
+ private UIActionLink findAction(String name, String username)
{
UIActionLink action = null;
- String actionId = getId() + name;
+ String actionId = getId() + name + username;
for (UIComponent component : (List)getChildren())
{
if (actionId.equals(component.getId()))
@@ -554,7 +556,7 @@ public class UIUserSandboxes extends SelfRenderingComponent
UIActionLink control = (UIActionLink)facesApp.createComponent(UIActions.COMPONENT_ACTIONLINK);
control.setRendererType(UIActions.RENDERER_ACTIONLINK);
- control.setId(getId() + name);
+ control.setId(getId() + name + username);
control.setValue(Application.getMessage(fc, name));
control.setShowLink(false);
control.setImage(icon);
diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml
index 031a8ecf51..7323c2660a 100644
--- a/source/web/WEB-INF/faces-config-beans.xml
+++ b/source/web/WEB-INF/faces-config-beans.xml
@@ -633,6 +633,51 @@
+
+
+ The bean that backs up the Invite Users Wizard a website
+
+ InviteWebsiteUsersWizard
+ org.alfresco.web.bean.wcm.InviteWebsiteUsersWizard
+ session
+
+ nodeService
+ #{NodeService}
+
+
+ searchService
+ #{SearchService}
+
+
+ namespaceService
+ #{NamespaceService}
+
+
+ permissionService
+ #{PermissionService}
+
+
+ personService
+ #{PersonService}
+
+
+ navigator
+ #{NavigationBean}
+
+
+ browseBean
+ #{BrowseBean}
+
+
+ mailSender
+ #{mailService}
+
+
+ authorityService
+ #{AuthorityService}
+
+
+
The bean that backs up the website file/folder browsing screens
diff --git a/source/web/jsp/wcm/create-website-wizard/invite.jsp b/source/web/jsp/wcm/create-website-wizard/invite.jsp
new file mode 100644
index 0000000000..a4dbb3987e
--- /dev/null
+++ b/source/web/jsp/wcm/create-website-wizard/invite.jsp
@@ -0,0 +1,62 @@
+<%--
+Copyright (C) 2006 Alfresco, Inc.
+
+Licensed under the Mozilla Public License version 1.1
+with a permitted attribution clause. You may obtain a
+copy of the License at
+
+http://www.alfresco.org/legal/license.txt
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+either express or implied. See the License for the specific
+language governing permissions and limitations under the
+License.
+--%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
+<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
+
+<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
+<%@ page isELIgnored="false" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/web/jsp/wcm/create-website-wizard/notify.jsp b/source/web/jsp/wcm/create-website-wizard/notify.jsp
new file mode 100644
index 0000000000..5f706bd515
--- /dev/null
+++ b/source/web/jsp/wcm/create-website-wizard/notify.jsp
@@ -0,0 +1,75 @@
+<%--
+ Copyright (C) 2005 Alfresco, Inc.
+
+ Licensed under the Mozilla Public License version 1.1
+ with a permitted attribution clause. You may obtain a
+ copy of the License at
+
+ http://www.alfresco.org/legal/license.txt
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ either express or implied. See the License for the specific
+ language governing permissions and limitations under the
+ License.
+--%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
+<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
+
+<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
+<%@ page isELIgnored="false" %>
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+