Search in sources :

Example 36 with BeanComparator

use of org.apache.commons.beanutils.BeanComparator in project entando-core by entando.

the class UserAuthorizationAction method getRoles.

public List<Role> getRoles() {
    List<Role> roles = this.getRoleManager().getRoles();
    Collections.sort(roles, new BeanComparator("description"));
    return roles;
}
Also used : Role(com.agiletec.aps.system.services.role.Role) BeanComparator(org.apache.commons.beanutils.BeanComparator)

Example 37 with BeanComparator

use of org.apache.commons.beanutils.BeanComparator in project entando-core by entando.

the class UserAuthorizationAction method getGroups.

public List<Group> getGroups() {
    List<Group> groups = this.getGroupManager().getGroups();
    Collections.sort(groups, new BeanComparator("description"));
    return groups;
}
Also used : Group(com.agiletec.aps.system.services.group.Group) BeanComparator(org.apache.commons.beanutils.BeanComparator)

Example 38 with BeanComparator

use of org.apache.commons.beanutils.BeanComparator in project entando-core by entando.

the class RoleFinderAction method getRoles.

public List<Role> getRoles() {
    List<Role> roles = this.getRoleManager().getRoles();
    BeanComparator comparator = new BeanComparator("description");
    Collections.sort(roles, comparator);
    return roles;
}
Also used : Role(com.agiletec.aps.system.services.role.Role) BeanComparator(org.apache.commons.beanutils.BeanComparator)

Example 39 with BeanComparator

use of org.apache.commons.beanutils.BeanComparator in project entando-core by entando.

the class AbstractPortalAction method addGroup.

private void addGroup(String code, Map<String, List<SelectItem>> mapping, List<List<SelectItem>> group) {
    List<SelectItem> singleGroup = mapping.get(code);
    if (null != singleGroup) {
        BeanComparator comparator = new BeanComparator("value");
        Collections.sort(singleGroup, comparator);
        group.add(singleGroup);
    }
}
Also used : SelectItem(com.agiletec.aps.util.SelectItem) BeanComparator(org.apache.commons.beanutils.BeanComparator)

Example 40 with BeanComparator

use of org.apache.commons.beanutils.BeanComparator in project entando-core by entando.

the class PageAction method getGroups.

/**
 * Return the list of system groups.
 *
 * @return The list of system groups.
 */
public List<Group> getGroups() {
    List<Group> groups = this.getGroupManager().getGroups();
    BeanComparator c = new BeanComparator("description");
    Collections.sort(groups, c);
    return groups;
}
Also used : Group(com.agiletec.aps.system.services.group.Group) BeanComparator(org.apache.commons.beanutils.BeanComparator)

Aggregations

BeanComparator (org.apache.commons.beanutils.BeanComparator)50 ArrayList (java.util.ArrayList)25 SelectItem (com.agiletec.aps.util.SelectItem)6 NullComparator (org.apache.commons.collections.comparators.NullComparator)6 IEntityManager (com.agiletec.aps.system.common.entity.IEntityManager)5 Group (com.agiletec.aps.system.services.group.Group)5 IApsEntity (com.agiletec.aps.system.common.entity.model.IApsEntity)4 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)4 AttributeInterface (com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface)3 Comparator (java.util.Comparator)3 HashMap (java.util.HashMap)3 List (java.util.List)3 ComparatorChain (org.apache.commons.collections.comparators.ComparatorChain)3 ReverseComparator (org.apache.commons.collections.comparators.ReverseComparator)3 Role (com.agiletec.aps.system.services.role.Role)2 WebApplicationContext (org.springframework.web.context.WebApplicationContext)2 SmallEntityType (com.agiletec.aps.system.common.entity.model.SmallEntityType)1 AbstractListAttribute (com.agiletec.aps.system.common.entity.model.attribute.AbstractListAttribute)1 AttributeRole (com.agiletec.aps.system.common.entity.model.attribute.AttributeRole)1 ListAttribute (com.agiletec.aps.system.common.entity.model.attribute.ListAttribute)1