Package org.structr.core

Examples of org.structr.core.Result


      Writer writer = response.getWriter();
      if (content != null) {

        // create result set
        Result result = new Result(this.content, this.content.size(), this.content.size() > 1 || serializeSingleObjectAsCollection, serializeAsPrimitiveArray);

        // serialize result set
        gson.toJson(result, writer);
      }
View Full Code Here


              resultList.addAll(relationships);
            }
          }
        }

        return new Result(resultList, null, isCollectionResource(), isPrimitiveArray());

      } catch(Throwable t) {

        logger.log(Level.WARNING, "Exception while fetching relationships", t);
      }
View Full Code Here

    if(wrappedResource != null && transformation != null) {

      // allow view transformation to avoid evaluation of wrapped resource
      if (transformation.evaluateWrappedResource()) {
       
        Result result = wrappedResource.doGet(sortKey, sortDescending, NodeFactory.DEFAULT_PAGE_SIZE, NodeFactory.DEFAULT_PAGE, null);
     
        try {

          transformation.apply(securityContext, result.getResults());
          result.setRawResultCount(result.size());

        } catch(Throwable t) {
          t.printStackTrace();
        }

        // apply paging later
        return PagingHelper.subResult(result, pageSize, page, offsetId);
       
      } else {
       
        List<? extends GraphObject> listToTransform = new LinkedList<GraphObject>();
        transformation.apply(securityContext, listToTransform);

        Result result = new Result(listToTransform, listToTransform.size(), wrappedResource.isCollectionResource(), wrappedResource.isPrimitiveArray());

        // apply paging later
        return PagingHelper.subResult(result, pageSize, page, offsetId);
       
      }
    }
   
    List emptyList = Collections.emptyList();
    return new Result(emptyList, null, isCollectionResource(), isPrimitiveArray());
  }
View Full Code Here

    return false// we will not accept URI parts directly
  }

  @Override
  public Result doGet(PropertyKey sortKey, boolean sortDescending, int pageSize, int page, String offsetId) throws FrameworkException {
    return new Result(getEntity(), isPrimitiveArray());
  }
View Full Code Here

      logger.log(Level.WARNING, "type was null");
    }

    List emptyList = Collections.emptyList();
    return new Result(emptyList, null, isCollectionResource(), isPrimitiveArray());
  }
View Full Code Here

      }


    }

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

    if (!name.isEmpty()) {

      logger.log(Level.FINE, "Requested name: {0}", name);

      final Result results = StructrApp.getInstance(securityContext).nodeQuery().and(AbstractNode.name, name).getResult();

      logger.log(Level.FINE, "{0} results", results.size());
      request.setAttribute(POSSIBLE_ENTRY_POINTS, results.getResults());

      return (results.size() > 0 ? (AbstractNode) results.get(0) : null);
    }

    return null;
  }
View Full Code Here

      query.and(GraphObject.id, uuid);
      query.and().orType(Page.class).orTypes(File.class);

      // Searching for pages needs super user context anyway
      Result results = query.getResult();

      logger.log(Level.FINE, "{0} results", results.size());
      request.setAttribute(POSSIBLE_ENTRY_POINTS, results.getResults());

      return (List<Linkable>) results.getResults();
    }

    return Collections.EMPTY_LIST;
  }
View Full Code Here

      query.and(Page.path, path);
      query.and().orType(Page.class).orTypes(File.class);

      // Searching for pages needs super user context anyway
      Result results = query.getResult();

      logger.log(Level.FINE, "{0} results", results.size());
      request.setAttribute(POSSIBLE_ENTRY_POINTS, results.getResults());

      return (List<Linkable>) results.getResults();
    }

    return Collections.EMPTY_LIST;
  }
View Full Code Here

      query.and(AbstractNode.name, name);
      query.and().orType(Page.class).orTypes(File.class);

      // Searching for pages needs super user context anyway
      Result results = query.getResult();

      logger.log(Level.FINE, "{0} results", results.size());
      request.setAttribute(POSSIBLE_ENTRY_POINTS, results.getResults());

      return (List<Linkable>) results.getResults();
    }

    return Collections.EMPTY_LIST;
  }
View Full Code Here

TOP

Related Classes of org.structr.core.Result

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.