Class InvitationServiceImpl

    • 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
      • setNominatedInvitationWorkflowId

        public void setNominatedInvitationWorkflowId​(java.lang.String nominatedInvitationWorkflowId)
        Sets the nominated invite activiti workflow definition for internal users
        Parameters:
        nominatedInvitationWorkflowId -
      • setNominatedInvitationExternalWorkflowId

        public void setNominatedInvitationExternalWorkflowId​(java.lang.String nominatedInvitationExternalWorkflowId)
        Sets the nominated invite activiti workflow definition for external users
        Parameters:
        nominatedInvitationExternalWorkflowId -
      • setModeratedInvitationWorkflowId

        public void setModeratedInvitationWorkflowId​(java.lang.String moderatedInvitationWorkflowId)
        Sets the moderated invite activiti workflow definition
        Parameters:
        moderatedInvitationWorkflowId -
      • init

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

        public java.util.List<java.lang.String> 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
        resourceType - resourceType
        resourceName - String
        inviteeRole - String
        serverPath - String
        acceptUrl - String
        rejectUrl - 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:
        InvitationException
        InvitationExceptionUserError
        InvitationExceptionForbidden
      • inviteNominated

        public NominatedInvitation inviteNominated​(java.lang.String inviteeUserName,
                                                   Invitation.ResourceType resourceType,
                                                   java.lang.String resourceName,
                                                   java.lang.String inviteeRole,
                                                   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
        resourceType - resourceType
        resourceName - String
        inviteeRole - String
        acceptUrl - String
        rejectUrl - 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:
        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 acceptUrl,
                                                   java.lang.String rejectUrl)
        Start the invitation process for a NominatedInvitation
        Specified by:
        inviteNominated in interface InvitationService
        Parameters:
        inviteeFirstName - String
        inviteeLastName - String
        inviteeEmail - String
        resourceType - Invitation.ResourceType
        resourceName - String
        inviteeRole - String
        acceptUrl - String
        rejectUrl - 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:
        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 - String
        inviteeLastName - String
        inviteeEmail - String
        resourceType - Invitation.ResourceTyp
        resourceName - String
        inviteeRole - String
        serverPath - String
        acceptUrl - String
        rejectUrl - 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:
        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:
        inviteeComments - why does the invitee want access to the resource ?
        inviteeUserName - who is to be invited
        resourceType - Invitation .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:
        invitationId - the request id
        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 - String
        reason - , optional reason for rejection
      • listPendingInvitationsForInvitee

        public java.util.List<Invitation> 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
      • searchInvitation

        public java.util.List<Invitation> searchInvitation​(InvitationSearchCriteria criteria)
        Deprecated.
        This is the general search invitation method returning Invitation This 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:
        searchInvitation in interface InvitationService
        Parameters:
        criteria - InvitationSearchCriteria search criteria
        Returns:
        the list of invitations
      • searchInvitation

        public java.util.List<Invitation> searchInvitation​(InvitationSearchCriteria criteria,
                                                           int limit)
        This is the general search invitation method returning Invitation This 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:
        searchInvitation in interface InvitationService
        Parameters:
        criteria - search criteria
        limit - maximum number of IDs to return. If less than 1, there is no limit.
        Returns:
        the list of invitations
      • setWorkflowService

        public void setWorkflowService​(WorkflowService workflowService)
        Set the workflow service
        Parameters:
        workflowService - WorkflowService
      • setWorkflowAdminService

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

        public WorkflowService getWorkflowService()
        Returns:
        the workflow service
      • setActionService

        public void setActionService​(ActionService actionService)
        Parameters:
        actionService - the actionService to set
      • setPersonService

        public void setPersonService​(PersonService personService)
      • setSiteService

        public void setSiteService​(SiteService siteService)
      • setUserNameGenerator

        public void setUserNameGenerator​(UserNameGenerator usernameGenerator)
      • setPasswordGenerator

        public void setPasswordGenerator​(PasswordGenerator passwordGenerator)
      • 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()
      • updateModeratedInvitation

        public ModeratedInvitation updateModeratedInvitation​(java.lang.String inviteeId,
                                                             java.lang.String siteShortName,
                                                             java.lang.String inviteeComments)
        Description copied from interface: InvitationService
        Update the invitee comments for an existing moderated invitation
        Specified by:
        updateModeratedInvitation in interface InvitationService
        Returns:
        the invitation
      • 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.
      • setSysAdminParams

        public void setSysAdminParams​(SysAdminParams sysAdminParams)
      • setTemplateService

        public void setTemplateService​(TemplateService templateService)
      • setMessageService

        public void setMessageService​(MessageService messageService)
        Parameters:
        messageService - the messageService to set
      • setRepositoryHelper

        public void setRepositoryHelper​(Repository repositoryHelper)
        Parameters:
        repositoryHelper - the repositoryHelper to set
      • setServiceRegistry

        public void setServiceRegistry​(ServiceRegistry serviceRegistry)
        Parameters:
        serviceRegistry - the serviceRegistry to set
      • acceptNominatedInvitation

        public void acceptNominatedInvitation​(java.lang.String siteName,
                                              java.lang.String invitee,
                                              java.lang.String role,
                                              java.lang.String inviter)
        Description copied from interface: InvitationService
        Moderator approves this invitation
        Specified by:
        acceptNominatedInvitation in interface InvitationService
      • approveModeratedInvitation

        public void approveModeratedInvitation​(java.lang.String siteName,
                                               java.lang.String invitee,
                                               java.lang.String role,
                                               java.lang.String reviewer)
        Description copied from interface: InvitationService
        Moderator approves this invitation
        Specified by:
        approveModeratedInvitation in interface InvitationService
      • addSiteMembership

        public void addSiteMembership​(java.lang.String invitee,
                                      java.lang.String siteName,
                                      java.lang.String role,
                                      java.lang.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​(java.lang.String siteName,
                                              java.lang.String invitee,
                                              java.lang.String role,
                                              java.lang.String reviewer,
                                              java.lang.String resourceType,
                                              java.lang.String reviewComments)
        Description copied from interface: InvitationService
        Moderator rejects this invitation
        Specified by:
        rejectModeratedInvitation in interface InvitationService
      • deleteAuthenticationIfUnused

        public void deleteAuthenticationIfUnused​(java.lang.String invitee,
                                                 java.lang.String currentInviteId)
        Description copied from interface: InvitationService
        Clean 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:
        deleteAuthenticationIfUnused in interface InvitationService
      • sendNominatedInvitation

        public void sendNominatedInvitation​(java.lang.String inviteId,
                                            java.util.Map<java.lang.String,​java.lang.Object> executionVariables)
        Description copied from interface: InvitationService
        Implemented for backwards compatibility
        Specified by:
        sendNominatedInvitation in interface InvitationService
      • sendNominatedInvitation

        public void sendNominatedInvitation​(java.lang.String inviteId,
                                            java.lang.String emailTemplateXpath,
                                            java.lang.String emailSubjectKey,
                                            java.util.Map<java.lang.String,​java.lang.Object> executionVariables)
        Description copied from interface: InvitationService
        Sends the invite email using the given template, subject localization key, and variables.
        Specified by:
        sendNominatedInvitation in interface InvitationService
        emailTemplateXpath - the XPath to the email template in the repository
        emailSubjectKey - the subject of the email
        executionVariables - the variables used to populate the email
      • sendModeratedInvitation

        public void sendModeratedInvitation​(java.lang.String inviteId,
                                            java.lang.String emailTemplateXpath,
                                            java.lang.String emailSubjectKey,
                                            java.util.Map<java.lang.String,​java.lang.Object> executionVariables)
        Description copied from interface: InvitationService
        Sends the site join request notification email using the given template, subject localization key, and variables.
        Specified by:
        sendModeratedInvitation in interface InvitationService
      • cancelInvitation

        public void cancelInvitation​(java.lang.String siteName,
                                     java.lang.String invitee,
                                     java.lang.String inviteId,
                                     java.lang.String currentInviteId)
        Description copied from interface: InvitationService
        Inviter cancels this invitation
        Specified by:
        cancelInvitation in interface InvitationService