Class RightsManagerGroupsApi


  • public class RightsManagerGroupsApi
    extends Api
    API for managing groups.
    Since:
    1.1.2, 1.2M2
    Version:
    $Id: 85196f043c77762bed7e34435f41a003ccf1f1db $
    • 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

      • RightsManagerGroupsApi

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

      • countAllGroups

        public int countAllGroups()
                           throws XWikiException
        Returns:
        the number of groups in the current wiki.
        Throws:
        XWikiException - error when getting number of groups.
      • countAllMatchedGroups

        public int countAllMatchedGroups​(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 groups in the current wiki.
        Throws:
        XWikiException - error when getting number of groups.
      • countAllWikiGroups

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

        public int countAllMatchedWikiGroups​(String wikiName,
                                             Map<?,​?> matchFields)
                                      throws XWikiException
        Get the number of groups in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search for groups.
        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 groups in the provided wiki.
        Throws:
        XWikiException - error when getting number of groups.
      • countAllGlobalGroups

        public int countAllGlobalGroups()
                                 throws XWikiException
        Returns:
        the number of groups in the main wiki.
        Throws:
        XWikiException - error when getting number of groups.
      • countAllMatchedGlobalGroups

        public int countAllMatchedGlobalGroups​(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 groups in the main wiki.
        Throws:
        XWikiException - error when getting number of groups.
      • countAllLocalGroups

        public int countAllLocalGroups()
                                throws XWikiException
        Returns:
        the number of groups in the current wiki.
        Throws:
        XWikiException - error when getting number of groups.
      • countAllMatchedLocalGroups

        public int countAllMatchedLocalGroups​(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 groups in the current wiki.
        Throws:
        XWikiException - error when getting number of groups.
      • getAllGroupsNames

        public List<String> getAllGroupsNames​(int nb,
                                              int start)
                                       throws XWikiException
        Get all groups 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 group to return.
        Returns:
        a List of String containing group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllGroupsNames

        public List<String> getAllGroupsNames()
                                       throws XWikiException
        Get all groups names in the main wiki and the current wiki.
        Returns:
        a List of String containing group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedGroupsNames

        public List<String> getAllMatchedGroupsNames​(Map<?,​?> matchFields)
                                              throws XWikiException
        Get all groups 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 group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedGroupsNames

        public List<String> getAllMatchedGroupsNames​(Map<?,​?> matchFields,
                                                     int nb,
                                                     int start)
                                              throws XWikiException
        Get all groups 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 group to return.
        Returns:
        a List of String containing group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedGroupsNames

        public List<String> getAllMatchedGroupsNames​(Map<?,​?> matchFields,
                                                     int nb,
                                                     int start,
                                                     List<?> order)
                                              throws XWikiException
        Get all groups 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 group 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 group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllGlobalGroupsNames

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

        public List<String> getAllGlobalGroupsNames()
                                             throws XWikiException
        Get all groups names in the main wiki.
        Returns:
        a List of String containing group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedGlobalGroupsNames

        public List<String> getAllMatchedGlobalGroupsNames​(Map<?,​?> matchFields)
                                                    throws XWikiException
        Get all groups 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 group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedGlobalGroupsNames

        public List<String> getAllMatchedGlobalGroupsNames​(Map<?,​?> matchFields,
                                                           int nb,
                                                           int start)
                                                    throws XWikiException
        Get all groups 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 group to return.
        Returns:
        a List of String containing group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedGlobalGroupsNames

        public List<String> getAllMatchedGlobalGroupsNames​(Map<?,​?> matchFields,
                                                           int nb,
                                                           int start,
                                                           List<?> order)
                                                    throws XWikiException
        Get all groups 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 group 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 group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllWikiGroupsNames

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

        public List<String> getAllWikiGroupsNames​(String wikiName)
                                           throws XWikiException
        Get all groups names in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search.
        Returns:
        a List of String containing group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedWikiGroupsNames

        public List<String> getAllMatchedWikiGroupsNames​(String wikiName,
                                                         Map<?,​?> matchFields)
                                                  throws XWikiException
        Get all groups names in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search.
        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 group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedWikiGroupsNames

        public List<String> getAllMatchedWikiGroupsNames​(String wikiName,
                                                         Map<?,​?> matchFields,
                                                         int nb,
                                                         int start)
                                                  throws XWikiException
        Get all groups names in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search.
        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 group to return.
        Returns:
        a List of String containing group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedWikiGroupsNames

        public List<String> getAllMatchedWikiGroupsNames​(String wikiName,
                                                         Map<?,​?> matchFields,
                                                         int nb,
                                                         int start,
                                                         List<?> order)
                                                  throws XWikiException
        Get all groups names in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search.
        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 group 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 group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllLocalGroupsNames

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

        public List<String> getAllLocalGroupsNames()
                                            throws XWikiException
        Get all groups names in the current wiki.
        Returns:
        a List of String containing group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedLocalGroupsNames

        public List<String> getAllMatchedLocalGroupsNames​(Map<?,​?> matchFields)
                                                   throws XWikiException
        Get all groups 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 group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedLocalGroupsNames

        public List<String> getAllMatchedLocalGroupsNames​(Map<?,​?> matchFields,
                                                          int nb,
                                                          int start)
                                                   throws XWikiException
        Get all groups 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 group to return.
        Returns:
        a List of String containing group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedLocalGroupsNames

        public List<String> getAllMatchedLocalGroupsNames​(Map<?,​?> matchFields,
                                                          int nb,
                                                          int start,
                                                          List<?> order)
                                                   throws XWikiException
        Get all groups 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 group 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 group names.
        Throws:
        XWikiException - error when searching for groups.
      • getAllGroups

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

        public List<Document> getAllMatchedGroups​(Map<?,​?> matchFields)
                                           throws XWikiException
        Get all groups 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 group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedGroups

        public List<Document> getAllMatchedGroups​(Map<?,​?> matchFields,
                                                  int nb,
                                                  int start)
                                           throws XWikiException
        Get all groups 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 group to return.
        Returns:
        a List of Document containing group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedGroups

        public List<Document> getAllMatchedGroups​(Map<?,​?> matchFields,
                                                  int nb,
                                                  int start,
                                                  List<?> order)
                                           throws XWikiException
        Get all groups 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 group 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 group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllGlobalGroups

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

        public List<Document> getAllMatchedGlobalGroups​(Map<?,​?> matchFields)
                                                 throws XWikiException
        Get all groups 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 group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedGlobalGroups

        public List<Document> getAllMatchedGlobalGroups​(Map<?,​?> matchFields,
                                                        int nb,
                                                        int start)
                                                 throws XWikiException
        Get all groups 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 group to return.
        Returns:
        a List of Document containing group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedGlobalGroups

        public List<Document> getAllMatchedGlobalGroups​(Map<?,​?> matchFields,
                                                        int nb,
                                                        int start,
                                                        List<?> order)
                                                 throws XWikiException
        Get all groups 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 group 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 group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllWikiGroups

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

        public List<Document> getAllWikiGroups​(String wikiName)
                                        throws XWikiException
        Get all groups in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search.
        Returns:
        a List of Document containing group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedWikiGroups

        public List<Document> getAllMatchedWikiGroups​(String wikiName,
                                                      Map<?,​?> matchFields)
                                               throws XWikiException
        Get all groups in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search.
        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 group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedWikiGroups

        public List<Document> getAllMatchedWikiGroups​(String wikiName,
                                                      Map<?,​?> matchFields,
                                                      int nb,
                                                      int start)
                                               throws XWikiException
        Get all groups in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search.
        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 group to return.
        Returns:
        a List of Document containing group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedWikiGroups

        public List<Document> getAllMatchedWikiGroups​(String wikiName,
                                                      Map<?,​?> matchFields,
                                                      int nb,
                                                      int start,
                                                      List<?> order)
                                               throws XWikiException
        Get all groups in the provided wiki.
        Parameters:
        wikiName - the name of the wiki where to search.
        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 group 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 group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllLocalGroups

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

        public List<Document> getAllMatchedLocalGroups​(Map<?,​?> matchFields)
                                                throws XWikiException
        Get all groups 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 group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedLocalGroups

        public List<Document> getAllMatchedLocalGroups​(Map<?,​?> matchFields,
                                                       int nb,
                                                       int start)
                                                throws XWikiException
        Get all groups 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 group to return.
        Returns:
        a List of Document containing group.
        Throws:
        XWikiException - error when searching for groups.
      • getAllMatchedLocalGroups

        public List<Document> getAllMatchedLocalGroups​(Map<?,​?> matchFields,
                                                       int nb,
                                                       int start,
                                                       List<?> order)
                                                throws XWikiException
        Get all groups 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 group 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 group.
        Throws:
        XWikiException - error when searching for groups.