diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 14e2fb9638..c046396117 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -1816,7 +1816,7 @@ click_to_edit=click to edit # File Picker go_up=Go up -#Category browsing +# Category browsing category_browser_plugin_label=Categories category_browser_plugin_description=Category Browsing category_browser_plugin_include_subcategories=Browse items in sub-categories? @@ -1831,4 +1831,7 @@ title_project=Project Space project_info=This view allows you to see the summary of the Project. title_project_details=Project Space Details modify_project_properties=Modify Project Space Properties -edit_project_description=Modify the Project space properties then click OK. \ No newline at end of file +edit_project_description=Modify the Project space properties then click OK. +create_project_title=Create Project Collaboration Space +create_project_desc=This wizard helps you create a new space for Project Collaboration +create_project=Create Project \ No newline at end of file diff --git a/config/alfresco/web-client-config-actions.xml b/config/alfresco/web-client-config-actions.xml index 8d95d12fe0..13305c0d17 100644 --- a/config/alfresco/web-client-config-actions.xml +++ b/config/alfresco/web-client-config-actions.xml @@ -340,8 +340,7 @@ - - + CreateChildren @@ -446,6 +445,14 @@ /images/icons/create_website.gif wizard:createWebsite + + + + org.alfresco.web.action.evaluator.CreateProjectEvaluator + create_project + /images/icons/create_project.gif + dialog:createProject + @@ -823,6 +830,7 @@ + diff --git a/config/alfresco/web-client-config-dialogs.xml b/config/alfresco/web-client-config-dialogs.xml index f090fb4f26..eff5b7612b 100644 --- a/config/alfresco/web-client-config-dialogs.xml +++ b/config/alfresco/web-client-config-dialogs.xml @@ -448,6 +448,10 @@ + + diff --git a/config/alfresco/web-client-config.xml b/config/alfresco/web-client-config.xml index 7d0727eb62..a9a0dfdaab 100644 --- a/config/alfresco/web-client-config.xml +++ b/config/alfresco/web-client-config.xml @@ -286,7 +286,6 @@ - diff --git a/source/java/org/alfresco/web/action/evaluator/CreateProjectEvaluator.java b/source/java/org/alfresco/web/action/evaluator/CreateProjectEvaluator.java new file mode 100644 index 0000000000..01e8d11da1 --- /dev/null +++ b/source/java/org/alfresco/web/action/evaluator/CreateProjectEvaluator.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2005-2007 Alfresco Software Limited. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" + */ +package org.alfresco.web.action.evaluator; + +import javax.faces.context.FacesContext; + +import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.cmr.repository.Path; +import org.alfresco.service.cmr.security.PermissionService; +import org.alfresco.web.app.Application; +import org.alfresco.web.app.servlet.FacesHelper; +import org.alfresco.web.bean.NavigationBean; +import org.alfresco.web.bean.repository.Node; +import org.alfresco.web.bean.repository.Repository; + +/** + * UI Action Evaluator - Create Project Collaboration Space in the Projects folder + * + * @author Kevin Roast + */ +public class CreateProjectEvaluator extends BaseActionEvaluator +{ + /** + * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node) + */ + public boolean evaluate(Node node) + { + FacesContext fc = FacesContext.getCurrentInstance(); + ServiceRegistry services = Repository.getServiceRegistry(fc); + NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME); + + // get the path to the current name - compare last element with the Website folder assoc name + Path path = navigator.getCurrentNode().getNodePath(); + Path.Element element = path.get(path.size() - 1); + String endPath = element.getPrefixedString(services.getNamespaceService()); + + if (Application.getProjectsFolderName(fc).equals(endPath)) + { + // check we have the permission to create nodes in the Projects folder + return navigator.getCurrentNode().hasPermission(PermissionService.ADD_CHILDREN); + } + return false; + } +} diff --git a/source/java/org/alfresco/web/action/evaluator/CreateWebProjectEvaluator.java b/source/java/org/alfresco/web/action/evaluator/CreateWebProjectEvaluator.java index 5b4c331adb..0d29099737 100644 --- a/source/java/org/alfresco/web/action/evaluator/CreateWebProjectEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/CreateWebProjectEvaluator.java @@ -36,7 +36,7 @@ import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Repository; /** - * UI Action Evaluator - Create Web Project in the Websites folders + * UI Action Evaluator - Create Web Project in the Websites folder * * @author Kevin Roast */ @@ -50,10 +50,12 @@ public class CreateWebProjectEvaluator extends BaseActionEvaluator FacesContext fc = FacesContext.getCurrentInstance(); ServiceRegistry services = Repository.getServiceRegistry(fc); NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME); + // get the path to the current name - compare last element with the Website folder assoc name - Path path = services.getNodeService().getPath(navigator.getCurrentNode().getNodeRef()); + Path path = navigator.getCurrentNode().getNodePath(); Path.Element element = path.get(path.size() - 1); String endPath = element.getPrefixedString(services.getNamespaceService()); + if (Application.getWebsitesFolderName(fc).equals(endPath)) { // check we have the permission to create nodes in that Website folder diff --git a/source/java/org/alfresco/web/app/Application.java b/source/java/org/alfresco/web/app/Application.java index 540bbc0627..c4ac2b0c94 100644 --- a/source/java/org/alfresco/web/app/Application.java +++ b/source/java/org/alfresco/web/app/Application.java @@ -88,6 +88,7 @@ public class Application private static String websitesFolderName; private static String webContentFormsFolderName; private static String contentFormsFolderName; + private static String projectsFolderName; private static Boolean isDynamicConfig = null; @@ -553,6 +554,22 @@ public class Application return getContentFormsFolderName(FacesContextUtils.getRequiredWebApplicationContext(context)); } + /** + * @return the Projects folder name + */ + public static String getProjectsFolderName(ServletContext context) + { + return getProjectsFolderName(WebApplicationContextUtils.getRequiredWebApplicationContext(context)); + } + + /** + * @return the Projects folder name + */ + public static String getProjectsFolderName(FacesContext context) + { + return getProjectsFolderName(FacesContextUtils.getRequiredWebApplicationContext(context)); + } + /** * Set the language locale for the current user context * @@ -950,6 +967,24 @@ public class Application return websitesFolderName; } + /** + * Returns the Projects folder name + * + * @param context The Spring context + * @return The Projects folder name + */ + private static String getProjectsFolderName(WebApplicationContext context) + { + if (projectsFolderName == null) + { + ImporterBootstrap bootstrap = (ImporterBootstrap)context.getBean(BEAN_IMPORTER_BOOTSTRAP); + Properties configuration = bootstrap.getConfiguration(); + projectsFolderName = configuration.getProperty("spaces.projects.childname"); + } + + return projectsFolderName; + } + /** * Returns the WCM Content Forms folder name * diff --git a/source/java/org/alfresco/web/bean/projects/CreateProjectDialog.java b/source/java/org/alfresco/web/bean/projects/CreateProjectDialog.java new file mode 100644 index 0000000000..8f233145e5 --- /dev/null +++ b/source/java/org/alfresco/web/bean/projects/CreateProjectDialog.java @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2005-2007 Alfresco Software Limited. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" + */ +package org.alfresco.web.bean.projects; + +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.alfresco.model.ApplicationModel; +import org.alfresco.web.app.AlfrescoNavigationHandler; +import org.alfresco.web.app.Application; +import org.alfresco.web.bean.spaces.CreateSpaceWizard; + +/** + * Dialog bean to create a Project. + * + * Uses the CreateSpaceWizard and overrides the space type, finish button label + * and the default outcomes. + * + * @author Kevin Roast + */ +public class CreateProjectDialog extends CreateSpaceWizard +{ + // ------------------------------------------------------------------------------ + // Wizard implementation + + @Override + public void init(Map parameters) + { + super.init(parameters); + setSpaceType(ApplicationModel.TYPE_PROJECTSPACE.toString()); + setIcon("project"); + } + + @Override + public String getFinishButtonLabel() + { + return Application.getMessage(FacesContext.getCurrentInstance(), "create_project"); + } + + @Override + protected String getDefaultCancelOutcome() + { + return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; + } + + @Override + protected String getDefaultFinishOutcome() + { + return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; + } +} diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index 25cbab1f32..85f1a468e1 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -5207,6 +5207,39 @@ #{SearchProperties} + + + + The bean that backs up the Create Project Dialog + + CreateProjectDialog + org.alfresco.web.bean.projects.CreateProjectDialog + session + + nodeService + #{NodeService} + + + fileFolderService + #{FileFolderService} + + + searchService + #{SearchService} + + + navigator + #{NavigationBean} + + + browseBean + #{BrowseBean} + + + namespaceService + #{NamespaceService} + + The bean for the Save Search Screen. diff --git a/source/web/images/icons/create_project.gif b/source/web/images/icons/create_project.gif new file mode 100644 index 0000000000..0ebd2d6343 Binary files /dev/null and b/source/web/images/icons/create_project.gif differ diff --git a/source/web/images/icons/create_project_large.gif b/source/web/images/icons/create_project_large.gif new file mode 100644 index 0000000000..761877e62c Binary files /dev/null and b/source/web/images/icons/create_project_large.gif differ diff --git a/source/web/images/icons/project-16.gif b/source/web/images/icons/project-16.gif index 43c5ec63dd..0ebd2d6343 100644 Binary files a/source/web/images/icons/project-16.gif and b/source/web/images/icons/project-16.gif differ diff --git a/source/web/images/icons/project.gif b/source/web/images/icons/project.gif index 9f5293b446..761877e62c 100644 Binary files a/source/web/images/icons/project.gif and b/source/web/images/icons/project.gif differ diff --git a/source/web/jsp/projects/create-project-details.jsp b/source/web/jsp/projects/create-project-details.jsp new file mode 100644 index 0000000000..af4def1aab --- /dev/null +++ b/source/web/jsp/projects/create-project-details.jsp @@ -0,0 +1,95 @@ +<%-- + * Copyright (C) 2005-2007 Alfresco Software Limited. + + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" +--%> +<%@ 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" %> + +<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %> +<%@ page isELIgnored="false" %> + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/web/jsp/spaces/create-space-wizard/details.jsp b/source/web/jsp/spaces/create-space-wizard/details.jsp index 1b75bfb11e..8f3a61917f 100644 --- a/source/web/jsp/spaces/create-space-wizard/details.jsp +++ b/source/web/jsp/spaces/create-space-wizard/details.jsp @@ -93,77 +93,34 @@ } } + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> -
- - - -
- - - - - - - - - - - -
- - - - - - - -
- - - - - - - -
- - - - -
- - - - - -
-
@@ -182,5 +139,4 @@
- \ No newline at end of file + \ No newline at end of file