mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged 3.1 to HEAD
13841: Build fix 13988: Applied patch for ETHREEOH-1620 (webdav issues with WebSphere) 13993: Partial (UI portion) fix for ETHREEOH-1500: Remove visibility of Workflow items 13995: Fix for ETHREEOH-1883: Start advanced workflow wizard lists the WCM 'Direct Submit to Staging' workflow as one of the selectable workflows 14061: Fix for ETHREEOH-1891: Form repeat element not working in 3.1 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14070 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -27,9 +27,12 @@ package org.alfresco.web.action.evaluator;
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.workflow.BPMEngineRegistry;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.NavigationBean;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.jsf.FacesContextUtils;
|
||||
|
||||
/**
|
||||
* UI Action Evaluator - Start workflow on a node.
|
||||
@@ -38,6 +41,7 @@ import org.alfresco.web.bean.repository.Node;
|
||||
*/
|
||||
public class StartWorkflowEvaluator extends BaseActionEvaluator
|
||||
{
|
||||
private static final String BPM_ENGINE_BEAN_NAME = "bpm_engineRegistry";
|
||||
private static final long serialVersionUID = 3110333488835027710L;
|
||||
|
||||
/**
|
||||
@@ -45,12 +49,21 @@ public class StartWorkflowEvaluator extends BaseActionEvaluator
|
||||
*/
|
||||
public boolean evaluate(Node node)
|
||||
{
|
||||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||||
NavigationBean nav =
|
||||
(NavigationBean)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), NavigationBean.BEAN_NAME);
|
||||
(NavigationBean)FacesHelper.getManagedBean(facesContext, NavigationBean.BEAN_NAME);
|
||||
|
||||
return (
|
||||
nav.getIsGuest() == false
|
||||
&& node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION) == false
|
||||
);
|
||||
// determine whether the workflow services are active
|
||||
boolean workflowPresent = false;
|
||||
WebApplicationContext springContext = FacesContextUtils.getRequiredWebApplicationContext(facesContext);
|
||||
BPMEngineRegistry bpmReg = (BPMEngineRegistry)springContext.getBean(BPM_ENGINE_BEAN_NAME);
|
||||
if (bpmReg != null)
|
||||
{
|
||||
String[] components = bpmReg.getWorkflowComponents();
|
||||
workflowPresent = (components != null && components.length > 0);
|
||||
}
|
||||
|
||||
return (workflowPresent && nav.getIsGuest() == false &&
|
||||
node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION) == false);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user