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

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

Introduction

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

Prototype

public static com.liferay.portal.kernel.search.Hits search(long companyId, String keywords, int status,
            java.util.LinkedHashMap<String, Object> params, int start, int end,
            com.liferay.portal.kernel.search.Sort[] sorts) 

Source Link

Usage

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

License:Open Source License

public static List<UserBean> getUserBeans(Long companyId, String search, int start, int end,
        OrderByComparator obc) {// w w w .j a  v a2  s. c  om
    List<UserBean> results = new ArrayList<UserBean>();
    List<User> users = null;
    UserBean userBean = null;
    try {
        if (search == null) {
            users = UserLocalServiceUtil.search(companyId, null, WorkflowConstants.STATUS_APPROVED, null, start,
                    end, obc);
        } else {
            users = UserLocalServiceUtil.search(companyId, search, null, search, null, null,
                    WorkflowConstants.STATUS_APPROVED, null, false, start, end, obc);
        }

        for (User user : users) {
            userBean = parseUser(user);
            results.add(userBean);
        }
    } catch (Exception e) {
        LOG.error(e);
    }

    return results;
}