public class PlatformFunctions extends CoreFunctions
Constructor and Description |
---|
PlatformFunctions() |
Modifier and Type | Method and Description |
---|---|
<T> List<T> |
concatenateIntoList(List<T> list,
Object... values)
Concatenate into the list given as first argument other arguments.
|
<T> List<T> |
concatenateValuesAsNewList(Object... values)
Idem than concatenateInto except that a new list is created.
|
boolean |
documentExists(CoreSession session,
String idOrPath)
Checks if a document with the supplied id (or path) exists.
|
DirectoryService |
getDirService() |
protected String |
getEmail(NuxeoPrincipal principal,
String userSchemaName,
String userEmailFieldName) |
String |
getEmail(String username) |
StringList |
getEmails(List<String> usernames) |
StringList |
getEmails(List<String> usernames,
boolean usePrefix)
Returns user emails
|
StringList |
getEmailsFromGroup(String group) |
StringList |
getEmailsFromGroup(String group,
boolean ignoreGroups) |
String |
getNextId(String key) |
String |
getNextId(String key,
String sequencerName) |
NuxeoPrincipal |
getPrincipal(String username) |
StringList |
getPrincipalEmails(List<NuxeoPrincipal> principals) |
Set<NuxeoPrincipal> |
getPrincipalsFromGroup(String group) |
Set<NuxeoPrincipal> |
getPrincipalsFromGroup(String group,
boolean ignoreGroups) |
UserManager |
getUserManager() |
String |
getVocabularyLabel(String voc,
String key) |
static String |
htmlEscape(String str) |
static String |
nxqlEscape(String str)
Escapes a string according to NXQL escaping rules.
|
calendar, date, escapeHtml
public PlatformFunctions()
public UserManager getUserManager()
public DirectoryService getDirService()
public String getVocabularyLabel(String voc, String key)
public NuxeoPrincipal getPrincipal(String username)
protected String getEmail(NuxeoPrincipal principal, String userSchemaName, String userEmailFieldName)
public Set<NuxeoPrincipal> getPrincipalsFromGroup(String group)
public Set<NuxeoPrincipal> getPrincipalsFromGroup(String group, boolean ignoreGroups)
public StringList getEmailsFromGroup(String group)
public StringList getEmailsFromGroup(String group, boolean ignoreGroups)
public StringList getPrincipalEmails(List<NuxeoPrincipal> principals)
public StringList getEmails(List<String> usernames)
public StringList getEmails(List<String> usernames, boolean usePrefix)
usernames
- list of user namesusePrefix
- indicates if user resolution takes into account nuxeo prefix user:public static String htmlEscape(String str)
public static String nxqlEscape(String str)
The resulting string is safe to include between single quotes in a NXQL expression.
str
- the input stringpublic <T> List<T> concatenateIntoList(List<T> list, Object... values)
T
- list
- List of values of type Avalues
- Value can be instance of java.util.Collectionxxxxx
- if in values there is at least one object type not compatible with the collection listpublic <T> List<T> concatenateValuesAsNewList(Object... values)
public boolean documentExists(CoreSession session, String idOrPath)
session
- The CoreSession to obtain the documentidOrPath
- The document Id or pathCopyright © 2018 Nuxeo. All rights reserved.