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

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

Introduction

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

Prototype

public static int getCompanyUsersCount(long companyId) 

Source Link

Document

Returns the number of users belonging to the company.

Usage

From source file:eu.gerhards.liferay.services.angular.service.impl.AngularUserServiceImpl.java

License:Open Source License

@Override
public List<User> getCompanyUsers(long companyId) throws PortalException {

    _log.info("Getting company user for company with id: " + String.valueOf(companyId));

    _log.debug("    ... security check ...");

    PortalPermissionUtil.check(getPermissionChecker(), AngularActionKeys.LIST_USERS);

    _log.debug("    ... getting information");

    int count = UserLocalServiceUtil.getCompanyUsersCount(companyId);
    List<User> users = new ArrayList<>();

    if (count > 0) {
        users = UserLocalServiceUtil.getCompanyUsers(companyId, 0, count - 1);
    }/* w  ww . j a v a 2  s .  co m*/

    return users;
}