Example usage for com.liferay.portal.kernel.model Group isRegularSite

List of usage examples for com.liferay.portal.kernel.model Group isRegularSite

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model Group isRegularSite.

Prototype

public boolean isRegularSite();

Source Link

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  ww w. j  ava 2s.  com

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

    addMultiSelectList(name, values);
}