Class AlfrescoQualifiedNameTranslator

java.lang.Object
org.alfresco.repo.search.impl.elasticsearch.shared.translator.AlfrescoQualifiedNameTranslator

public class AlfrescoQualifiedNameTranslator extends Object
  • Constructor Details

    • AlfrescoQualifiedNameTranslator

      public AlfrescoQualifiedNameTranslator()
  • Method Details

    • encode

      public static String encode(String qualifiedName)
      From the URLEncoder official JavaDoc: "Data characters that are allowed in a URI but do not have a reserved purpose are called unreserved. These include upper and lower case letters, decimal digits, and a limited set of punctuation marks and symbols.

      unreserved = alphanum | mark

      mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"

      Unreserved characters can be escaped without changing the semantics of the URI, but this should not be done unless the URI is being used in a context that does not allow the unescaped character to appear."

      In our context there are some special characters that are reserved in Elasticsearch and not encoded out of the box from the URLEncoder: mark = "-" | "+" | "." | "*" | " "

      They are replaced explicitly to be consistent with the rest of the encoding. N.B. it's not mandatory to encode "-" | "+" | "*" , but they can cause troubles at query time

      Parameters:
      qualifiedName -
      Returns:
    • decode

      public static String decode(String elasticsearchFieldName)