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​(String nominatedInvitationWorkflowId)
        Sets the nominated invite activiti workflow definition for internal users
        Parameters:
        nominatedInvitationWorkflowId -
      • setNominatedInvitationExternalWorkflowId

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

        public void setModeratedInvitationWorkflowId​(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 List<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
      • inviteModerated

        public ModeratedInvitation inviteModerated​(String inviteeComments,
                                                   String inviteeUserName,
                                                   Invitation.ResourceType resourceType,
                                                   String resourceName,
                                                   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​(String invitationId,
                                 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​(String invitationId,
                                  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​(String invitationId,
                                 String reason)
        User or moderator rejects this request
        Specified by:
        reject in interface InvitationService
        Parameters:
        invitationId - String
        reason - , optional reason for rejection
      • searchInvitation

        public 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 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​(DictionaryService dictionaryService)
      • setNamespaceService

        public void setNamespaceService​(NamespaceService namespaceService)
      • setPermissionService

        public void setPermissionService​(PermissionService permissionService)
      • setNodeService

        public void setNodeService​(NodeService nodeService)
      • generateWorkflowDescription

        protected String generateWorkflowDescription​(SiteInfo siteInfo,
                                                     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
      • 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 -
      • deleteAuthenticationIfUnused

        public void deleteAuthenticationIfUnused​(String invitee,
                                                 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​(String inviteId,
                                            String emailTemplateXpath,
                                            String emailSubjectKey,
                                            Map<String,​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