Class PlatformFunctions

    • Constructor Detail

      • PlatformFunctions

        public PlatformFunctions()
    • Method Detail

      • getPrincipal

        public NuxeoPrincipal getPrincipal​(String username,
                                           boolean fetchReferences)
        Since:
        2021.14
      • getPrincipalsFromGroup

        public Set<NuxeoPrincipal> getPrincipalsFromGroup​(String group,
                                                          boolean ignoreGroups)
      • getEmailsFromGroup

        public StringList getEmailsFromGroup​(String group,
                                             boolean ignoreGroups)
      • getEmails

        public StringList getEmails​(List<String> usernames,
                                    boolean usePrefix)
        Returns user emails
        Parameters:
        usernames - list of user names
        usePrefix - indicates if user resolution takes into account nuxeo prefix user:
        Since:
        5.5
      • nxqlEscape

        public String nxqlEscape​(String str)
        Escapes a string according to NXQL escaping rules.

        The resulting string is safe to include between single quotes in a NXQL expression.

        Parameters:
        str - the input string
        Returns:
        the escaped string
        Since:
        6.0-HF21, 7.10
      • concatenateIntoList

        public <T> List<T> concatenateIntoList​(List<T> list,
                                               Object... values)
        Concatenate into the list given as first argument other arguments. Other arguments will be explosed if it is a list of object. ex: concatenateInto(myList, a, anotherList) with a is scalar object and anotherList is a list of object will produced myList.add(a) and the same for each object contained into the anotherList list.
        Parameters:
        list - List of values of type A
        values - Value can be instance of Collection<Object> or an array of Objects or simply a scalar Object. If Null, the parameter is ignored
        Returns:
        the list that contains the list contain and value (see value description)
        Throws:
        ClassCastException - if in values there is at least one object type not compatible with the collection list
      • concatenateValuesAsNewList

        public <T> List<T> concatenateValuesAsNewList​(Object... values)
        Idem than concatenateInto except that a new list is created.
      • documentExists

        public boolean documentExists​(CoreSession session,
                                      String idOrPath)
        Checks if a document with the supplied id (or path) exists.
        Parameters:
        session - The CoreSession to obtain the document
        idOrPath - The document Id or path
        Returns:
        true if the document exists, or false otherwise