Class MentionManager

java.lang.Object
com.jalios.jcms.mention.MentionManager
All Implemented Interfaces:
JPropertiesListener

public final class MentionManager extends Object implements JPropertiesListener
  • Field Details

  • Method Details

    • getInstance

      public static MentionManager getInstance()
    • 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 String getMentionMailPrefixRegex()
      Returns:
      the mention regexp property value
      Since:
      jcms-9.0.1
    • getMentionPattern

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

      public 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 String getHtmlPrefix()
      Returns:
      the html prefix that will be added to the html of a mentioned member
      Since:
      jcms-9.0.1
    • getIconPrefixProp

      public 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 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 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 Set<Member> getMentionedMemberSet(String text)
      Parameters:
      text - the text to parse
      Returns:
      the Set of Member mentioned in given text
      Since:
      jcms-9.0.1
    • getMentionedMemberSet

      public Set<Member> getMentionedMemberSet(TypeFieldEntry tfe, 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(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 String getMentionEmailPrefixFromString(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(String emailPrefix)
      Parameters:
      emailPrefix - the email prefix
      Returns:
      a member from the cache
      Since:
      jcms-9.0.1
    • getDBMemberFromEmailPrefix

      public DBMember getDBMemberFromEmailPrefix(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
    • getTypeEntryMentionableFields

      public List<TypeFieldEntry> getTypeEntryMentionableFields(TypeEntry typeEntry)
      Parameters:
      typeEntry - the TypeEntry
      Returns:
      the list of wiki TypeFieldEntry for given TypeEntry
      Since:
      jcms-9.0.1
    • notifyMention

      @Deprecated public void notifyMention(Publication pub, 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, 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