Class RightsManagerUsersApi


  • public class RightsManagerUsersApi
    extends Api
    API for managing users.
    Since:
    1.1.2, 1.2M2
    Version:
    $Id: bed42a54ae09900e63f5f618f4784881f9999a01 $
    • Field Detail

      • CONTEXT_LASTERRORCODE

        public static final String CONTEXT_LASTERRORCODE
        Field name of the last error code inserted in context.
        See Also:
        Constant Field Values
      • CONTEXT_LASTEXCEPTION

        public static final String CONTEXT_LASTEXCEPTION
        Field name of the last api exception inserted in context.
        See Also:
        Constant Field Values
      • LOGGER

        protected static final org.slf4j.Logger LOGGER
        The logging toolkit.
    • Constructor Detail

      • RightsManagerUsersApi

        public RightsManagerUsersApi​(XWikiContext context)
        Create an instance of RightsManageRightsApi.
        Parameters:
        context - the XWiki context.
    • Method Detail

      • countAllUsers

        public int countAllUsers()
                          throws XWikiException
        Returns:
        the number of users in the current wiki.
        Throws:
        XWikiException - error when getting number of users.
      • countAllMatchedUsers

        public int countAllMatchedUsers​(Map<?,​?> matchFields)
                                 throws XWikiException
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        the number of users in the current wiki.
        Throws:
        XWikiException - error when getting number of users.
      • countAllWikiUsers

        public int countAllWikiUsers​(String wikiName)
                              throws XWikiException
        Get the number of users in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search for users.
        Returns:
        the number of users in the provided wiki.
        Throws:
        XWikiException - error when getting number of users.
      • countAllMatchedWikiUsers

        public int countAllMatchedWikiUsers​(String wikiName,
                                            Map<?,​?> matchFields)
                                     throws XWikiException
        Get the number of users in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search for users.
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        the number of users in the provided wiki.
        Throws:
        XWikiException - error when getting number of users.
      • countAllGlobalUsers

        public int countAllGlobalUsers()
                                throws XWikiException
        Returns:
        the number of users in the main wiki.
        Throws:
        XWikiException - error when getting number of users.
      • countAllMatchedGlobalUsers

        public int countAllMatchedGlobalUsers​(Map<?,​?> matchFields)
                                       throws XWikiException
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        the number of users in the main wiki.
        Throws:
        XWikiException - error when getting number of users.
      • countAllLocalUsers

        public int countAllLocalUsers()
                               throws XWikiException
        Returns:
        the number of users in the current wiki.
        Throws:
        XWikiException - error when getting number of users.
      • countAllMatchedLocalUsers

        public int countAllMatchedLocalUsers​(Map<?,​?> matchFields)
                                      throws XWikiException
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        the number of users in the current wiki.
        Throws:
        XWikiException - error when getting number of users.
      • getAllUsersNames

        public List<String> getAllUsersNames​(int nb,
                                             int start)
                                      throws XWikiException
        Get all users names in the main wiki and the current wiki.
        Parameters:
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllUsersNames

        public List<String> getAllUsersNames()
                                      throws XWikiException
        Get all users names in the main wiki and the current wiki.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedUsersNames

        public List<String> getAllMatchedUsersNames​(Map<?,​?> matchFields)
                                             throws XWikiException
        Get all users names in the main wiki and the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedUsersNames

        public List<String> getAllMatchedUsersNames​(Map<?,​?> matchFields,
                                                    int nb,
                                                    int start)
                                             throws XWikiException
        Get all users names in the main wiki and the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedUsersNames

        public List<String> getAllMatchedUsersNames​(Map<?,​?> matchFields,
                                                    int nb,
                                                    int start,
                                                    List<?> order)
                                             throws XWikiException
        Get all users names in the main wiki and the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        order - the fields to order from. It is a List containing :
        • "field name" for document fields
        • or ["filed name", "field type"] for object fields
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllGlobalUsersNames

        public List<String> getAllGlobalUsersNames​(int nb,
                                                   int start)
                                            throws XWikiException
        Get all users names in the main wiki.
        Parameters:
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedGlobalUsersNames

        public List<String> getAllMatchedGlobalUsersNames​(Map<?,​?> matchFields)
                                                   throws XWikiException
        Get all users names in the main wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedGlobalUsersNames

        public List<String> getAllMatchedGlobalUsersNames​(Map<?,​?> matchFields,
                                                          int nb,
                                                          int start)
                                                   throws XWikiException
        Get all users names in the main wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedGlobalUsersNames

        public List<String> getAllMatchedGlobalUsersNames​(Map<?,​?> matchFields,
                                                          int nb,
                                                          int start,
                                                          List<?> order)
                                                   throws XWikiException
        Get all users names in the main wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        order - the fields to order from. It is a List containing :
        • "field name" for document fields
        • or ["filed name", "field type"] for object fields
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllWikiUsersNames

        public List<String> getAllWikiUsersNames​(String wikiName,
                                                 int nb,
                                                 int start)
                                          throws XWikiException
        Get all users names in the provided wiki.
        Parameters:
        wikiName - the wiki where to search for users.
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllWikiUsersNames

        public List<String> getAllWikiUsersNames​(String wikiName)
                                          throws XWikiException
        Get all users names in the provided wiki.
        Parameters:
        wikiName - the wiki where to search for users.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedWikiUsersNames

        public List<String> getAllMatchedWikiUsersNames​(String wikiName,
                                                        Map<?,​?> matchFields)
                                                 throws XWikiException
        Get all users names in the provided wiki.
        Parameters:
        wikiName - the wiki where to search for users.
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedWikiUsersNames

        public List<String> getAllMatchedWikiUsersNames​(String wikiName,
                                                        Map<?,​?> matchFields,
                                                        int nb,
                                                        int start)
                                                 throws XWikiException
        Get all users names in the provided wiki.
        Parameters:
        wikiName - the wiki where to search for users.
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedWikiUsersNames

        public List<String> getAllMatchedWikiUsersNames​(String wikiName,
                                                        Map<?,​?> matchFields,
                                                        int nb,
                                                        int start,
                                                        List<?> order)
                                                 throws XWikiException
        Get all users names in the provided wiki.
        Parameters:
        wikiName - the wiki where to search for users.
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        order - the fields to order from. It is a List containing :
        • "field name" for document fields
        • or ["filed name", "field type"] for object fields
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllLocalUsersNames

        public List<String> getAllLocalUsersNames​(int nb,
                                                  int start)
                                           throws XWikiException
        Get all users names in the current wiki.
        Parameters:
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedLocalUsersNames

        public List<String> getAllMatchedLocalUsersNames​(Map<?,​?> matchFields)
                                                  throws XWikiException
        Get all users names in the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedLocalUsersNames

        public List<String> getAllMatchedLocalUsersNames​(Map<?,​?> matchFields,
                                                         int nb,
                                                         int start)
                                                  throws XWikiException
        Get all users names in the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedLocalUsersNames

        public List<String> getAllMatchedLocalUsersNames​(Map<?,​?> matchFields,
                                                         int nb,
                                                         int start,
                                                         List<?> order)
                                                  throws XWikiException
        Get all users names in the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        order - the fields to order from. It is a List containing :
        • "field name" for document fields
        • or ["filed name", "field type"] for object fields
        of String containing user names.
        Returns:
        a List of String containing user names.
        Throws:
        XWikiException - error when searching for users.
      • getAllUsers

        public List<Document> getAllUsers​(int nb,
                                          int start)
                                   throws XWikiException
        Get all users in the main wiki and the current wiki.
        Parameters:
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedUsers

        public List<Document> getAllMatchedUsers​(Map<?,​?> matchFields)
                                          throws XWikiException
        Get all users in the main wiki and the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedUsers

        public List<Document> getAllMatchedUsers​(Map<?,​?> matchFields,
                                                 int nb,
                                                 int start)
                                          throws XWikiException
        Get all users in the main wiki and the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedUsers

        public List<Document> getAllMatchedUsers​(Map<?,​?> matchFields,
                                                 int nb,
                                                 int start,
                                                 List<?> order)
                                          throws XWikiException
        Get all users in the main wiki and the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        order - the fields to order from. It is a List containing :
        • "field name" for document fields
        • or ["filed name", "field type"] for object fields
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllGlobalUsers

        public List<Document> getAllGlobalUsers​(int nb,
                                                int start)
                                         throws XWikiException
        Get all users in the main wiki.
        Parameters:
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedGlobalUsers

        public List<Document> getAllMatchedGlobalUsers​(Map<?,​?> matchFields)
                                                throws XWikiException
        Get all users in the main wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedGlobalUsers

        public List<Document> getAllMatchedGlobalUsers​(Map<?,​?> matchFields,
                                                       int nb,
                                                       int start)
                                                throws XWikiException
        Get all users in the main wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedGlobalUsers

        public List<Document> getAllMatchedGlobalUsers​(Map<?,​?> matchFields,
                                                       int nb,
                                                       int start,
                                                       List<?> order)
                                                throws XWikiException
        Get all users in the main wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        order - the fields to order from. It is a List containing :
        • "field name" for document fields
        • or ["filed name", "field type"] for object fields
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllWikiUsers

        public List<Document> getAllWikiUsers​(String wikiName,
                                              int nb,
                                              int start)
                                       throws XWikiException
        Get all users in the provided wiki.
        Parameters:
        wikiName - the wiki where to search for users.
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllWikiUsers

        public List<Document> getAllWikiUsers​(String wikiName)
                                       throws XWikiException
        Get all users in the provided wiki.
        Parameters:
        wikiName - the wiki where to search for users.
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedWikiUsers

        public List<Document> getAllMatchedWikiUsers​(String wikiName,
                                                     Map<?,​?> matchFields)
                                              throws XWikiException
        Get all users in the provided wiki.
        Parameters:
        wikiName - the wiki where to search for users.
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedWikiUsers

        public List<Document> getAllMatchedWikiUsers​(String wikiName,
                                                     Map<?,​?> matchFields,
                                                     int nb,
                                                     int start)
                                              throws XWikiException
        Get all users in the provided wiki.
        Parameters:
        wikiName - the wiki where to search for users.
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedWikiUsers

        public List<Document> getAllMatchedWikiUsers​(String wikiName,
                                                     Map<?,​?> matchFields,
                                                     int nb,
                                                     int start,
                                                     List<?> order)
                                              throws XWikiException
        Get all users in the provided wiki.
        Parameters:
        wikiName - the wiki where to search for users.
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        order - the fields to order from. It is a List containing :
        • "field name" for document fields
        • or ["filed name", "field type"] for object fields
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllLocalUsers

        public List<Document> getAllLocalUsers​(int nb,
                                               int start)
                                        throws XWikiException
        Get all users in the current wiki.
        Parameters:
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedLocalUsers

        public List<Document> getAllMatchedLocalUsers​(Map<?,​?> matchFields)
                                               throws XWikiException
        Get all users in the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedLocalUsers

        public List<Document> getAllMatchedLocalUsers​(Map<?,​?> matchFields,
                                                      int nb,
                                                      int start)
                                               throws XWikiException
        Get all users in the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.
      • getAllMatchedLocalUsers

        public List<Document> getAllMatchedLocalUsers​(Map<?,​?> matchFields,
                                                      int nb,
                                                      int start,
                                                      List<?> order)
                                               throws XWikiException
        Get all users in the current wiki.
        Parameters:
        matchFields - the fields to match. It is a Map with field name as key and for value :
        • "matching string" for document fields
        • or ["field type", "matching string"] for object fields
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        order - the fields to order from. It is a List containing :
        • "field name" for document fields
        • or ["filed name", "field type"] for object fields
        Returns:
        a List of Document containing user.
        Throws:
        XWikiException - error when searching for users.