Class AbstractIncomingMailFetchCriteria

    • Constructor Detail

      • AbstractIncomingMailFetchCriteria

        public AbstractIncomingMailFetchCriteria​(IncomingMailFetching fetching)
    • Method Detail

      • validate

        public boolean validate()
        A default validation of a Mail fetching.

        Specified by:
        validate in interface FetchCriteria
        Returns:
        true if the context validates the criteria, and the Mail should be fetched.
        Since:
        jcms-9.0.0
      • validateAuthkey

        protected boolean validateAuthkey​(Member author,
                                          java.lang.String recipient)
        Utility method to validate a recipient address given an author.
        Parameters:
        author - the author
        recipient - the recipient to test if it contains author's authkey
        Returns:
        true if recipient matches author's authkey
        Since:
        jcms-9.0.0
      • validateWorkspace

        public boolean validateWorkspace()
        Specified by:
        validateWorkspace in interface FetchCriteria
        Returns:
        true if workspace's state is compliant with Mail Message fetching.
        Since:
        jcms-9.0.0
      • validateAttachments

        public boolean validateAttachments()
      • validateWorkspace

        protected static boolean validateWorkspace​(Workspace ws,
                                                   MailMessage mail)
        Check that given Workspace is not closed, not model, and allows required Types publication.

        Static method for it to be possibly called manually.

        Parameters:
        ws - workspace to validate
        mail - the mail to fetch.
        Returns:
        true if author exist and is enabled
        Since:
        jcms-9.0.0
      • validateAuthor

        protected static boolean validateAuthor​(Member author,
                                                MailMessage mail)
        Check that given Member is not disabled, and he can publish required Types.

        Static method for it to be possibly called manually.

        Parameters:
        author - author to validate
        mail - the mail to fetch.
        Returns:
        true if author exist and is enabled
        Since:
        jcms-9.0.0
      • getAuthor

        public Member getAuthor()
        Specified by:
        getAuthor in interface FetchCriteria
        Returns:
        the Member to use as Mail's author.
        Since:
        jcms-9.0.0
      • getWorkspace

        public Workspace getWorkspace()
        Specified by:
        getWorkspace in interface FetchCriteria
        Returns:
        the Workspace to use as Mail's workspace.
        Since:
        jcms-9.0.0
      • getAvailableCategories

        public Category[] getAvailableCategories()
        Get the default categories to set on the new MailMessage.

        If a workspace is available, returns its wsTypeEntry's categories.

        Else, return TypeEntry's categories.

        Returns:
        the default categories to set