Examples of withTypes()


Examples of ch.entwine.weblounge.common.content.SearchQuery.withTypes()

      throw new IllegalStateException("Unable to instantiate class " + handlerClass + ": " + t.getMessage(), t);
    }

    SearchResult searchResult;
    SearchQuery q = new SearchQueryImpl(site);
    q.withTypes(MovieResource.TYPE);
    q.sortByPublishingDate(Order.Descending);
    q.withPublisher(harvesterUser);
    try {
      searchResult = contentRepository.find(q);
    } catch (ContentRepositoryException e) {
View Full Code Here

Examples of ch.entwine.weblounge.common.content.SearchQuery.withTypes()

      return SKIP_BODY;
    }

    SearchQuery query = new SearchQueryImpl(site);
    query.withVersion(Resource.LIVE);
    query.withTypes(ImageResource.TYPE);
    for (int i = 0; i < imageSubjects.size(); i++)
      query.withSubject(imageSubjects.get(i));
    SearchResult result;
    try {
      result = repository.find(query);
View Full Code Here

Examples of ch.entwine.weblounge.common.content.SearchQuery.withTypes()

    q.withText(true, queryString);
    q.withVersion(Resource.LIVE);
    q.withRececyPriority();
    q.withOffset(offset);
    q.withLimit(limit);
    q.withTypes(Page.TYPE);

    // Return the result
    SearchResult result = null;
    try {
      result = repository.find(q);
View Full Code Here

Examples of ch.entwine.weblounge.common.content.SearchQuery.withTypes()

    // TODO: Add more feed metadata, ask site

    SearchQuery query = new SearchQueryImpl(site);
    query.withVersion(Resource.LIVE);
    query.withTypes(Page.TYPE);
    query.withLimit(limit);
    query.sortByPublishingDate(Order.Descending);
    for (String subject : subjects) {
      query.withSubject(subject);
    }
View Full Code Here

Examples of ch.entwine.weblounge.common.content.SearchQuery.withTypes()

    if (uri == null && StringUtils.isNotBlank(imagePath))
      uri = new ImageResourceURIImpl(site, imagePath, null);
    if (uri == null && imageSubjects != null && imageSubjects.size() > 0) {
      SearchQuery query = new SearchQueryImpl(site);
      query.withVersion(Resource.LIVE);
      query.withTypes(ImageResource.TYPE);
      query.withSubjects(SearchQuery.Quantifier.All, imageSubjects.toArray(new String[imageSubjects.size()]));
      SearchResult result;
      try {
        result = repository.find(query);
      } catch (ContentRepositoryException e) {
View Full Code Here

Examples of ch.entwine.weblounge.common.content.SearchQuery.withTypes()

    // First time search resources
    if (searchResult == null) {
      SearchQuery q = new SearchQueryImpl(site);
      if (includeTypes != null)
        q.withTypes(includeTypes.toArray(new String[includeTypes.size()]));

      if (excludeTypes != null)
        q.withoutTypes(excludeTypes.toArray(new String[excludeTypes.size()]));

      if (order != null)
View Full Code Here

Examples of ch.entwine.weblounge.common.content.SearchQuery.withTypes()

      throw new IllegalArgumentException("ResourceURI must contain a path");

    // Load the identifier from the index
    SearchQuery q = new SearchQueryImpl(site).withPath(path);
    if (uri.getType() != null)
      q.withTypes(uri.getType());
    SearchResultItem[] items = searchIdx.getByQuery(q).getItems();
    if (items.length == 0) {
      logger.debug("Attempt to locate id for non-existing path {}", path);
      return null;
    }
View Full Code Here

Examples of ch.entwine.weblounge.common.content.SearchQuery.withTypes()

      throw new IllegalArgumentException("ResourceURI must contain an identifier");

    // Load the path from the index
    SearchQuery q = new SearchQueryImpl(site).withIdentifier(id);
    if (uri.getType() != null)
      q.withTypes(uri.getType());
    SearchResultItem[] items = searchIdx.getByQuery(q).getItems();
    if (items.length == 0) {
      logger.debug("Attempt to locate path for non existing resource '{}'", id);
      return null;
    }
View Full Code Here

Examples of ch.entwine.weblounge.common.content.SearchQuery.withTypes()

    String id = getIdentifier(uri);
    if (id == null)
      return false;
    SearchQuery q = new SearchQueryImpl(site).withIdentifier(id).withVersion(uri.getVersion()).withField(RESOURCE_ID);
    if (uri.getType() != null)
      q.withTypes(uri.getType());
    return searchIdx.getByQuery(q).getDocumentCount() > 0;
  }

  /**
   * Returns <code>true</code> if the given uri exists in any version.
View Full Code Here

Examples of ch.entwine.weblounge.common.content.SearchQuery.withTypes()

    String id = getIdentifier(uri);
    if (id == null)
      return false;
    SearchQuery q = new SearchQueryImpl(site).withIdentifier(id).withLimit(1).withField(RESOURCE_ID);
    if (uri.getType() != null)
      q.withTypes(uri.getType());
    return searchIdx.getByQuery(q).getDocumentCount() > 0;
  }

  /**
   * Returns all URIs that share the common root <code>uri</code>, are no more
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.