Package ch.entwine.weblounge.common.content

Examples of ch.entwine.weblounge.common.content.SearchResultItem


    Page page = null;
    WebUrl url = null;

    // Look for the next header
    while (!found && index < pages.getItems().length) {
      SearchResultItem candidateItem = pages.getItems()[index];
      if (!(candidateItem instanceof PageSearchResultItem)) {
        index++;
        continue;
      }
      item = (PageSearchResultItem) candidateItem;
View Full Code Here


    SearchResult result = contentRepository.find(query);
    List<SyndEntry> entries = new ArrayList<SyndEntry>();
    limit = result.getItems().length;

    while (limit > 0) {
      SearchResultItem item = result.getItems()[limit - 1];
      limit--;

      // Get the page
      PageSearchResultItem pageItem = (PageSearchResultItem) item;
      Page page = pageItem.getPage();

      // TODO: Can the page be accessed?

      // Set the page's language to the feed language
      page.switchTo(language);

      // Tag the cache entry
      response.addTag(CacheTag.Resource, page.getIdentifier());

      // If this is to become the most recent entry, let's set the feed's
      // modification date to be that of this entry
      if (entries.size() == 0) {
        feed.setPublishedDate(page.getPublishFrom());
      }

      // Create the entry
      SyndEntry entry = new SyndEntryImpl();
      entry.setPublishedDate(page.getPublishFrom());
      entry.setLink(site.getHostname(request.getEnvironment()).toExternalForm() + item.getUrl().getLink());
      entry.setAuthor(page.getCreator().getName());
      entry.setTitle(page.getTitle());

      // Categories
      if (page.getSubjects().length > 0) {
View Full Code Here

  /**
   * Test method for {@link ch.entwine.weblounge.common.impl.content.SearchResultItemImpl#compareTo(ch.entwine.weblounge.common.content.SearchResultItem)}.
   */
  @Test
  public void testCompareToSearchResultItem() {
    SearchResultItem nextItem = new SearchResultItemImpl(id, site, url, relevance + 1.0, source);
    assertTrue(item.compareTo(nextItem) > 0);
  }
View Full Code Here

  /**
   * Test method for {@link ch.entwine.weblounge.common.impl.content.SearchResultItemImpl#compareTo(ch.entwine.weblounge.common.content.SearchResultItem)}.
   */
  @Test
  public void testCompareToSearchResultItem() {
    SearchResultItem nextItem = new SearchResultItemImpl(id, site, url, relevance + 1.0, source);
    assertTrue(item.compareTo(nextItem) > 0);
  }
View Full Code Here

        float score = doc.getScore();

        // Have the serializer in charge create a type-specific search result
        // item
        try {
          SearchResultItem item = serializer.toSearchResultItem(query.getSite(), score, metadata);
          result.addResultItem(item);
        } catch (Throwable t) {
          logger.warn("Error during search result serialization: '{}'. Skipping this search result.", t.getMessage());
          size--;
          continue;
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.content.SearchResultItem

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.