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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classEmbeddedFunctions.RowInfo
-
Field Summary
Fields Modifier and Type Field Description protected static StringREADprotected static StringREAD_VERSION
-
Constructor Summary
Constructors Constructor Description EmbeddedFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static BooleangetAccess(PreparedStatement psAcl, Serializable id, Set<String> principals, Set<String> permissions, boolean replaceReadVersionPermission)protected static EmbeddedFunctions.RowInfogetRowInfo(PreparedStatement psHier, PreparedStatement psVer, Serializable id)static booleanisAccessAllowed(Serializable id, Set<String> principals, Set<String> permissions)Deprecated.since 11.3, unusedstatic booleanisAccessAllowed(Connection conn, Serializable id, Set<String> principals, Set<String> permissions)Deprecated.since 11.3, use other signaturestatic booleanisAccessAllowed(Connection conn, Serializable id, Set<String> principals, Set<String> permissions, boolean disableVersionACL, boolean disableReadVersionPermission)Checks if access to a document is allowed.static booleanisInTree(Serializable id, Serializable baseId)Checks if an id is a (strict) descendant of a given base id.static booleanisInTree(Connection conn, Serializable id, Serializable baseId)Checks if an id is a (strict) descendant of a given base id.protected static booleanmatchesFullText(String fulltext, String query)Deprecated.unusedprotected static Set<String>parseFullText(String string)Deprecated.unusedstatic StringparseFullText(String string1, String string2)Deprecated.unusedstatic StringparseWord(String string)Deprecated.unusedstatic Set<String>split(String string)static Set<String>split(String string, char sep)
-
-
-
Field Detail
-
READ
protected static final String READ
- See Also:
- Constant Field Values
-
READ_VERSION
protected static final String READ_VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EmbeddedFunctions
public EmbeddedFunctions()
-
-
Method Detail
-
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 forbaseId- 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 databaseid- the id to check forbaseId- 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, unusedChecks if access to a document is allowed.This implements in SQL the ACL-based security policy logic.
- Parameters:
id- the id of the documentprincipals- the allowed identitiespermissions- 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 connectionid- the id of the documentprincipals- the allowed identitiespermissions- the allowed permissionsdisableVersionACL- whether ACLs on a version are disableddisableReadVersionPermission- 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.unusedExtracts the words from a string for simple fulltext indexing.- Parameters:
string1- the first stringstring2- 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.unusedChecks if the passed query expression matches the fulltext.- Parameters:
fulltext- the fulltext, space-separated wordsquery- a list of space-separated words- Returns:
trueif all the words are in the fulltext
-
parseWord
@Deprecated(since="11.1") public static final String parseWord(String string)
Deprecated.unused
-
-