Package org.structr.core.app

Examples of org.structr.core.app.Query


    final String sortOrder         = webSocketData.getSortOrder();
    final String sortKey           = webSocketData.getSortKey();
    final int pageSize             = webSocketData.getPageSize();
    final int page                 = webSocketData.getPage();
    final PropertyKey sortProperty = StructrApp.getConfiguration().getPropertyKeyForJSONName(type, sortKey);
    final Query query              = StructrApp.getInstance(securityContext).nodeQuery(type).includeDeletedAndHidden().sort(sortProperty).order("desc".equals(sortOrder)).page(page).pageSize(pageSize);

    // important
    if (AbstractFile.class.isAssignableFrom(type) && rootOnly) {

      query.and(AbstractFile.hasParent, false);
    }

    // for image lists, suppress thumbnails
    if (type.equals(Image.class)) {

      query.and(Image.isThumbnail, false);
    }

    try {

      // do search
      final Result result = query.getResult();

      // save raw result count
      int resultCountBeforePaging = result.getRawResultCount(); // filteredResults.size();

      // set full result list
View Full Code Here


    final String sortOrder                 = webSocketData.getSortOrder();
    final String sortKey                   = webSocketData.getSortKey();
    final int pageSize                     = webSocketData.getPageSize();
    final int page                         = webSocketData.getPage();
    final PropertyKey sortProperty         = StructrApp.getConfiguration().getPropertyKeyForJSONName(type, sortKey);
    final Query query                      = StructrApp.getInstance(securityContext).nodeQuery(type).includeDeletedAndHidden().sort(sortProperty).order("desc".equals(sortOrder));
   
    // for image lists, suppress thumbnails
    if (type.equals(Image.class)) {
     
      query.and(Image.isThumbnail, false);
    }
   

    try {

      // do search
      List<AbstractNode> filteredResults     = new LinkedList();
      List<? extends GraphObject> resultList = query.getAsList();

      // add only root folders to the list
      for (GraphObject obj : resultList) {

        if (obj instanceof AbstractNode) {
View Full Code Here

TOP

Related Classes of org.structr.core.app.Query

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.