Example usage for com.liferay.portal.kernel.service GroupLocalServiceUtil getGroups

List of usage examples for com.liferay.portal.kernel.service GroupLocalServiceUtil getGroups

Introduction

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

Prototype

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

Source Link

Document

Returns a range of all the groups.

Usage

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

License:Open Source License

public void addSiteMultiSelect(String name) throws SystemException {
    List<Group> groups = GroupLocalServiceUtil.getGroups(QueryUtil.ALL_POS, QueryUtil.ALL_POS);

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

    for (Group group : groups) {
        //if ((group.isCommunity() || group.isSite()) &&
        //   !group.isControlPanel() && !group.isStaged()) {
        if (group.isRegularSite() && !group.isControlPanel() && !group.isStaged()) {
            long siteId = group.getGroupId();
            String siteName = group.getName();

            if (Validator.isNull(siteId) || Validator.isNull(siteName)) {
                continue;
            }//from  w w w  .  ja  v a 2  s. c o m

            values.add(new KeyValuePair(siteName, String.valueOf(siteId)));
        }
    }

    addMultiSelectList(name, values);
}