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
This commit is contained in:
Mark Rogers
2009-03-10 14:08:22 +00:00
parent 651cad53fc
commit cad725fd39
2 changed files with 46 additions and 10 deletions

View File

@@ -44,6 +44,7 @@ import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.workflow.WorkflowModel; import org.alfresco.repo.workflow.WorkflowModel;
import org.alfresco.service.cmr.dictionary.PropertyDefinition; 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.NodeRef;
import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.workflow.WorkflowDefinition; import org.alfresco.service.cmr.workflow.WorkflowDefinition;
@@ -84,9 +85,11 @@ public class StartWorkflowWizard extends BaseWizardBean
transient protected List<SelectItem> availableWorkflows; transient protected List<SelectItem> availableWorkflows;
transient private Map<String, WorkflowDefinition> workflows; transient private Map<String, WorkflowDefinition> workflows;
protected Map<String, String> wcmWorkflows; protected List<String> wcmWorkflows;
protected List<String> invitationWorkflows;
transient private WorkflowService workflowService; transient private WorkflowService workflowService;
transient private InvitationService invitationService;
protected Node startTaskNode; protected Node startTaskNode;
protected List<Node> resources; protected List<Node> resources;
@@ -561,14 +564,16 @@ public class StartWorkflowWizard extends BaseWizardBean
// get the list of configured WCM workflows and filter these from // get the list of configured WCM workflows and filter these from
// the list as these workflows are specific to WCM functionality and AVM stores // the list as these workflows are specific to WCM functionality and AVM stores
Map<String, String> configuredWcmWorkflows = this.getWCMWorkflows(); List<String> configuredWcmWorkflows = this.getWCMWorkflowNames();
List<String> configuredInvitationWorkflows = this.getInvitationServiceWorkflowNames();
List<WorkflowDefinition> workflowDefs = this.getWorkflowService().getDefinitions(); List<WorkflowDefinition> workflowDefs = this.getWorkflowService().getDefinitions();
for (WorkflowDefinition workflowDef : workflowDefs) for (WorkflowDefinition workflowDef : workflowDefs)
{ {
String name = workflowDef.name; 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 // add the workflow if it is not a WCM specific workflow
String label = workflowDef.title; 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 * Get the Names of the WCM workflows.
* can not be found an empty string will be returned *
* @return The names of the WCM workflows.
*/ */
protected Map<String, String> getWCMWorkflows() protected List<String> getWCMWorkflowNames()
{ {
if ((wcmWorkflows == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance()))) if ((wcmWorkflows == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))
{ {
@@ -736,11 +742,11 @@ public class StartWorkflowWizard extends BaseWizardBean
if (workflowConfig != null) if (workflowConfig != null)
{ {
StringTokenizer t = new StringTokenizer(workflowConfig.getValue().trim(), ", "); StringTokenizer t = new StringTokenizer(workflowConfig.getValue().trim(), ", ");
wcmWorkflows = new HashMap<String, String>(t.countTokens()); wcmWorkflows = new ArrayList<String>(t.countTokens());
while (t.hasMoreTokens()) while (t.hasMoreTokens())
{ {
String wfName = "jbpm$" + t.nextToken(); String wfName = "jbpm$" + t.nextToken();
wcmWorkflows.put(wfName, wfName); wcmWorkflows.add(wfName);
} }
} }
else else
@@ -757,7 +763,7 @@ public class StartWorkflowWizard extends BaseWizardBean
while (t.hasMoreTokens()) while (t.hasMoreTokens())
{ {
String wfName = "jbpm$" + t.nextToken(); String wfName = "jbpm$" + t.nextToken();
wcmWorkflows.put(wfName, wfName); wcmWorkflows.add(wfName);
} }
} }
else else
@@ -774,4 +780,30 @@ public class StartWorkflowWizard extends BaseWizardBean
return wcmWorkflows; return wcmWorkflows;
} }
/**
* Get the Names of the Invitation Service Workflows
*
* @return The names of the Invitation Service workflows
*/
protected List<String> 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;
}
} }

View File

@@ -2669,6 +2669,10 @@
<managed-property> <managed-property>
<property-name>workflowService</property-name> <property-name>workflowService</property-name>
<value>#{WorkflowService}</value> <value>#{WorkflowService}</value>
</managed-property>
<managed-property>
<property-name>invitationService</property-name>
<value>#{InvitationService}</value>
</managed-property> </managed-property>
<managed-property> <managed-property>
<property-name>unprotectedNodeService</property-name> <property-name>unprotectedNodeService</property-name>