From cad725fd39e27102771b62a23c1dc31bdb4609a9 Mon Sep 17 00:00:00 2001 From: Mark Rogers Date: Tue, 10 Mar 2009 14:08:22 +0000 Subject: [PATCH] Invitation service Java Script API for invitations on Site object. Implementation of REST API for Site / Invitations. Rename of old invite workflow to invitation-nominated and renaming of properties for consistency. Old workflow is due for deprecation. Rework to Nominated workflow to unscramble user creation. Start Workflow UI bean now knows to avoid workflows managed by the InvitationService. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13523 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../bean/workflow/StartWorkflowWizard.java | 52 +++++++++++++++---- source/web/WEB-INF/faces-config-beans.xml | 4 ++ 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java b/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java index 316e18b577..634332302c 100644 --- a/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java +++ b/source/java/org/alfresco/web/bean/workflow/StartWorkflowWizard.java @@ -44,6 +44,7 @@ import org.alfresco.model.ApplicationModel; import org.alfresco.model.ContentModel; import org.alfresco.repo.workflow.WorkflowModel; import org.alfresco.service.cmr.dictionary.PropertyDefinition; +import org.alfresco.service.cmr.invitation.InvitationService; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.workflow.WorkflowDefinition; @@ -84,9 +85,11 @@ public class StartWorkflowWizard extends BaseWizardBean transient protected List availableWorkflows; transient private Map workflows; - protected Map wcmWorkflows; + protected List wcmWorkflows; + protected List invitationWorkflows; transient private WorkflowService workflowService; + transient private InvitationService invitationService; protected Node startTaskNode; protected List resources; @@ -561,14 +564,16 @@ public class StartWorkflowWizard extends BaseWizardBean // get the list of configured WCM workflows and filter these from // the list as these workflows are specific to WCM functionality and AVM stores - Map configuredWcmWorkflows = this.getWCMWorkflows(); + List configuredWcmWorkflows = this.getWCMWorkflowNames(); + List configuredInvitationWorkflows = this.getInvitationServiceWorkflowNames(); List workflowDefs = this.getWorkflowService().getDefinitions(); for (WorkflowDefinition workflowDef : workflowDefs) { String name = workflowDef.name; - if (configuredWcmWorkflows.containsKey(name) == false && - "jbpm$wf:invite".equals(name) == false) + + if (configuredWcmWorkflows.contains(name) == false && + configuredInvitationWorkflows.contains(name) == false) { // add the workflow if it is not a WCM specific workflow String label = workflowDef.title; @@ -720,10 +725,11 @@ public class StartWorkflowWizard extends BaseWizardBean } /** - * @return The configured comma separated list of WCM workflows, if the config - * can not be found an empty string will be returned + * Get the Names of the WCM workflows. + * + * @return The names of the WCM workflows. */ - protected Map getWCMWorkflows() + protected List getWCMWorkflowNames() { if ((wcmWorkflows == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance()))) { @@ -736,11 +742,11 @@ public class StartWorkflowWizard extends BaseWizardBean if (workflowConfig != null) { StringTokenizer t = new StringTokenizer(workflowConfig.getValue().trim(), ", "); - wcmWorkflows = new HashMap(t.countTokens()); + wcmWorkflows = new ArrayList(t.countTokens()); while (t.hasMoreTokens()) { String wfName = "jbpm$" + t.nextToken(); - wcmWorkflows.put(wfName, wfName); + wcmWorkflows.add(wfName); } } else @@ -757,7 +763,7 @@ public class StartWorkflowWizard extends BaseWizardBean while (t.hasMoreTokens()) { String wfName = "jbpm$" + t.nextToken(); - wcmWorkflows.put(wfName, wfName); + wcmWorkflows.add(wfName); } } else @@ -774,4 +780,30 @@ public class StartWorkflowWizard extends BaseWizardBean return wcmWorkflows; } + /** + * Get the Names of the Invitation Service Workflows + * + * @return The names of the Invitation Service workflows + */ + protected List getInvitationServiceWorkflowNames() + { + if( invitationWorkflows == null ) + { + if (invitationService != null) + { + invitationWorkflows = invitationService.getInvitationServiceWorkflowNames(); + } + } + return invitationWorkflows; + } + + public void setInvitationService(InvitationService invitationService) + { + this.invitationService = invitationService; + } + + public InvitationService getInvitationService() + { + return invitationService; + } } diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index 868b55997d..e7029dc43e 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -2669,6 +2669,10 @@ workflowService #{WorkflowService} + + + invitationService + #{InvitationService} unprotectedNodeService