org.alfresco.repo.invitation
Class InvitationServiceImpl

java.lang.Object
  extended by org.alfresco.repo.invitation.InvitationServiceImpl
All Implemented Interfaces:
NodeServicePolicies.BeforeDeleteNodePolicy, ClassPolicy, Policy, InvitationService

public class InvitationServiceImpl
extends java.lang.Object
implements InvitationService, NodeServicePolicies.BeforeDeleteNodePolicy

Implementation of invitation service.

See Also:
Invitation

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Field Summary
static int MAX_NUM_INVITEE_USER_NAME_GEN_TRIES
           
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Constructor Summary
InvitationServiceImpl()
           
 
Method Summary
 Invitation accept(java.lang.String invitationId, java.lang.String ticket)
          Invitee accepts this invitation Nominated Invitaton process only
 Invitation approve(java.lang.String invitationId, java.lang.String reason)
          Moderator approves this invitation
 void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          NodeServicePolicies.BeforeDeleteNodePolicy Called immediatly prior to deletion of a web site.
 Invitation cancel(java.lang.String invitationId)
          cancel this request
protected  java.lang.String generateWorkflowDescription(SiteInfo siteInfo, java.lang.String messageId)
          Generates a description for the workflow
 MutableAuthenticationService getAuthenticationService()
           
 Invitation getInvitation(java.lang.String invitationId)
          Get an invitation from its invitation id
Invitations are returned which may be in progress or completed.
 java.util.List getInvitationServiceWorkflowNames()
          Get the names of the workflows which are managed by the invitation service
 org.alfresco.service.namespace.NamespaceService getNamespaceService()
           
 org.alfresco.service.cmr.repository.NodeService getNodeService()
           
 PasswordGenerator getPasswordGenerator()
           
 org.alfresco.service.cmr.security.PermissionService getPermissionService()
           
 PersonService getPersonService()
           
 SiteService getSiteService()
           
 UserNameGenerator getUserNameGenerator()
           
 WorkflowService getWorkflowService()
           
 void init()
          Checks that all necessary properties and services have been provided.
 ModeratedInvitation inviteModerated(java.lang.String inviteeComments, java.lang.String inviteeUserName, Invitation.ResourceType resourceType, java.lang.String resourceName, java.lang.String inviteeRole)
          Start the invitation process for a ModeratedInvitation
 NominatedInvitation inviteNominated(java.lang.String inviteeUserName, Invitation.ResourceType resourceType, java.lang.String resourceName, java.lang.String inviteeRole, java.lang.String serverPath, java.lang.String acceptUrl, java.lang.String rejectUrl)
          Start the invitation process for a NominatedInvitation
 NominatedInvitation inviteNominated(java.lang.String inviteeFirstName, java.lang.String inviteeLastName, java.lang.String inviteeEmail, Invitation.ResourceType resourceType, java.lang.String resourceName, java.lang.String inviteeRole, java.lang.String serverPath, java.lang.String acceptUrl, java.lang.String rejectUrl)
          Start the invitation process for a NominatedInvitation
 boolean isSendEmails()
           
 java.util.List listPendingInvitationsForInvitee(java.lang.String invitee)
          list Invitations for a specific person/invitee
 java.util.List listPendingInvitationsForResource(Invitation.ResourceType resourceType, java.lang.String resourceName)
          list Invitations for a specific resource
 Invitation reject(java.lang.String invitationId, java.lang.String reason)
          User or moderator rejects this request
 java.util.List searchInvitation(InvitationSearchCriteria criteria)
          This is the general search invitation method
 void setAuthenticationService(MutableAuthenticationService authenticationService)
           
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
 void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
 void setPasswordGenerator(PasswordGenerator passwordGenerator)
           
 void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
           
 void setPersonService(PersonService personService)
           
 void setPolicyComponent(PolicyComponent policyComponent)
          Set the policy component
 void setSendEmails(boolean sendEmails)
           
 void setSiteService(SiteService siteService)
           
 void setUserNameGenerator(UserNameGenerator usernameGenerator)
           
 void setWorkflowAdminService(WorkflowAdminService workflowAdminService)
           
 void setWorkflowService(WorkflowService workflowService)
          Set the workflow service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_NUM_INVITEE_USER_NAME_GEN_TRIES

public static final int MAX_NUM_INVITEE_USER_NAME_GEN_TRIES
See Also:
Constant Field Values
Constructor Detail

InvitationServiceImpl

public InvitationServiceImpl()
Method Detail

setPolicyComponent

public void setPolicyComponent(PolicyComponent policyComponent)
Set the policy component

Parameters:
policyComponent - policy component

init

public void init()
Checks that all necessary properties and services have been provided.


getInvitationServiceWorkflowNames

public java.util.List getInvitationServiceWorkflowNames()
Get the names of the workflows which are managed by the invitation service

Specified by:
getInvitationServiceWorkflowNames in interface InvitationService
Returns:
the workflows which are managed by the invitation service

inviteNominated

public NominatedInvitation inviteNominated(java.lang.String inviteeUserName,
                                           Invitation.ResourceType resourceType,
                                           java.lang.String resourceName,
                                           java.lang.String inviteeRole,
                                           java.lang.String serverPath,
                                           java.lang.String acceptUrl,
                                           java.lang.String rejectUrl)
Start the invitation process for a NominatedInvitation

Specified by:
inviteNominated in interface InvitationService
Parameters:
inviteeUserName - Alfresco user name of the invitee
Invitation -
ResourceType - resourceType
resourceName -
inviteeRole -
serverPath -
acceptUrl -
rejectUrl -
Returns:
the nominated invitation which will contain the invitationId and ticket which will uniqely identify this invitation for the rest of the workflow.
Throws:
InvitationException
InvitationExceptionUserError
InvitationExceptionForbidden

inviteNominated

public NominatedInvitation inviteNominated(java.lang.String inviteeFirstName,
                                           java.lang.String inviteeLastName,
                                           java.lang.String inviteeEmail,
                                           Invitation.ResourceType resourceType,
                                           java.lang.String resourceName,
                                           java.lang.String inviteeRole,
                                           java.lang.String serverPath,
                                           java.lang.String acceptUrl,
                                           java.lang.String rejectUrl)
Start the invitation process for a NominatedInvitation

Specified by:
inviteNominated in interface InvitationService
Parameters:
inviteeFirstName -
inviteeLastName -
inviteeEmail -
inviteeUserName - optional Alfresco user name of the invitee, null if not on system.
Invitation - .ResourceType resourceType
resourceName -
inviteeRole -
serverPath -
acceptUrl -
rejectUrl -
Returns:
the nominated invitation which will contain the invitationId and ticket which will uniqely identify this invitation for the rest of the workflow.
Throws:
InvitationException
InvitationExceptionUserError
InvitationExceptionForbidden

inviteModerated

public ModeratedInvitation inviteModerated(java.lang.String inviteeComments,
                                           java.lang.String inviteeUserName,
                                           Invitation.ResourceType resourceType,
                                           java.lang.String resourceName,
                                           java.lang.String inviteeRole)
Start the invitation process for a ModeratedInvitation

Specified by:
inviteModerated in interface InvitationService
Parameters:
comments - why does the invitee want access to the resource ?
inviteeUserName - who is to be invited
Invitation - .ResourceType resourceType what resource type ?
resourceName - which resource
inviteeRole - which role ?

accept

public Invitation accept(java.lang.String invitationId,
                         java.lang.String ticket)
Invitee accepts this invitation Nominated Invitaton process only

Specified by:
accept in interface InvitationService
Parameters:
invitationId - the invitation id
ticket - the ticket produced when creating the invitation.
Returns:
the invitation

approve

public Invitation approve(java.lang.String invitationId,
                          java.lang.String reason)
Moderator approves this invitation

Specified by:
approve in interface InvitationService
Parameters:
request - the request to approve
reason - comments about the acceptance

reject

public Invitation reject(java.lang.String invitationId,
                         java.lang.String reason)
User or moderator rejects this request

Specified by:
reject in interface InvitationService
Parameters:
invitationId -
reason - , optional reason for rejection

cancel

public Invitation cancel(java.lang.String invitationId)
cancel this request

Specified by:
cancel in interface InvitationService

getInvitation

public Invitation getInvitation(java.lang.String invitationId)
Get an invitation from its invitation id
Invitations are returned which may be in progress or completed.

Specified by:
getInvitation in interface InvitationService
Returns:
the invitation.
Throws:
InvitationExceptionNotFound - the invitation does not exist.
InvitationExceptionUserError

listPendingInvitationsForInvitee

public java.util.List listPendingInvitationsForInvitee(java.lang.String invitee)
list Invitations for a specific person/invitee

Specified by:
listPendingInvitationsForInvitee in interface InvitationService
Parameters:
invitee - alfresco user id of person being invited

listPendingInvitationsForResource

public java.util.List listPendingInvitationsForResource(Invitation.ResourceType resourceType,
                                                        java.lang.String resourceName)
list Invitations for a specific resource

Specified by:
listPendingInvitationsForResource in interface InvitationService
Parameters:
resourceType -
resourceName -

searchInvitation

public java.util.List searchInvitation(InvitationSearchCriteria criteria)
This is the general search invitation method

Specified by:
searchInvitation in interface InvitationService
Parameters:
criteria -
Returns:
the list of invitations

setWorkflowService

public void setWorkflowService(WorkflowService workflowService)
Set the workflow service

Parameters:
workflowService -

setWorkflowAdminService

public void setWorkflowAdminService(WorkflowAdminService workflowAdminService)
Parameters:
workflowAdminService - the workflowAdminService to set

getWorkflowService

public WorkflowService getWorkflowService()
Returns:
the workflow service

setPersonService

public void setPersonService(PersonService personService)

getPersonService

public PersonService getPersonService()

setSiteService

public void setSiteService(SiteService siteService)

getSiteService

public SiteService getSiteService()

setAuthenticationService

public void setAuthenticationService(MutableAuthenticationService authenticationService)

getAuthenticationService

public MutableAuthenticationService getAuthenticationService()

setUserNameGenerator

public void setUserNameGenerator(UserNameGenerator usernameGenerator)

getUserNameGenerator

public UserNameGenerator getUserNameGenerator()

setPasswordGenerator

public void setPasswordGenerator(PasswordGenerator passwordGenerator)

getPasswordGenerator

public PasswordGenerator getPasswordGenerator()

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)

setNamespaceService

public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)

getNamespaceService

public org.alfresco.service.namespace.NamespaceService getNamespaceService()

setPermissionService

public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)

getPermissionService

public org.alfresco.service.cmr.security.PermissionService getPermissionService()

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)

getNodeService

public org.alfresco.service.cmr.repository.NodeService getNodeService()

beforeDeleteNode

public void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeServicePolicies.BeforeDeleteNodePolicy Called immediatly prior to deletion of a web site.

Specified by:
beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicy
Parameters:
nodeRef - the node reference

generateWorkflowDescription

protected java.lang.String generateWorkflowDescription(SiteInfo siteInfo,
                                                       java.lang.String messageId)
Generates a description for the workflow

Parameters:
siteInfo - The site to generate a description for
messageId - The resource bundle key to use for the description
Returns:
The workflow description

setSendEmails

public void setSendEmails(boolean sendEmails)
Parameters:
sendEmails - the sendEmails to set

isSendEmails

public boolean isSendEmails()
Specified by:
isSendEmails in interface InvitationService
Returns:
true if emails are sent on invite.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.