List of usage examples for com.liferay.portal.kernel.service RoleLocalServiceUtil getRoles
public static java.util.List<com.liferay.portal.kernel.model.Role> getRoles(long companyId, int[] types)
From source file:com.liferay.tool.datamanipulator.displayfield.DisplayFields.java
License:Open Source License
public void addRoleMultiSelect(String name) throws SystemException { List<Role> roles = RoleLocalServiceUtil.getRoles(QueryUtil.ALL_POS, QueryUtil.ALL_POS); List<KeyValuePair> values = new ArrayList<KeyValuePair>(roles.size()); for (Role role : roles) { if (role.getType() == RoleConstants.TYPE_REGULAR) { long roleId = role.getRoleId(); String roleName = role.getName(); if (Validator.isNull(roleId) || Validator.isNull(roleName)) { continue; }// w ww . j a va 2 s. c om values.add(new KeyValuePair(roleName, String.valueOf(roleId))); } } addMultiSelectList(name, values); }