Package org.structr.common

Examples of org.structr.common.GraphObjectComparator


          finalSortOrder = obj.getDefaultSortOrder();
        }
      }

      if (sortKey != null) {
        Collections.sort(list, new GraphObjectComparator(sortKey, finalSortOrder));
      }
    }
  }
View Full Code Here


   * @throws FrameworkException
   */
  private Page findIndexPage(final SecurityContext securityContext) throws FrameworkException {

    final Result<Page> results = StructrApp.getInstance(securityContext).nodeQuery(Page.class).sort(Page.position).order(false).getResult();
    Collections.sort(results.getResults(), new GraphObjectComparator(Page.position, GraphObjectComparator.ASCENDING));

    // Find first visible page
    Page page = null;

    if (!results.isEmpty()) {
View Full Code Here

        return new Result(overviewMap, false);

      } else if (StringUtils.isNotBlank(aggregate)) {

        // sort result
        Collections.sort(entries, new GraphObjectComparator(timestampProperty, false));

        final long intervalStart = range != null ? range.start : beginTimestamp;
        final long intervalEnd   = range != null ? range.end : endTimestamp;

        // aggregate results
        return aggregate(entries, aggregate, intervalStart, intervalEnd);

      } else {

        // sort result
        Collections.sort(entries, new GraphObjectComparator(timestampProperty, false));

        return new Result(entries, entries.size(), true, false);
      }
    }
View Full Code Here

    if(wrappedResource != null) {
     
      Result result = wrappedResource.doGet(sortKey, sortDescending, pageSize, page, offsetId);

      try {
        Collections.sort(result.getResults(), new GraphObjectComparator(sortKey, sortOrder));
       
      } catch(Throwable t) {
       
        throw new FrameworkException("base", new InvalidSortKey(sortKey));
      }
View Full Code Here

          resultCount++;
        }
      }

      // sort list
      Collections.sort(finalResult, new GraphObjectComparator(sortKey, sortDescending));

      // return paged final result
      return new Result(PagingHelper.subList(finalResult, pageSize, page, offsetId), resultCount, true, false);

    } else {
View Full Code Here

TOP

Related Classes of org.structr.common.GraphObjectComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.