Example usage for com.liferay.portal.kernel.service UserLocalServiceUtil searchCount

List of usage examples for com.liferay.portal.kernel.service UserLocalServiceUtil searchCount

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service UserLocalServiceUtil searchCount.

Prototype

public static int searchCount(long companyId, String keywords, int status,
        java.util.LinkedHashMap<String, Object> params) 

Source Link

Document

Returns the number of users who match the keywords and status.

Usage

From source file:com.liferay.site.admin.web.internal.display.context.SiteAdminDisplayContext.java

License:Open Source License

public int getUsersCount(Group group) {
    LinkedHashMap<String, Object> userParams = new LinkedHashMap<>();

    ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

    Company company = themeDisplay.getCompany();

    userParams.put("inherit", Boolean.TRUE);
    userParams.put("usersGroups", group.getGroupId());

    return UserLocalServiceUtil.searchCount(company.getCompanyId(), null, WorkflowConstants.STATUS_APPROVED,
            userParams);//from   w  ww  . j  a v  a 2 s.c om
}

From source file:com.rivetlogic.skype.util.SkypeUtil.java

License:Open Source License

public static int getUserBeansCount(Long companyId, String search) {
    int count = Constants.DEFAULT_INT_VALUE;
    try {//w w w  . ja  v a  2s  . c  o  m
        if (search == null) {
            count = UserLocalServiceUtil.searchCount(companyId, null, WorkflowConstants.STATUS_APPROVED, null);
        } else {
            count = UserLocalServiceUtil.searchCount(companyId, search, null, search, null, null,
                    WorkflowConstants.STATUS_APPROVED, null, false);
        }

    } catch (Exception e) {
        LOG.error(e);
    }
    return count;
}