public RowSide<Node> findSide(
     Integer parentId,
     Boolean showDescendants,
     Integer userId,
     boolean allNode,
     Map<String, String[]> params,
     Node bean,
     Integer position,
     Sort sort) {
   if (position == null) {
     return new RowSide<Node>();
   }
   Limitable limit = RowSide.limitable(position, sort);
   List<Node> list;
   if (showDescendants != null && showDescendants) {
     String treeNumber = null;
     if (parentId != null) {
       Node parent = get(parentId);
       treeNumber = parent.getTreeNumber();
     }
     list = dao.findAll(spec(null, treeNumber, userId, allNode, params), limit);
   } else {
     if (parentId != null) {
       list = dao.findAll(spec(parentId, null, userId, allNode, params), limit);
     } else {
       list = Collections.emptyList();
     }
   }
   return RowSide.create(list, bean);
 }
Example #2
0
 public RowSide<Member> findSide(
     Map<String, String[]> params, Member bean, Integer position, Sort sort) {
   if (position == null) {
     return new RowSide<Member>();
   }
   Limitable limit = RowSide.limitable(position, sort);
   List<Member> list = dao.findAll(spec(params), limit);
   return RowSide.create(list, bean);
 }