Class TagUtil

java.lang.Object
com.logicaldoc.util.TagUtil

public class TagUtil extends Object
Utility class for tags handling
Since:
4.5
Author:
Marco Meschieri - LogicalDOC
  • Field Details

  • Method Details

    • extractTags

      public static Set<String> extractTags(String tenantName, String words)
      Detects words in the passed string and creates a list of tags.
      Atention: Recognized tags are words of min. MIN_CHARS chars and max MAX_CHARS characters.
      Parameters:
      tenantName - name of the tenant
      words - a string of words (tags are separated by ,);
      Returns:
      the collection of tags
    • normalizeTags

      public static String normalizeTags(String tenantName, String words)
      Normalizes the passed string extracting all tags and producing anither string containing all tags separated by a comma.

      Atention: The returned string is not more long than MAX_FIELD_LENGTH characters.

      Parameters:
      tenantName - Name of the tenant
      words - The string to be normalized
      Returns:
      a string in the form "tag1,tag2,tag3"