use of com.agiletec.aps.system.common.FieldSearchFilter in project entando-core by entando.
the class AuthorizationDAO method getUsersByAuthorities.
@Override
public List<String> getUsersByAuthorities(List<String> groupNames, List<String> roleNames) {
FieldSearchFilter[] filters = {};
if (CollectionUtils.isNotEmpty(groupNames)) {
FieldSearchFilter filter = new FieldSearchFilter("groupname", groupNames, false);
filters = super.addFilter(filters, filter);
}
if (CollectionUtils.isNotEmpty(roleNames)) {
FieldSearchFilter filter = new FieldSearchFilter("rolename", roleNames, false);
filters = super.addFilter(filters, filter);
}
return super.searchId(filters);
}
use of com.agiletec.aps.system.common.FieldSearchFilter in project entando-core by entando.
the class PageModelManager method searchPageModels.
@Override
public SearcherDaoPaginatedResult<PageModel> searchPageModels(List<FieldSearchFilter> filtersList) throws ApsSystemException {
SearcherDaoPaginatedResult<PageModel> pagedResult = null;
try {
FieldSearchFilter[] filters = null;
if (null != filtersList) {
filters = filtersList.toArray(new FieldSearchFilter[filtersList.size()]);
}
List<PageModel> pageModels = new ArrayList<>();
int count = this.getPageModelDAO().count(filters);
List<String> pageModelCodes = this.getPageModelDAO().search(filters);
for (String code : pageModelCodes) {
pageModels.add(this.getPageModel(code));
}
pagedResult = new SearcherDaoPaginatedResult<PageModel>(count, pageModels);
} catch (Throwable t) {
_logger.error("Error searching groups", t);
throw new ApsSystemException("Error searching groups", t);
}
return pagedResult;
}
Aggregations