Author: tmortagne
Date: 2007-10-29 14:54:04 +0100 (Mon, 29 Oct 2007)
New Revision: 5539
Modified:
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/rightsmanager/RightsManager.java
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/api/XWikiGroupService.java
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiGroupServiceImpl.java
Log:
XWIKI-1826:
- Remove useless "int nb, int start" parameters from count methods
Modified:
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/rightsmanager/RightsManager.java
===================================================================
---
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/rightsmanager/RightsManager.java
2007-10-29 13:35:09 UTC (rev 5538)
+++
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/rightsmanager/RightsManager.java
2007-10-29 13:54:04 UTC (rev 5539)
@@ -379,10 +379,10 @@
{
if (user) {
return
context.getWiki().getGroupService(context).countAllMatchedUsers(matchFields,
- 0, 0, context);
+ context);
} else {
return
context.getWiki().getGroupService(context).countAllMatchedUsers(matchFields,
- 0, 0, context);
+ context);
}
}
Modified:
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/api/XWikiGroupService.java
===================================================================
---
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/api/XWikiGroupService.java
2007-10-29 13:35:09 UTC (rev 5538)
+++
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/api/XWikiGroupService.java
2007-10-29 13:54:04 UTC (rev 5539)
@@ -142,15 +142,12 @@
* document field</li>
* <li>pattern matching : based on HQL "like" command</li>
* </ul>.
- * @param nb the maximum number of result to return.
- * @param start the index of the first found user to return.
* @param context the [EMAIL PROTECTED] XWikiContext}.
* @return the of found users.
* @throws XWikiException error when getting number of users.
* @since XWiki Core 1.1.2, XWiki Core 1.2M2
*/
- int countAllMatchedUsers(Object[][] matchFields, int nb, int start,
XWikiContext context)
- throws XWikiException;
+ int countAllMatchedUsers(Object[][] matchFields, XWikiContext context)
throws XWikiException;
/**
* Return number of groups with provided constraints.
@@ -162,15 +159,12 @@
* document field</li>
* <li>pattern matching : based on HQL "like" command</li>
* </ul>.
- * @param nb the maximum number of result to return.
- * @param start the index of the first found user to return.
* @param context the [EMAIL PROTECTED] XWikiContext}.
* @return the of found groups.
* @throws XWikiException error when getting number of groups.
* @since XWiki Core 1.1.2, XWiki Core 1.2M2
*/
- int countAllMatchedGroups(Object[][] matchFields, int nb, int start,
XWikiContext context)
- throws XWikiException;
+ int countAllMatchedGroups(Object[][] matchFields, XWikiContext context)
throws XWikiException;
/**
* Get all groups containing provided member.
Modified:
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java
===================================================================
---
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java
2007-10-29 13:35:09 UTC (rev 5538)
+++
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java
2007-10-29 13:54:04 UTC (rev 5539)
@@ -211,13 +211,13 @@
args);
}
}
-
+
/**
* [EMAIL PROTECTED]
- *
- * @see
com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl#getAllMatchedUsers(java.lang.Object[][],
boolean, int, int, java.lang.Object[][], com.xpn.xwiki.XWikiContext)
*
- * TODO: fully implements this method.
+ * @see
com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl#getAllMatchedUsers(java.lang.Object[][],
+ * boolean, int, int, java.lang.Object[][],
com.xpn.xwiki.XWikiContext) TODO: fully
+ * implements this method.
*/
public List getAllMatchedUsers(Object[][] matchFields, boolean
withdetails, int nb,
int start, Object[][] order, XWikiContext context) throws
XWikiException
@@ -238,11 +238,12 @@
return usersList;
}
-
+
/**
* [EMAIL PROTECTED]
- *
- * @see
com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl#getAllMatchedGroups(java.lang.Object[][],
boolean, int, int, java.lang.Object[][], com.xpn.xwiki.XWikiContext)
+ *
+ * @see
com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl#getAllMatchedGroups(java.lang.Object[][],
+ * boolean, int, int, java.lang.Object[][],
com.xpn.xwiki.XWikiContext)
*/
public List getAllMatchedGroups(Object[][] matchFields, boolean
withdetails, int nb,
int start, Object[][] order, XWikiContext context) throws
XWikiException
@@ -268,31 +269,34 @@
/**
* [EMAIL PROTECTED]
- *
- * @see
com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl#countAllMatchedUsers(java.lang.Object[][],
int, int, com.xpn.xwiki.XWikiContext)
+ *
+ * @see
com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl#countAllMatchedUsers(java.lang.Object[][],
+ * com.xpn.xwiki.XWikiContext)
*/
- public int countAllMatchedUsers(Object[][] matchFields, int nb, int start,
- XWikiContext context) throws XWikiException
+ public int countAllMatchedUsers(Object[][] matchFields, XWikiContext
context)
+ throws XWikiException
{
- return getAllMatchedGroups(matchFields, false, nb, start, null,
context).size();
+ return getAllMatchedGroups(matchFields, false, 0, 0, null,
context).size();
}
/**
* [EMAIL PROTECTED]
- *
- * @see
com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl#countAllMatchedGroups(java.lang.Object[][],
int, int, com.xpn.xwiki.XWikiContext)
+ *
+ * @see
com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl#countAllMatchedGroups(java.lang.Object[][],
+ * com.xpn.xwiki.XWikiContext)
*/
- public int countAllMatchedGroups(Object[][] matchFields, int nb, int start,
- XWikiContext context) throws XWikiException
+ public int countAllMatchedGroups(Object[][] matchFields, XWikiContext
context)
+ throws XWikiException
{
- return getAllMatchedUsers(matchFields, false, nb, start, null,
context).size();
+ return getAllMatchedUsers(matchFields, false, 0, 0, null,
context).size();
}
/**
* [EMAIL PROTECTED]
- *
- * @see
com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl#removeUserOrGroupFromAllGroups(java.lang.String,
java.lang.String, java.lang.String, com.xpn.xwiki.XWikiContext)
- * TODO: fully implements this method.
+ *
+ * @see
com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl#removeUserOrGroupFromAllGroups(java.lang.String,
+ * java.lang.String, java.lang.String, com.xpn.xwiki.XWikiContext)
TODO: fully implements
+ * this method.
*/
public void removeUserOrGroupFromAllGroups(String memberWiki, String
memberSpace,
String memberName, XWikiContext context) throws XWikiException
Modified:
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiGroupServiceImpl.java
===================================================================
---
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiGroupServiceImpl.java
2007-10-29 13:35:09 UTC (rev 5538)
+++
xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiGroupServiceImpl.java
2007-10-29 13:54:04 UTC (rev 5539)
@@ -628,8 +628,8 @@
* @throws XWikiException error when calling for
* [EMAIL PROTECTED] XWikiStoreInterface#search(String, int,
int, List, XWikiContext)}
*/
- protected int countAllMatchedUsersOrGroups(boolean user, Object[][]
matchFields, int nb,
- int start, XWikiContext context) throws XWikiException
+ protected int countAllMatchedUsersOrGroups(boolean user, Object[][]
matchFields,
+ XWikiContext context) throws XWikiException
{
String documentClass = user ? CLASS_SUFFIX_XWIKIUSERS :
CLASS_SUFFIX_XWIKIGROUPS;
@@ -638,7 +638,7 @@
String sql = "select count(doc) from XWikiDocument doc" + where;
- List list = context.getWiki().getStore().search(sql, nb, start,
parameterValues, context);
+ List list = context.getWiki().getStore().search(sql, 0, 0,
parameterValues, context);
if (list == null || list.size() == 0)
return 0;
@@ -649,25 +649,24 @@
/**
* [EMAIL PROTECTED]
*
- * @see
com.xpn.xwiki.user.api.XWikiGroupService#countAllMatchedUsers(java.lang.Object[][],
int,
- * int, com.xpn.xwiki.XWikiContext)
+ * @see
com.xpn.xwiki.user.api.XWikiGroupService#countAllMatchedUsers(java.lang.Object[][],
+ * com.xpn.xwiki.XWikiContext)
*/
- public int countAllMatchedUsers(Object[][] matchFields, int nb, int start,
- XWikiContext context) throws XWikiException
+ public int countAllMatchedUsers(Object[][] matchFields, XWikiContext
context)
+ throws XWikiException
{
- return countAllMatchedUsersOrGroups(true, matchFields, nb, start,
context);
+ return countAllMatchedUsersOrGroups(true, matchFields, context);
}
/**
* [EMAIL PROTECTED]
- *
- * @see
com.xpn.xwiki.user.api.XWikiGroupService#countAllMatchedGroups(java.lang.Object[][],
- * int, int, com.xpn.xwiki.XWikiContext)
+ *
+ * @see
com.xpn.xwiki.user.api.XWikiGroupService#countAllMatchedGroups(java.lang.Object[][],
com.xpn.xwiki.XWikiContext)
*/
- public int countAllMatchedGroups(Object[][] matchFields, int nb, int start,
- XWikiContext context) throws XWikiException
+ public int countAllMatchedGroups(Object[][] matchFields, XWikiContext
context)
+ throws XWikiException
{
- return countAllMatchedUsersOrGroups(false, matchFields, nb, start,
context);
+ return countAllMatchedUsersOrGroups(false, matchFields, context);
}
/**
@@ -679,7 +678,7 @@
public Collection getAllGroupsNamesForMember(String member, int nb, int
start,
XWikiContext context) throws XWikiException
{
- //TODO: improve using real request
+ // TODO: improve using real request
List groupNameList = new ArrayList(listGroupsForUser(member, context));
if (start <= 0 & (nb <= 0 || nb >= groupNameList.size()))
@@ -703,7 +702,7 @@
public Collection getAllMembersNamesForGroup(String group, int nb, int
start,
XWikiContext context) throws XWikiException
{
- //TODO: improve using real request
+ // TODO: improve using real request
List userNameList = listMemberForGroup(group, context);
if (nb == 0 && start == 0)
@@ -714,27 +713,36 @@
else
return userNameList.subList(start, start + nb);
}
-
+
/**
* [EMAIL PROTECTED]
- *
- * @see
com.xpn.xwiki.user.api.XWikiGroupService#countAllGroupsNamesForMember(java.lang.String,
com.xpn.xwiki.XWikiContext)
- * TODO: improve using real request
+ *
+ * @see
com.xpn.xwiki.user.api.XWikiGroupService#countAllGroupsNamesForMember(java.lang.String,
+ * com.xpn.xwiki.XWikiContext)
*/
- public int countAllGroupsNamesForMember(String member, XWikiContext
context) throws XWikiException
+ public int countAllGroupsNamesForMember(String member, XWikiContext
context)
+ throws XWikiException
{
- //TODO: improve using real request
+ if (member == null)
+ return countAllMatchedGroups(null, context);
+
+ // TODO: improve using real request
return getAllGroupsNamesForMember(member, 0, 0, context).size();
}
-
+
/**
* [EMAIL PROTECTED]
- *
- * @see
com.xpn.xwiki.user.api.XWikiGroupService#countAllMembersNamesForGroup(java.lang.String,
com.xpn.xwiki.XWikiContext)
+ *
+ * @see
com.xpn.xwiki.user.api.XWikiGroupService#countAllMembersNamesForGroup(java.lang.String,
+ * com.xpn.xwiki.XWikiContext)
*/
- public int countAllMembersNamesForGroup(String group, XWikiContext
context) throws XWikiException
+ public int countAllMembersNamesForGroup(String group, XWikiContext context)
+ throws XWikiException
{
- //TODO: improve using real request
+ if (group == null)
+ return countAllMatchedUsers(null, context);
+
+ // TODO: improve using real request
return getAllMembersNamesForGroup(group, 0, 0, context).size();
}
}
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications