From 5c743c82005b241b38e59cc80fbf1f4f85e7be46 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Tue, 16 Aug 2011 11:10:43 +0000 Subject: [PATCH] Hide the publishing and activiti invitation workflows from the list in the 'Start Advanced Workflow' wizard in Explorer. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29790 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../bean/workflow/StartWorkflowWizard.java | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java b/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java index 1c525bea53..fc49485618 100644 --- a/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java +++ b/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java @@ -37,7 +37,10 @@ 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; import org.alfresco.repo.workflow.WorkflowModel; +import org.alfresco.repo.workflow.activiti.ActivitiConstants; +import org.alfresco.repo.workflow.jbpm.JBPMEngine; import org.alfresco.service.cmr.dictionary.PropertyDefinition; import org.alfresco.service.cmr.invitation.InvitationService; import org.alfresco.service.cmr.repository.InvalidNodeRefException; @@ -83,6 +86,7 @@ public class StartWorkflowWizard extends BaseWizardBean protected List wcmWorkflows; protected List invitationWorkflows; + protected List publishingWorkflows; transient private WorkflowService workflowService; transient private InvitationService invitationService; @@ -569,6 +573,7 @@ public class StartWorkflowWizard extends BaseWizardBean // the list as these workflows are specific to WCM functionality and AVM stores List configuredWcmWorkflows = this.getWCMWorkflowNames(); List configuredInvitationWorkflows = this.getInvitationServiceWorkflowNames(); + List publishingWorkflows = this.getPublishingWorkflowNames(); List workflowDefs = this.getWorkflowService().getDefinitions(); for (WorkflowDefinition workflowDef : workflowDefs) @@ -576,7 +581,8 @@ public class StartWorkflowWizard extends BaseWizardBean String name = workflowDef.name; if (configuredWcmWorkflows.contains(name) == false && - configuredInvitationWorkflows.contains(name) == false) + configuredInvitationWorkflows.contains(name) == false && + publishingWorkflows.contains(name) == false) { // add the workflow if it is not a WCM specific workflow String label = workflowDef.title; @@ -790,23 +796,41 @@ public class StartWorkflowWizard extends BaseWizardBean */ protected List getInvitationServiceWorkflowNames() { - if( invitationWorkflows == null ) - { - if (invitationService != null) - { - invitationWorkflows = invitationService.getInvitationServiceWorkflowNames(); - } - } - return invitationWorkflows; + if( invitationWorkflows == null ) + { + if (invitationService != null) + { + invitationWorkflows = invitationService.getInvitationServiceWorkflowNames(); + } + } + return invitationWorkflows; + } + + /** + * Get the names of the publishing workflows + * + * @return The names of the publishing workflows + */ + protected List getPublishingWorkflowNames() + { + if (publishingWorkflows == null) + { + publishingWorkflows = new ArrayList(2); + + publishingWorkflows.add(JBPMEngine.ENGINE_ID + "$" + PublishingEventHelper.WORKFLOW_DEFINITION_NAME); + publishingWorkflows.add(ActivitiConstants.ENGINE_ID + "$" + PublishingEventHelper.WORKFLOW_DEFINITION_NAME); + } + + return publishingWorkflows; } public void setInvitationService(InvitationService invitationService) { - this.invitationService = invitationService; + this.invitationService = invitationService; } - public InvitationService getInvitationService() - { - return invitationService; - } + public InvitationService getInvitationService() + { + return invitationService; + } }