Author: ilgrosso
Date: Tue Oct 7 08:14:11 2014
New Revision: 1629820
URL: http://svn.apache.org/r1629820
Log:
[SYNCOPE-557] Merge from 1_2_X
Modified:
syncope/trunk/core/src/main/java/org/apache/syncope/core/report/RoleReportlet.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/report/UserReportlet.java
Modified:
syncope/trunk/core/src/main/java/org/apache/syncope/core/report/RoleReportlet.java
URL:
http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/report/RoleReportlet.java?rev=1629820&r1=1629819&r2=1629820&view=diff
==============================================================================
---
syncope/trunk/core/src/main/java/org/apache/syncope/core/report/RoleReportlet.java
(original)
+++
syncope/trunk/core/src/main/java/org/apache/syncope/core/report/RoleReportlet.java
Tue Oct 7 08:14:11 2014
@@ -23,6 +23,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.common.report.RoleReportletConf;
import org.apache.syncope.common.report.RoleReportletConf.Feature;
import org.apache.syncope.common.to.AbstractAttributableTO;
@@ -64,7 +65,7 @@ public class RoleReportlet extends Abstr
private List<SyncopeRole> getPagedRoles(final int page) {
final Set<Long> adminRoleIds =
EntitlementUtil.getRoleIds(entitlementDAO.findAll());
final List<SyncopeRole> result;
- if (conf.getMatchingCond() == null) {
+ if (StringUtils.isBlank(conf.getMatchingCond())) {
result = roleDAO.findAll();
} else {
result = searchDAO.search(adminRoleIds,
SearchCondConverter.convert(conf.getMatchingCond()),
@@ -77,7 +78,7 @@ public class RoleReportlet extends Abstr
private int count() {
Set<Long> adminRoleIds =
EntitlementUtil.getRoleIds(entitlementDAO.findAll());
- return conf.getMatchingCond() == null
+ return StringUtils.isBlank(conf.getMatchingCond())
? roleDAO.findAll().size()
: searchDAO.count(adminRoleIds,
SearchCondConverter.convert(conf.getMatchingCond()), SubjectType.ROLE);
}
Modified:
syncope/trunk/core/src/main/java/org/apache/syncope/core/report/UserReportlet.java
URL:
http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/report/UserReportlet.java?rev=1629820&r1=1629819&r2=1629820&view=diff
==============================================================================
---
syncope/trunk/core/src/main/java/org/apache/syncope/core/report/UserReportlet.java
(original)
+++
syncope/trunk/core/src/main/java/org/apache/syncope/core/report/UserReportlet.java
Tue Oct 7 08:14:11 2014
@@ -23,6 +23,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.common.report.UserReportletConf;
import org.apache.syncope.common.report.UserReportletConf.Feature;
import org.apache.syncope.common.to.AbstractAttributableTO;
@@ -71,7 +72,7 @@ public class UserReportlet extends Abstr
final Set<Long> adminRoleIds =
EntitlementUtil.getRoleIds(entitlementDAO.findAll());
final List<SyncopeUser> result;
- if (conf.getMatchingCond() == null) {
+ if (StringUtils.isBlank(conf.getMatchingCond())) {
result = userDAO.findAll(adminRoleIds, page, PAGE_SIZE);
} else {
result = searchDAO.search(adminRoleIds,
SearchCondConverter.convert(conf.getMatchingCond()),
@@ -84,7 +85,7 @@ public class UserReportlet extends Abstr
private int count() {
Set<Long> adminRoleIds =
EntitlementUtil.getRoleIds(entitlementDAO.findAll());
- return conf.getMatchingCond() == null
+ return StringUtils.isBlank(conf.getMatchingCond())
? userDAO.count(adminRoleIds)
: searchDAO.count(adminRoleIds,
SearchCondConverter.convert(conf.getMatchingCond()), SubjectType.USER);
}