Package org.alfresco.repo.invitation
Class InvitationServiceImpl
java.lang.Object
org.alfresco.repo.invitation.InvitationServiceImpl
- All Implemented Interfaces:
NodeServicePolicies.BeforeDeleteNodePolicy,ClassPolicy,Policy,InvitationService
public class InvitationServiceImpl
extends Object
implements InvitationService, NodeServicePolicies.BeforeDeleteNodePolicy
Implementation of invitation service.
- Author:
- mrogers, Nick Smith
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg -
Field Summary
FieldsFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy
QNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInvitee accepts this invitation Nominated Invitaton process onlyvoidacceptNominatedInvitation(String siteName, String invitee, String role, String inviter) Moderator approves this invitationvoidaddSiteMembership(String invitee, String siteName, String role, String runAsUser, boolean overrideExisting) Add Invitee to Site with the site role that the inviter "started" the invite process withModerator approves this invitationvoidapproveModeratedInvitation(String siteName, String invitee, String role, String reviewer) Moderator approves this invitationvoidbeforeDeleteNode(NodeRef nodeRef) NodeServicePolicies.BeforeDeleteNodePolicy Called immediatly prior to deletion of a web site.cancel this requestvoidcancelInvitation(String siteName, String invitee, String inviteId, String currentInviteId) Inviter cancels this invitationvoiddeleteAuthenticationIfUnused(String invitee, String currentInviteId) Clean up invitee user account and person node when no longer in use.protected StringgenerateWorkflowDescription(SiteInfo siteInfo, String messageId) Generates a description for the workflowgetInvitation(String invitationId) Get an invitation from its invitation id
Invitations are returned which may be in progress or completed.Get the names of the workflows which are managed by the invitation servicevoidinit()Checks that all necessary properties and services have been provided.inviteModerated(String inviteeComments, String inviteeUserName, Invitation.ResourceType resourceType, String resourceName, String inviteeRole) Start the invitation process for a ModeratedInvitationinviteModerated(String inviteeComments, String inviteeUserName, Invitation.ResourceType resourceType, String resourceName, String inviteeRole, String clientName) Start the invitation process for a ModeratedInvitationinviteNominated(String inviteeFirstName, String inviteeLastName, String inviteeEmail, Invitation.ResourceType resourceType, String resourceName, String inviteeRole, String acceptUrl, String rejectUrl) Start the invitation process for a NominatedInvitationinviteNominated(String inviteeFirstName, String inviteeLastName, String inviteeEmail, Invitation.ResourceType resourceType, String resourceName, String inviteeRole, String serverPath, String acceptUrl, String rejectUrl) Start the invitation process for a NominatedInvitationinviteNominated(String inviteeUserName, Invitation.ResourceType resourceType, String resourceName, String inviteeRole, String acceptUrl, String rejectUrl) Start the invitation process for a NominatedInvitationinviteNominated(String inviteeUserName, Invitation.ResourceType resourceType, String resourceName, String inviteeRole, String serverPath, String acceptUrl, String rejectUrl) Start the invitation process for a NominatedInvitationbooleanlistPendingInvitationsForInvitee(String invitee) list Invitations for a specific person/inviteelistPendingInvitationsForInvitee(String invitee, Invitation.ResourceType resourceType) listPendingInvitationsForResource(Invitation.ResourceType resourceType, String resourceName) list Invitations for a specific resourceUser or moderator rejects this requestvoidrejectModeratedInvitation(String siteName, String invitee, String role, String reviewer, String resourceType, String reviewComments) Moderator rejects this invitationsearchInvitation(InvitationSearchCriteria criteria) Deprecated.searchInvitation(InvitationSearchCriteria criteria, int limit) This is the general search invitation method returningInvitationThis is the recommended method to use for searching invitations; Consider that the performance of the method will be greatly influenced by the limit specifiedvoidsendModeratedInvitation(String inviteId, String emailTemplateXpath, String emailSubjectKey, Map<String, Object> executionVariables) Sends the site join request notification email using the given template, subject localization key, and variables.voidsendNominatedInvitation(String inviteId, String emailTemplateXpath, String emailSubjectKey, Map<String, Object> executionVariables) Sends the invite email using the given template, subject localization key, and variables.voidsendNominatedInvitation(String inviteId, Map<String, Object> executionVariables) Implemented for backwards compatibilityvoidsetActionService(ActionService actionService) voidsetAuthenticationService(MutableAuthenticationService authenticationService) voidsetClientAppConfig(ClientAppConfig clientAppConfig) voidsetDictionaryService(DictionaryService dictionaryService) voidsetMessageService(MessageService messageService) voidsetModeratedInvitationWorkflowId(String moderatedInvitationWorkflowId) Sets the moderated invite activiti workflow definitionvoidsetNamespaceService(NamespaceService namespaceService) voidsetNodeService(NodeService nodeService) voidsetNominatedInvitationExternalWorkflowId(String nominatedInvitationExternalWorkflowId) Sets the nominated invite activiti workflow definition for external usersvoidsetNominatedInvitationWorkflowId(String nominatedInvitationWorkflowId) Sets the nominated invite activiti workflow definition for internal usersvoidsetPasswordGenerator(PasswordGenerator passwordGenerator) voidsetPermissionService(PermissionService permissionService) voidsetPersonService(PersonService personService) voidsetPolicyComponent(PolicyComponent policyComponent) Set the policy componentvoidsetRepositoryHelper(Repository repositoryHelper) voidsetSendEmails(boolean sendEmails) voidsetServiceRegistry(ServiceRegistry serviceRegistry) voidsetSiteService(SiteService siteService) voidsetSysAdminParams(SysAdminParams sysAdminParams) voidsetTemplateService(TemplateService templateService) voidsetUserNameGenerator(UserNameGenerator usernameGenerator) voidsetWorkflowAdminService(WorkflowAdminService workflowAdminService) voidsetWorkflowService(WorkflowService workflowService) Set the workflow serviceupdateModeratedInvitation(String inviteeId, String siteShortName, String inviteeComments) Update the invitee comments for an existing moderated invitation
-
Field Details
-
MAX_NUM_INVITEE_USER_NAME_GEN_TRIES
public static final int MAX_NUM_INVITEE_USER_NAME_GEN_TRIES- See Also:
-
-
Constructor Details
-
InvitationServiceImpl
public InvitationServiceImpl()
-
-
Method Details
-
setClientAppConfig
-
setPolicyComponent
Set the policy component- Parameters:
policyComponent- policy component
-
setNominatedInvitationWorkflowId
Sets the nominated invite activiti workflow definition for internal users- Parameters:
nominatedInvitationWorkflowId-
-
setNominatedInvitationExternalWorkflowId
Sets the nominated invite activiti workflow definition for external users- Parameters:
nominatedInvitationExternalWorkflowId-
-
setModeratedInvitationWorkflowId
Sets the moderated invite activiti workflow definition- Parameters:
moderatedInvitationWorkflowId-
-
init
public void init()Checks that all necessary properties and services have been provided. -
getInvitationServiceWorkflowNames
Get the names of the workflows which are managed by the invitation service- Specified by:
getInvitationServiceWorkflowNamesin interfaceInvitationService- Returns:
- the workflows which are managed by the invitation service
-
inviteNominated
public NominatedInvitation inviteNominated(String inviteeUserName, Invitation.ResourceType resourceType, String resourceName, String inviteeRole, String serverPath, String acceptUrl, String rejectUrl) Start the invitation process for a NominatedInvitation- Specified by:
inviteNominatedin interfaceInvitationService- Parameters:
inviteeUserName- Alfresco user name of the inviteeresourceType- resourceTyperesourceName- StringinviteeRole- StringserverPath- StringacceptUrl- StringrejectUrl- String- Returns:
- the nominated invitation which will contain the invitationId and ticket which will uniqely identify this invitation for the rest of the workflow.
- Throws:
InvitationExceptionInvitationExceptionUserErrorInvitationExceptionForbidden
-
inviteNominated
public NominatedInvitation inviteNominated(String inviteeUserName, Invitation.ResourceType resourceType, String resourceName, String inviteeRole, String acceptUrl, String rejectUrl) Start the invitation process for a NominatedInvitation- Specified by:
inviteNominatedin interfaceInvitationService- Parameters:
inviteeUserName- Alfresco user name of the inviteeresourceType- resourceTyperesourceName- StringinviteeRole- StringacceptUrl- StringrejectUrl- String- Returns:
- the nominated invitation which will contain the invitationId and ticket which will uniqely identify this invitation for the rest of the workflow.
- Throws:
InvitationExceptionInvitationExceptionUserErrorInvitationExceptionForbidden
-
inviteNominated
public NominatedInvitation inviteNominated(String inviteeFirstName, String inviteeLastName, String inviteeEmail, Invitation.ResourceType resourceType, String resourceName, String inviteeRole, String acceptUrl, String rejectUrl) Start the invitation process for a NominatedInvitation- Specified by:
inviteNominatedin interfaceInvitationService- Parameters:
inviteeFirstName- StringinviteeLastName- StringinviteeEmail- StringresourceType- Invitation.ResourceTyperesourceName- StringinviteeRole- StringacceptUrl- StringrejectUrl- String- Returns:
- the nominated invitation which will contain the invitationId and ticket which will uniqely identify this invitation for the rest of the workflow.
- Throws:
InvitationExceptionInvitationExceptionUserErrorInvitationExceptionForbidden
-
inviteNominated
public NominatedInvitation inviteNominated(String inviteeFirstName, String inviteeLastName, String inviteeEmail, Invitation.ResourceType resourceType, String resourceName, String inviteeRole, String serverPath, String acceptUrl, String rejectUrl) Start the invitation process for a NominatedInvitation- Specified by:
inviteNominatedin interfaceInvitationService- Parameters:
inviteeFirstName- StringinviteeLastName- StringinviteeEmail- StringresourceType- Invitation.ResourceTypresourceName- StringinviteeRole- StringserverPath- StringacceptUrl- StringrejectUrl- String- Returns:
- the nominated invitation which will contain the invitationId and ticket which will uniqely identify this invitation for the rest of the workflow.
- Throws:
InvitationExceptionInvitationExceptionUserErrorInvitationExceptionForbidden
-
inviteModerated
public ModeratedInvitation inviteModerated(String inviteeComments, String inviteeUserName, Invitation.ResourceType resourceType, String resourceName, String inviteeRole) Start the invitation process for a ModeratedInvitation- Specified by:
inviteModeratedin interfaceInvitationService- Parameters:
inviteeComments- why does the invitee want access to the resource ?inviteeUserName- who is to be invitedresourceType- Invitation .ResourceType what resource type ?resourceName- which resourceinviteeRole- which role ?
-
accept
Invitee accepts this invitation Nominated Invitaton process only- Specified by:
acceptin interfaceInvitationService- Parameters:
invitationId- the invitation idticket- the ticket produced when creating the invitation.- Returns:
- the invitation
-
approve
Moderator approves this invitation- Specified by:
approvein interfaceInvitationService- Parameters:
invitationId- the request idreason- comments about the acceptance
-
reject
User or moderator rejects this request- Specified by:
rejectin interfaceInvitationService- Parameters:
invitationId- Stringreason- , optional reason for rejection
-
cancel
cancel this request- Specified by:
cancelin interfaceInvitationService
-
getInvitation
Get an invitation from its invitation id
Invitations are returned which may be in progress or completed.- Specified by:
getInvitationin interfaceInvitationService- Parameters:
invitationId- ;- Returns:
- the invitation.
- Throws:
InvitationExceptionNotFound- the invitation does not exist.InvitationExceptionUserError
-
listPendingInvitationsForInvitee
list Invitations for a specific person/invitee- Specified by:
listPendingInvitationsForInviteein interfaceInvitationService- Parameters:
invitee- alfresco user id of person being invited
-
listPendingInvitationsForInvitee
public List<Invitation> listPendingInvitationsForInvitee(String invitee, Invitation.ResourceType resourceType) - Specified by:
listPendingInvitationsForInviteein interfaceInvitationService
-
listPendingInvitationsForResource
public List<Invitation> listPendingInvitationsForResource(Invitation.ResourceType resourceType, String resourceName) list Invitations for a specific resource- Specified by:
listPendingInvitationsForResourcein interfaceInvitationService- Parameters:
resourceType- Invitation.ResourceTyperesourceName- String
-
searchInvitation
Deprecated.This is the general search invitation method returningInvitationThis method has a hardcoded limit of 200 invitations to return. It has been deprecated and it is recommended to use the overloaded version for which you can specify an appropriate limit depending on the needs- Specified by:
searchInvitationin interfaceInvitationService- Parameters:
criteria- InvitationSearchCriteria search criteria- Returns:
- the list of invitations
-
searchInvitation
This is the general search invitation method returningInvitationThis is the recommended method to use for searching invitations; Consider that the performance of the method will be greatly influenced by the limit specified- Specified by:
searchInvitationin interfaceInvitationService- Parameters:
criteria- search criterialimit- maximum number of IDs to return. If less than 1, there is no limit.- Returns:
- the list of invitations
-
setWorkflowService
Set the workflow service- Parameters:
workflowService- WorkflowService
-
setWorkflowAdminService
- Parameters:
workflowAdminService- the workflowAdminService to set
-
getWorkflowService
- Returns:
- the workflow service
-
setActionService
- Parameters:
actionService- the actionService to set
-
setPersonService
-
getPersonService
-
setSiteService
-
getSiteService
-
setAuthenticationService
-
getAuthenticationService
-
setUserNameGenerator
-
getUserNameGenerator
-
setPasswordGenerator
-
getPasswordGenerator
-
setDictionaryService
-
setNamespaceService
-
getNamespaceService
-
setPermissionService
-
getPermissionService
-
setNodeService
-
getNodeService
-
updateModeratedInvitation
public ModeratedInvitation updateModeratedInvitation(String inviteeId, String siteShortName, String inviteeComments) Description copied from interface:InvitationServiceUpdate the invitee comments for an existing moderated invitation- Specified by:
updateModeratedInvitationin interfaceInvitationService- Returns:
- the invitation
-
beforeDeleteNode
NodeServicePolicies.BeforeDeleteNodePolicy Called immediatly prior to deletion of a web site.- Specified by:
beforeDeleteNodein interfaceNodeServicePolicies.BeforeDeleteNodePolicy- Parameters:
nodeRef- the node reference
-
generateWorkflowDescription
Generates a description for the workflow- Parameters:
siteInfo- The site to generate a description formessageId- 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:
isSendEmailsin interfaceInvitationService- Returns:
- true if emails are sent on invite.
-
setSysAdminParams
-
setTemplateService
-
setMessageService
- Parameters:
messageService- the messageService to set
-
setRepositoryHelper
- Parameters:
repositoryHelper- the repositoryHelper to set
-
setServiceRegistry
- Parameters:
serviceRegistry- the serviceRegistry to set
-
acceptNominatedInvitation
Description copied from interface:InvitationServiceModerator approves this invitation- Specified by:
acceptNominatedInvitationin interfaceInvitationService
-
approveModeratedInvitation
public void approveModeratedInvitation(String siteName, String invitee, String role, String reviewer) Description copied from interface:InvitationServiceModerator approves this invitation- Specified by:
approveModeratedInvitationin interfaceInvitationService
-
addSiteMembership
public void addSiteMembership(String invitee, String siteName, String role, String runAsUser, boolean overrideExisting) Add Invitee to Site with the site role that the inviter "started" the invite process with- Parameters:
invitee-siteName-role-runAsUser-siteService-overrideExisting-
-
rejectModeratedInvitation
public void rejectModeratedInvitation(String siteName, String invitee, String role, String reviewer, String resourceType, String reviewComments) Description copied from interface:InvitationServiceModerator rejects this invitation- Specified by:
rejectModeratedInvitationin interfaceInvitationService
-
deleteAuthenticationIfUnused
Description copied from interface:InvitationServiceClean up invitee user account and person node when no longer in use. They are deemed to no longer be in use when the invitee user account is still disabled and there are no outstanding pending invites for that invitee.- Specified by:
deleteAuthenticationIfUnusedin interfaceInvitationService
-
sendNominatedInvitation
Description copied from interface:InvitationServiceImplemented for backwards compatibility- Specified by:
sendNominatedInvitationin interfaceInvitationService
-
sendNominatedInvitation
public void sendNominatedInvitation(String inviteId, String emailTemplateXpath, String emailSubjectKey, Map<String, Object> executionVariables) Description copied from interface:InvitationServiceSends the invite email using the given template, subject localization key, and variables.- Specified by:
sendNominatedInvitationin interfaceInvitationServiceemailTemplateXpath- the XPath to the email template in the repositoryemailSubjectKey- the subject of the emailexecutionVariables- the variables used to populate the email
-
sendModeratedInvitation
public void sendModeratedInvitation(String inviteId, String emailTemplateXpath, String emailSubjectKey, Map<String, Object> executionVariables) Description copied from interface:InvitationServiceSends the site join request notification email using the given template, subject localization key, and variables.- Specified by:
sendModeratedInvitationin interfaceInvitationService
-
cancelInvitation
public void cancelInvitation(String siteName, String invitee, String inviteId, String currentInviteId) Description copied from interface:InvitationServiceInviter cancels this invitation- Specified by:
cancelInvitationin interfaceInvitationService
-
inviteModerated
public ModeratedInvitation inviteModerated(String inviteeComments, String inviteeUserName, Invitation.ResourceType resourceType, String resourceName, String inviteeRole, String clientName) Start the invitation process for a ModeratedInvitation- Specified by:
inviteModeratedin interfaceInvitationService- Parameters:
inviteeComments- why does the invitee want access to the resource ?inviteeUserName- who is to be invitedresourceType- Invitation .ResourceType what resource type ?resourceName- which resourceinviteeRole- which role ?clientName- which client
-