mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.2 to HEAD
7687: Added ability to create/delete layered folders in the staging area, thus allowing folders from other web projects to be shared Added title field to create folder dialog 7688: Added separate dialog for deleting layered folders 7692: WCM-993: Added ability to edit the defualt webapp for a web project git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8460 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.avm.AVMNodeType;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||
|
||||
/**
|
||||
* Evaluator to return if an item path is within a staging area sandbox and is a
|
||||
* layered directory with a primary indirection.
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
*/
|
||||
public class WCMDeleteLayeredFolderEvaluator extends BaseActionEvaluator
|
||||
{
|
||||
private static final long serialVersionUID = -130286568044703852L;
|
||||
|
||||
/**
|
||||
* @return true if the item is not locked by another user
|
||||
*/
|
||||
public boolean evaluate(final Node node)
|
||||
{
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
AVMService avmService = Repository.getServiceRegistry(facesContext).getAVMService();
|
||||
|
||||
Pair<Integer, String> p = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef());
|
||||
AVMNodeDescriptor nodeDesc = avmService.lookup(-1, p.getSecond());
|
||||
|
||||
// allow delete if we are in the main store and the node is a layeredfolder
|
||||
// with a primary indirection
|
||||
return (AVMUtil.isMainStore(AVMUtil.getStoreName(p.getSecond())) &&
|
||||
((nodeDesc.getType() == AVMNodeType.LAYERED_DIRECTORY && nodeDesc.isPrimary())));
|
||||
}
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.avm.AVMNodeType;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
|
||||
/**
|
||||
* UI Action Evaluator - return true if the node is not a layered folder or if
|
||||
* the layered folder is not a primary indirection
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
*/
|
||||
public class WCMLayeredFolderEvaluator extends WCMWorkflowEvaluator
|
||||
{
|
||||
private static final long serialVersionUID = 8507016785287243649L;
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(final Node node)
|
||||
{
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
AVMService avmService = Repository.getServiceRegistry(facesContext).getAVMService();
|
||||
|
||||
Pair<Integer, String> p = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef());
|
||||
AVMNodeDescriptor nodeDesc = avmService.lookup(-1, p.getSecond());
|
||||
|
||||
// don't allow action if its a 'layeredfolder' and a primary indirection
|
||||
return !(nodeDesc.getType() == AVMNodeType.LAYERED_DIRECTORY && nodeDesc.isPrimary());
|
||||
}
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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 org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||
|
||||
/**
|
||||
* Evaluator to return if an item path is within a staging area sandbox.
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
*/
|
||||
public class WCMStagingOnlyEvaluator extends BaseActionEvaluator
|
||||
{
|
||||
private static final long serialVersionUID = -130286568044703852L;
|
||||
|
||||
/**
|
||||
* @return true if the item is not locked by another user
|
||||
*/
|
||||
public boolean evaluate(final Node node)
|
||||
{
|
||||
String path = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef()).getSecond();
|
||||
return AVMUtil.isMainStore(AVMUtil.getStoreName(path));
|
||||
}
|
||||
}
|
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.avm.AVMNodeType;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
|
||||
/**
|
||||
* UI Action Evaluator - return true if the node is not a layered folder or if
|
||||
* the layered folder is not a primary indirection
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
*/
|
||||
public class WCMWorkflowLayeredFolderEvaluator extends WCMWorkflowEvaluator
|
||||
{
|
||||
private static final long serialVersionUID = 8507016785287243649L;
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(final Node node)
|
||||
{
|
||||
boolean proceed = super.evaluate(node);
|
||||
|
||||
if (proceed)
|
||||
{
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
AVMService avmService = Repository.getServiceRegistry(facesContext).getAVMService();
|
||||
|
||||
Pair<Integer, String> p = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef());
|
||||
AVMNodeDescriptor nodeDesc = avmService.lookup(-1, p.getSecond());
|
||||
int type = nodeDesc.getType();
|
||||
|
||||
// if the node is a 'layeredfolder' and a primary indirection don't allow
|
||||
if (type == AVMNodeType.LAYERED_DIRECTORY && nodeDesc.isPrimary())
|
||||
{
|
||||
proceed = false;
|
||||
}
|
||||
}
|
||||
|
||||
return proceed;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user