Merged HEAD-QA to HEAD (4.2) (including moving test classes into separate folders)

51903 to 54309 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@54310 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Samuel Langlois
2013-08-20 17:17:31 +00:00
parent 5a8f6ee635
commit e60d57ea42
70 changed files with 7094 additions and 1988 deletions

View File

@@ -34,7 +34,6 @@ import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import javax.transaction.UserTransaction;
import org.springframework.extensions.config.ConfigElement;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.publishing.PublishingEventHelper;
@@ -68,6 +67,7 @@ import org.alfresco.web.ui.common.component.UIActionLink;
import org.alfresco.web.ui.common.component.data.UIRichList;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.extensions.config.ConfigElement;
/**
* Bean implementation for the Start Workflow Wizard.
@@ -85,6 +85,7 @@ public class StartWorkflowWizard extends BaseWizardBean
transient private Map<String, WorkflowDefinition> workflows;
protected List<String> wcmWorkflows;
protected List<String> excludedWorkflows;
protected List<String> invitationWorkflows;
protected List<String> publishingWorkflows;
@@ -574,6 +575,7 @@ public class StartWorkflowWizard extends BaseWizardBean
List<String> configuredWcmWorkflows = this.getWCMWorkflowNames();
List<String> configuredInvitationWorkflows = this.getInvitationServiceWorkflowNames();
List<String> publishingWorkflows = this.getPublishingWorkflowNames();
List<String> excludedWorkflows = this.getExcludedWorkflows();
List<WorkflowDefinition> workflowDefs = this.getWorkflowService().getDefinitions();
for (WorkflowDefinition workflowDef : workflowDefs)
@@ -582,7 +584,8 @@ public class StartWorkflowWizard extends BaseWizardBean
if (configuredWcmWorkflows.contains(name) == false &&
configuredInvitationWorkflows.contains(name) == false &&
publishingWorkflows.contains(name) == false)
publishingWorkflows.contains(name) == false &&
excludedWorkflows.contains(name) == false)
{
// add the workflow if it is not a WCM specific workflow
String label = workflowDef.title;
@@ -789,6 +792,36 @@ public class StartWorkflowWizard extends BaseWizardBean
return wcmWorkflows;
}
/**
* Get the Names of globally excluded workflow-names.
*
* @return The names of the workflows to exclude.
*/
protected List<String> getExcludedWorkflows()
{
if ((excludedWorkflows == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))
{
FacesContext fc = FacesContext.getCurrentInstance();
ConfigElement config = Application.getConfigService(fc).getGlobalConfig().getConfigElement("excluded-workflows");
if (config != null)
{
StringTokenizer t = new StringTokenizer(config.getValue().trim(), ", ");
excludedWorkflows = new ArrayList<String>(t.countTokens());
while (t.hasMoreTokens())
{
String wfName = t.nextToken();
excludedWorkflows.add(wfName);
}
}
else
{
excludedWorkflows = Collections.emptyList();
}
}
return excludedWorkflows;
}
/**
* Get the Names of the Invitation Service Workflows
*

View File

@@ -11,6 +11,7 @@ import org.alfresco.service.cmr.workflow.WorkflowTransition;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.TransientMapNode;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* Wrapper around a {@link WorkflowTask} to allow it to be approached as a {@link Node}.
@@ -68,6 +69,16 @@ public class WorkflowTaskNode extends TransientMapNode {
// add the task itself as a property
propertyWrapper.put("workflowTask", workflowTask);
}
// Add an additional property, containing a human-friendly representation of the priority
Integer priority = (Integer) workflowTask.getProperties().get(WorkflowModel.PROP_PRIORITY);
String priorityMessage = "";
if (priority != null)
{
priorityMessage = I18NUtil.getMessage(getPriorityMessageKey(priority), I18NUtil.getLocale());
}
propertyWrapper.put("priorityMessage", priorityMessage);
}
@Override
@@ -112,4 +123,9 @@ public class WorkflowTaskNode extends TransientMapNode {
return super.put(QName.resolveToQNameString(WorkflowTaskNode.this.getNamespacePrefixResolver(), key.toString()), value);
}
}
protected String getPriorityMessageKey(int priority)
{
return "listconstraint.bpm_allowedPriority." + priority;
}
}