/* * Copyright 2015-Present Entando Inc. (http://www.entando.com) All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.agiletec.apsadmin.user.role; import java.util.Collections; import java.util.List; import org.apache.commons.beanutils.BeanComparator; import com.agiletec.aps.system.services.role.IRoleManager; import com.agiletec.aps.system.services.role.Role; import com.agiletec.apsadmin.system.BaseAction; /** * Classi action della lista Ruoli. * @author E.Santoboni */ public class RoleFinderAction extends BaseAction { public List<Role> getRoles() { List<Role> roles = this.getRoleManager().getRoles(); BeanComparator comparator = new BeanComparator("description"); Collections.sort(roles, comparator); return roles; } protected IRoleManager getRoleManager() { return _roleManager; } public void setRoleManager(IRoleManager roleManager) { this._roleManager = roleManager; } private IRoleManager _roleManager; }