Class MentionManager

    • Field Detail

      • mentionableTFEByTypeMap

        public java.util.Map<TypeEntry,​java.util.List<TypeFieldEntry>> mentionableTFEByTypeMap
    • Method Detail

      • propertiesChange

        public void propertiesChange​(JProperties properties)
        Description copied from interface: JPropertiesListener
        Invoked after properties have been modified in JCMS and save on disk.

        You cannot alter the value received in parameters.

        Note that properties parameter may be null, a limited set of site properties, or all site properties.

        To check that a property has been modified, reload the "current" property instead using channel.getProperties or channel.getProperty.

        Specified by:
        propertiesChange in interface JPropertiesListener
        Parameters:
        properties - the properties which have been submitted to change
      • getMentionMailPrefixRegex

        public java.lang.String getMentionMailPrefixRegex()
        Returns:
        the mention regexp property value
        Since:
        jcms-9.0.1
      • getMentionPattern

        public java.util.regex.Pattern getMentionPattern()
        Returns:
        the mention regexp Pattern
        Since:
        jcms-9.0.1
      • getMentionMailPrefixPattern

        public java.util.regex.Pattern getMentionMailPrefixPattern()
        Returns:
        the mention mail prefix regexp Pattern
        Since:
        jcms-9.0.1
      • isMentionEnabled

        public boolean isMentionEnabled()
        Returns:
        true if mentions are enabled on this webapp
        Since:
        jcms-9.0.1
      • getHtmlPrefix

        public java.lang.String getHtmlPrefix()
        Returns:
        the html prefix that will be added to the html of a mentioned member
        Since:
        jcms-9.0.1
      • getIconPrefixProp

        public java.lang.String getIconPrefixProp()
        Returns:
        the icon prefix that will be added to the html of a mentioned member
        Since:
        jcms-9.0.1
      • hasWhiteSpacePrefix

        public boolean hasWhiteSpacePrefix()
        Returns:
        true if there must be a white space before the rendered mention in wiki
        Since:
        jcms-9.0.1
      • getMentionHtmlPrefix

        public java.lang.String getMentionHtmlPrefix()
        Returns the html prefix build with the following properties :
        • mention.htmlprefix : an html prefix
        • mention.html.icon.prefix-prop: an icon property
        • mention.html.whitespace.prefix: a boolean to define if a whitespace is needed
        Note : if an icon is defined, the htmlprefix is not used
        Returns:
        the prefix that is displayed before the member name when rendered in a wiki
        Since:
        jcms-9.0.1
      • getMentionedMemberSet

        public java.util.Set<Member> getMentionedMemberSet​(Publication pub)
        Returns mentioned member set in the given publication by searching through all its values (multivaluated && multilingual) An empty set is returned if the Publication is not in a visible state
        Parameters:
        pub - the Publication
        Returns:
        the Set of Member mentioned in given Publication
        Since:
        jcms-9.0.1
      • getMentionedMemberSet

        public java.util.Set<Member> getMentionedMemberSet​(TypeFieldEntry tfe,
                                                           java.lang.String text)
        Retrieve member mentionned in the specified text.
        Parameters:
        tfe - the TypeFieldEntry corresponding to the field in which text is stored, used to detect wiki vs wysiwyg field, may be null but not recommended.
        text - the text to parse
        Returns:
        the Set of Member mentioned in given text
        Since:
        jcms-10.0.0
      • getMemberFromEmailPrefix

        public Member getMemberFromEmailPrefix​(java.lang.String emailPrefix)
        Returns a member by searching in Store Members and DBMembers any matching member with email starting with the given email prefix
        Parameters:
        emailPrefix - the prefix of the member email
        Returns:
        a member based on given email prefix
        Since:
        jcms-9.0.1
      • getMentionEmailPrefixFromString

        public java.lang.String getMentionEmailPrefixFromString​(java.lang.String text)
        Parameters:
        text - the text to extract mail from
        Returns:
        the string matched after the @ symbol of given text
        Since:
        jcms-9.0.2
      • getMemberFromEmailPrefixCache

        public Member getMemberFromEmailPrefixCache​(java.lang.String emailPrefix)
        Parameters:
        emailPrefix - the email prefix
        Returns:
        a member from the cache
        Since:
        jcms-9.0.1
      • getDBMemberFromEmailPrefix

        public DBMember getDBMemberFromEmailPrefix​(java.lang.String emailPrefix)
        Returns a DBMember, which is an account, and whose mail starts with the given email prefix
        Parameters:
        emailPrefix - the email prefix
        Returns:
        a DBMember whose mail starts with the given email prefix
        Since:
        jcms-9.0.1
      • notifyMention

        @Deprecated
        public void notifyMention​(Publication pub,
                                  java.util.Set<Member> memberSet)
        Deprecated.
        Notifies mentioned member set on the given Publication
        Parameters:
        pub - the Publication
        memberSet - the set of members that will receive the alert
        Since:
        jcms-9.0.1
      • notifyMention

        public void notifyMention​(Publication pub,
                                  Member opAuthor,
                                  java.util.Set<Member> memberSet)
        Notifies mentioned member set on the given Publication
        Parameters:
        pub - the Publication
        opAuthor - the op author
        memberSet - the set of members that will receive the alert
        Since:
        jcms-9.0.2