Example usage for com.liferay.portal.kernel.service UserGroupLocalServiceUtil getUserGroups

List of usage examples for com.liferay.portal.kernel.service UserGroupLocalServiceUtil getUserGroups

Introduction

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

Prototype

public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getUserGroups(int start, int end) 

Source Link

Document

Returns a range of all the user groups.

Usage

From source file:com.liferay.tool.datamanipulator.displayfield.DisplayFields.java

License:Open Source License

public void addUserGroupMultiSelect(String name) throws SystemException {
    List<UserGroup> userGroups = UserGroupLocalServiceUtil.getUserGroups(QueryUtil.ALL_POS, QueryUtil.ALL_POS);

    List<KeyValuePair> values = new ArrayList<KeyValuePair>(userGroups.size());

    for (UserGroup userGroup : userGroups) {
        long userGroupId = userGroup.getUserGroupId();
        String userGroupName = userGroup.getName();

        if (Validator.isNull(userGroupId) || Validator.isNull(userGroupName)) {

            continue;
        }/*  ww w . ja  va 2 s  .c  o m*/

        values.add(new KeyValuePair(userGroupName, String.valueOf(userGroupId)));
    }

    addMultiSelectList(name, values);
}