Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.storage.sql.db
Class EmbeddedFunctions

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

public class EmbeddedFunctions
extends java.lang.Object

Functions used as stored procedures for Derby and H2.

Author:
Florent Guillaume

Constructor Summary
EmbeddedFunctions()
           
 
Method Summary
static boolean isAccessAllowed(java.sql.Connection conn, java.io.Serializable id, java.util.Set<java.lang.String> principals, java.util.Set<java.lang.String> permissions)
          Checks if access to a document is allowed.
static boolean isAccessAllowed(java.io.Serializable id, java.util.Set<java.lang.String> principals, java.util.Set<java.lang.String> permissions)
          Checks if access to a document is allowed.
static boolean isInTree(java.sql.Connection conn, java.io.Serializable id, java.io.Serializable baseId)
          Checks if an id is a (strict) descendant of a given base id.
static boolean isInTree(java.io.Serializable id, java.io.Serializable baseId)
          Checks if an id is a (strict) descendant of a given base id.
static java.lang.String parseFullText(java.lang.String string1, java.lang.String string2)
          Extracts the words from a string for simple fulltext indexing.
static java.lang.String parseWord(java.lang.String string)
           
static java.util.Set<java.lang.String> split(java.lang.String string)
           
static java.util.Set<java.lang.String> split(java.lang.String string, char sep)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedFunctions

public EmbeddedFunctions()
Method Detail

isInTree

public static boolean isInTree(java.io.Serializable id,
                               java.io.Serializable baseId)
                        throws java.sql.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:
java.sql.SQLException

isInTree

public static boolean isInTree(java.sql.Connection conn,
                               java.io.Serializable id,
                               java.io.Serializable baseId)
                        throws java.sql.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:
java.sql.SQLException

isAccessAllowed

public static boolean isAccessAllowed(java.io.Serializable id,
                                      java.util.Set<java.lang.String> principals,
                                      java.util.Set<java.lang.String> permissions)
                               throws java.sql.SQLException
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:
java.sql.SQLException

isAccessAllowed

public static boolean isAccessAllowed(java.sql.Connection conn,
                                      java.io.Serializable id,
                                      java.util.Set<java.lang.String> principals,
                                      java.util.Set<java.lang.String> permissions)
                               throws java.sql.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
Throws:
java.sql.SQLException

parseFullText

public static java.lang.String parseFullText(java.lang.String string1,
                                             java.lang.String string2)
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

parseWord

public static final java.lang.String parseWord(java.lang.String string)

split

public static java.util.Set<java.lang.String> split(java.lang.String string)

split

public static java.util.Set<java.lang.String> split(java.lang.String string,
                                                    char sep)

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.