public abstract class BaseSession extends Object implements Session
| Modifier and Type | Field and Description |
|---|---|
protected Directory |
directory |
protected static String |
MULTI_TENANT_ID_FORMAT |
protected PermissionDescriptor[] |
permissions |
protected static String |
POWER_USERS_GROUP |
protected static String |
READONLY_ENTRY_FLAG |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseSession(Directory directory) |
| Modifier and Type | Method and Description |
|---|---|
static String |
computeMultiTenantDirectoryId(String tenantId,
String id)
Compute a multi tenant directory id based on the given
tenantId. |
static DocumentModel |
createEntryModel(String sessionId,
String schema,
String id,
Map<String,Object> values)
Returns a bare document model suitable for directory implementations.
|
static DocumentModel |
createEntryModel(String sessionId,
String schema,
String id,
Map<String,Object> values,
boolean readOnly)
Returns a bare document model suitable for directory implementations.
|
abstract Directory |
getDirectory()
To be implemented with a more specific return type.
|
String |
getIdField()
The Id field is the name of the field that is used a primary key: unique and not null value in the whole
directory.
|
String |
getPasswordField() |
boolean |
isAuthenticating()
Tells whether the directory implementation can be used as an authenticating backend for the UserManager (based on
login / password check).
|
boolean |
isCurrentUserAllowed(String permissionTocheck)
Check the current user rights for the given permission against the permission descriptor
|
boolean |
isReadOnly() |
static boolean |
isReadOnlyEntry(DocumentModel entry)
Test whether entry comes from a read-only back-end directory.
|
protected static Map<String,Object> |
mkObjectMap(Map<String,Serializable> map) |
protected static Map<String,Serializable> |
mkSerializableMap(Map<String,Object> map) |
DocumentModelList |
query(Map<String,Serializable> filter,
Set<String> fulltext,
Map<String,String> orderBy,
boolean fetchReferences,
int limit,
int offset)
Executes a query with the possibility to fetch a subset of the results.
|
static void |
setReadOnlyEntry(DocumentModel entry)
Set the read-only flag of a directory entry.
|
static void |
setReadWriteEntry(DocumentModel entry)
Unset the read-only flag of a directory entry.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitauthenticate, close, createEntry, createEntry, deleteEntry, deleteEntry, deleteEntry, getEntries, getEntry, getEntry, getProjection, getProjection, hasEntry, query, query, query, query, updateEntryprotected static final String POWER_USERS_GROUP
protected static final String READONLY_ENTRY_FLAG
protected static final String MULTI_TENANT_ID_FORMAT
protected PermissionDescriptor[] permissions
protected BaseSession(Directory directory)
public abstract Directory getDirectory()
public String getIdField()
SessiongetIdField in interface Sessionpublic String getPasswordField()
getPasswordField in interface Sessionpublic boolean isAuthenticating()
SessionisAuthenticating in interface Sessionpublic boolean isReadOnly()
isReadOnly in interface Sessionpublic boolean isCurrentUserAllowed(String permissionTocheck)
public static DocumentModel createEntryModel(String sessionId, String schema, String id, Map<String,Object> values) throws PropertyException
Can be used for creation screen.
PropertyExceptionpublic static DocumentModel createEntryModel(String sessionId, String schema, String id, Map<String,Object> values, boolean readOnly) throws PropertyException
Allow setting the readonly entry flag to Boolean.TRUE. See Session#isReadOnlyEntry(DocumentModel)
PropertyExceptionprotected static Map<String,Serializable> mkSerializableMap(Map<String,Object> map)
protected static Map<String,Object> mkObjectMap(Map<String,Serializable> map)
public static boolean isReadOnlyEntry(DocumentModel entry)
public static void setReadOnlyEntry(DocumentModel entry)
public static void setReadWriteEntry(DocumentModel entry)
public static String computeMultiTenantDirectoryId(String tenantId, String id)
tenantId.public DocumentModelList query(Map<String,Serializable> filter, Set<String> fulltext, Map<String,String> orderBy, boolean fetchReferences, int limit, int offset) throws DirectoryException
Sessionquery in interface Sessionlimit - maximum number of results ignored if less than 1offset - number of rows skipped before starting, will be 0 if less than 0.DirectoryExceptionSession.query(Map, Set, Map, boolean)Copyright © 2016 Nuxeo SA. All rights reserved.