mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
78403: Merged EOL (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 75700: ACE-2149: EOL AVM / WCM - Remove most of the AVM and WCM beans, scripts, classes, patches, etc - The Explorer client is very broken for compilation - TODO: Remove all WCM-related functionality, which I thought would be best left to a UI dev I've murdered many of the classes and beans but there's more to do - The repository compiles TODO: Get it running again - TODO: Check if we can wipe the 'deployment' project as well git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@82540 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.web.action.evaluator;
|
||||
|
||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
|
||||
public class WCMConflictEvaluator extends WCMWorkflowDeletedEvaluator
|
||||
{
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.action.evaluator.WCMWorkflowDeletedEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(final Node node)
|
||||
{
|
||||
if (!super.evaluate(node))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Integer diff = (Integer)node.getProperties().get("avmDiff");
|
||||
if (diff == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (diff == AVMDifference.CONFLICT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.web.action.evaluator;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.wcm.webproject.WebProjectService;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
|
||||
/**
|
||||
* Evaluator to return true if the current user is a content manager for the current website.
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
*/
|
||||
public class WCMContentManagerEvaluator extends BaseActionEvaluator
|
||||
{
|
||||
private static final long serialVersionUID = 2588681368739253602L;
|
||||
|
||||
/**
|
||||
* @return true if the item is not locked by another user
|
||||
*/
|
||||
public boolean evaluate(final Node node)
|
||||
{
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
WebProjectService webProjectService = Repository.getServiceRegistry(facesContext).getWebProjectService();
|
||||
return webProjectService.isContentManager(node.getNodeRef());
|
||||
}
|
||||
}
|
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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())));
|
||||
}
|
||||
}
|
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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());
|
||||
}
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.web.action.evaluator;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
|
||||
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.wcm.AVMBrowseBean;
|
||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||
import org.alfresco.web.bean.wcm.WebProject;
|
||||
|
||||
/**
|
||||
* Evaluator to return if a item is accessable due to a WCM user level lock.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class WCMLockEvaluator extends BaseActionEvaluator
|
||||
{
|
||||
private static final long serialVersionUID = -816856825850017138L;
|
||||
|
||||
/**
|
||||
* @return true if the item is not locked by another user
|
||||
*/
|
||||
public boolean evaluate(final Node node)
|
||||
{
|
||||
boolean result = false;
|
||||
final String path = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef()).getSecond();
|
||||
if (!AVMUtil.isMainStore(AVMUtil.getStoreName(path)))
|
||||
{
|
||||
final FacesContext fc = FacesContext.getCurrentInstance();
|
||||
final AVMLockingService avmLockService = Repository.getServiceRegistry(fc).getAVMLockingService();
|
||||
final AVMBrowseBean avmBrowseBean = (AVMBrowseBean)FacesHelper.getManagedBean(fc, AVMBrowseBean.BEAN_NAME);
|
||||
|
||||
final String username = Application.getCurrentUser(fc).getUserName();
|
||||
|
||||
WebProject webProject = avmBrowseBean.getWebProject();
|
||||
if (webProject == null)
|
||||
{
|
||||
// when in a workflow context, the WebProject may not be accurate on the browsebean
|
||||
// so get the web project associated with the path
|
||||
webProject = new WebProject(path);
|
||||
}
|
||||
result = avmLockService.hasAccess(webProject.getNodeRef(), path, username);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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));
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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 a item path is not within a staging area sandbox.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class WCMStagingReadonlyEvaluator extends BaseActionEvaluator
|
||||
{
|
||||
private static final long serialVersionUID = 2588681368739253602L;
|
||||
|
||||
/**
|
||||
* @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));
|
||||
}
|
||||
}
|
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.web.action.evaluator;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.locking.AVMLockingService;
|
||||
import org.alfresco.util.Pair;
|
||||
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.wcm.AVMBrowseBean;
|
||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||
import org.alfresco.web.bean.wcm.WebProject;
|
||||
|
||||
/**
|
||||
* UI Action Evaluator - return true if the node is not part of an in-progress
|
||||
* WCM workflow and is locked
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
*/
|
||||
public class WCMUnlockEvaluator extends BaseActionEvaluator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(final Node node)
|
||||
{
|
||||
boolean proceed = false;
|
||||
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
AVMService avmService = Repository.getServiceRegistry(context).getAVMService();
|
||||
AVMLockingService avmLockingService = Repository.getServiceRegistry(context).getAVMLockingService();
|
||||
AVMBrowseBean avmBrowseBean = (AVMBrowseBean)FacesHelper.getManagedBean(context, AVMBrowseBean.BEAN_NAME);
|
||||
|
||||
Pair<Integer, String> p = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef());
|
||||
String path = p.getSecond();
|
||||
|
||||
if (avmService.lookup(p.getFirst(), path) != null)
|
||||
{
|
||||
WebProject webProject = avmBrowseBean.getWebProject();
|
||||
if (webProject == null)
|
||||
{
|
||||
// when in a workflow context, the WebProject may not be accurate on the browsebean
|
||||
// so get the web project associated with the path
|
||||
webProject = new WebProject(path);
|
||||
}
|
||||
|
||||
// determine if the item is locked
|
||||
String lockOwner = avmLockingService.getLockOwner(webProject.getStoreId(), AVMUtil.getStoreRelativePath(path));
|
||||
proceed = (lockOwner != null);
|
||||
}
|
||||
|
||||
return proceed;
|
||||
}
|
||||
}
|
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.web.action.evaluator;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.wcm.AVMBrowseBean;
|
||||
import org.alfresco.web.bean.wcm.AVMNode;
|
||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||
import org.alfresco.web.bean.wcm.WebProject;
|
||||
|
||||
/**
|
||||
* UI Action Evaluator - return true if the node is not part of an in-progress WCM workflow.
|
||||
* No check for deleted items is made in this evaluator. @see WCMWorkflowEvaluator
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class WCMWorkflowDeletedEvaluator extends WCMLockEvaluator
|
||||
{
|
||||
private static final long serialVersionUID = -4341942166433855200L;
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(final Node node)
|
||||
{
|
||||
boolean proceed = false;
|
||||
if (super.evaluate(node))
|
||||
{
|
||||
final FacesContext fc = FacesContext.getCurrentInstance();
|
||||
final AVMBrowseBean avmBrowseBean = (AVMBrowseBean)FacesHelper.getManagedBean(fc, AVMBrowseBean.BEAN_NAME);
|
||||
|
||||
WebProject webProject = avmBrowseBean.getWebProject();
|
||||
if (webProject == null || webProject.hasWorkflow())
|
||||
{
|
||||
String sandbox = AVMUtil.getStoreName(node.getPath());
|
||||
|
||||
// evaluate to true if we are within a workflow store (i.e. list of resources in the task
|
||||
// dialog) or not part of an already in-progress workflow
|
||||
proceed = (AVMUtil.isWorkflowStore(sandbox) ||
|
||||
!((AVMNode)node).isInActiveWorkflow(sandbox));
|
||||
}
|
||||
else
|
||||
{
|
||||
// if the WebProject has no workflow then we can proceed without checking further
|
||||
proceed = true;
|
||||
}
|
||||
}
|
||||
return proceed;
|
||||
}
|
||||
}
|
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.web.action.evaluator;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.wcm.AVMBrowseBean;
|
||||
import org.alfresco.web.bean.wcm.AVMNode;
|
||||
import org.alfresco.web.bean.wcm.AVMUtil;
|
||||
import org.alfresco.web.bean.wcm.WebProject;
|
||||
|
||||
/**
|
||||
* UI Action Evaluator - return true if the node is not part of an in-progress WCM workflow.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public class WCMWorkflowEvaluator extends WCMLockEvaluator
|
||||
{
|
||||
private static final long serialVersionUID = -5847066921917855781L;
|
||||
|
||||
/**
|
||||
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(final Node node)
|
||||
{
|
||||
boolean proceed = false;
|
||||
if (super.evaluate(node))
|
||||
{
|
||||
final FacesContext fc = FacesContext.getCurrentInstance();
|
||||
final AVMBrowseBean avmBrowseBean = (AVMBrowseBean)FacesHelper.getManagedBean(fc, AVMBrowseBean.BEAN_NAME);
|
||||
|
||||
WebProject webProject = avmBrowseBean.getWebProject();
|
||||
if (webProject == null || webProject.hasWorkflow())
|
||||
{
|
||||
String sandbox = AVMUtil.getStoreName(node.getPath());
|
||||
|
||||
proceed = ((AVMUtil.isWorkflowStore(sandbox) ||
|
||||
!((AVMNode)node).isInActiveWorkflow(sandbox)) &&
|
||||
!((AVMNode)node).isDeleted());
|
||||
}
|
||||
else
|
||||
{
|
||||
// if the WebProject has no workflow then we can proceed without checking further
|
||||
proceed = true;
|
||||
}
|
||||
}
|
||||
return proceed;
|
||||
}
|
||||
}
|
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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