Class EmbeddedFunctions

java.lang.Object
org.nuxeo.ecm.core.storage.sql.db.EmbeddedFunctions
Direct Known Subclasses:
H2Functions

public class EmbeddedFunctions extends Object
Functions used as stored procedures for H2.
Author:
Florent Guillaume
  • Field Details

  • Constructor Details

    • EmbeddedFunctions

      public EmbeddedFunctions()
  • Method Details

    • isInTree

      public static boolean isInTree(Serializable id, Serializable baseId) throws SQLException
      Checks if an id is a (strict) descendant of a given base id.
      Parameters:
      id - the id to check for
      baseId - the base id
      Throws:
      SQLException
    • isInTree

      public static boolean isInTree(Connection conn, Serializable id, Serializable baseId) throws SQLException
      Checks if an id is a (strict) descendant of a given base id.
      Parameters:
      conn - the connection to the database
      id - the id to check for
      baseId - the base id
      Throws:
      SQLException
    • isAccessAllowed

      @Deprecated public static boolean isAccessAllowed(Serializable id, Set<String> principals, Set<String> permissions) throws SQLException
      Deprecated.
      since 11.3, unused
      Checks if access to a document is allowed.

      This implements in SQL the ACL-based security policy logic.

      Parameters:
      id - the id of the document
      principals - the allowed identities
      permissions - the allowed permissions
      Throws:
      SQLException
    • isAccessAllowed

      @Deprecated public static boolean isAccessAllowed(Connection conn, Serializable id, Set<String> principals, Set<String> permissions) throws SQLException
      Deprecated.
      since 11.3, use other signature
      Throws:
      SQLException
    • isAccessAllowed

      public static boolean isAccessAllowed(Connection conn, Serializable id, Set<String> principals, Set<String> permissions, boolean disableVersionACL, boolean disableReadVersionPermission) throws SQLException
      Checks if access to a document is allowed.

      This implements in SQL the ACL-based security policy logic.

      Parameters:
      conn - the database connection
      id - the id of the document
      principals - the allowed identities
      permissions - the allowed permissions
      disableVersionACL - whether ACLs on a version are disabled
      disableReadVersionPermission - whether the ReadVersion permission is disabled
      Throws:
      SQLException
      Since:
      11.3
    • getRowInfo

      protected static EmbeddedFunctions.RowInfo getRowInfo(PreparedStatement psHier, PreparedStatement psVer, Serializable id) throws SQLException
      Throws:
      SQLException
    • getAccess

      protected static Boolean getAccess(PreparedStatement psAcl, Serializable id, Set<String> principals, Set<String> permissions, boolean replaceReadVersionPermission) throws SQLException
      Throws:
      SQLException
    • parseFullText

      @Deprecated(since="11.1") public static String parseFullText(String string1, String string2)
      Deprecated.
      unused
      Extracts the words from a string for simple fulltext indexing.
      Parameters:
      string1 - the first string
      string2 - the second string
      Returns:
      a string with extracted words
    • parseFullText

      @Deprecated(since="11.1") protected static Set<String> parseFullText(String string)
      Deprecated.
      unused
    • matchesFullText

      @Deprecated(since="11.1") protected static boolean matchesFullText(String fulltext, String query)
      Deprecated.
      unused
      Checks if the passed query expression matches the fulltext.
      Parameters:
      fulltext - the fulltext, space-separated words
      query - a list of space-separated words
      Returns:
      true if all the words are in the fulltext
    • parseWord

      @Deprecated(since="11.1") public static final String parseWord(String string)
      Deprecated.
      unused
    • split

      public static Set<String> split(String string)
    • split

      public static Set<String> split(String string, char sep)