mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Create Project action added to Projects folder Create menu (only for this folder). Create Project dialog. Config to wire in new action/evaluators and Create Project dialog. Project placeholder icons added. Project type removed from list of types in Advanced Space wizard.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7523 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
@@ -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
|
||||
|
Reference in New Issue
Block a user