Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.ISearch


  private static List<ISearch> getLocationConditionSearchesFromFilters(List<ISearchFilter> filters) {
    List<ISearch> locationConditionSearches = new ArrayList<ISearch>();

    for (ISearchFilter filter : filters) {
      ISearch search = filter.getSearch();
      if (search != null && containsLocationCondition(search))
        locationConditionSearches.add(search);
    }

    return locationConditionSearches;
View Full Code Here


  /**
   * @throws Exception
   */
  @Test
  public void testSearchReference() throws Exception {
    ISearch search = fFactory.createSearch(null);
    search = DynamicDAO.save(search);

    assertEquals(search, search.toReference().resolve());
  }
View Full Code Here

    INews news3 = createNews(feed, "News3");
    news3.setState(INews.State.NEW);

    {
      ISearch search = createStickySearch(true);

      ISearchFilter filter = fFactory.createSearchFilter(null, search, "New News");
      filter.setEnabled(true);

      IFilterAction action = fFactory.createFilterAction(STOP_FILTER_ID);
View Full Code Here

    INews news3 = createNews(feed, "News3");
    news3.setState(INews.State.NEW);

    {
      ISearch search = createStickySearch(true);

      ISearchFilter filter = fFactory.createSearchFilter(null, search, "New News");
      filter.setEnabled(false);

      IFilterAction action = fFactory.createFilterAction(STOP_FILTER_ID);
View Full Code Here

      DynamicDAO.save(filter);
    }

    {
      ISearch search = createStickySearch(true);

      ISearchFilter filter = fFactory.createSearchFilter(null, search, "New News");
      filter.setEnabled(true);

      IFilterAction action = fFactory.createFilterAction(STOP_FILTER_ID);
View Full Code Here

    DynamicDAO.save(bin1);
    DynamicDAO.save(bin2);

    /* Filter "Title is Title": Mark Read, Sticky, Label, Copy */
    {
      ISearch search = createTitleSearch("Title");

      ISearchFilter filter = fFactory.createSearchFilter(null, search, "Title is Title");
      filter.setEnabled(true);
      filter.setOrder(0);

      filter.addAction(fFactory.createFilterAction(MARK_READ_ID));
      filter.addAction(fFactory.createFilterAction(MARK_STICKY_ID));

      IFilterAction labelAction = fFactory.createFilterAction(LABEL_NEWS_ID);
      labelAction.setData(label.getId());
      filter.addAction(labelAction);

      IFilterAction copyAction = fFactory.createFilterAction(COPY_NEWS_ID);
      copyAction.setData(new Long[] { bin1.getId(), bin2.getId() });
      filter.addAction(copyAction);

      DynamicDAO.save(filter);
    }

    /* Filter "Title is Other": Move */
    {
      ISearch search = createTitleSearch("Other");

      ISearchFilter filter = fFactory.createSearchFilter(null, search, "Title is Other");
      filter.setEnabled(true);
      filter.setOrder(1);

View Full Code Here

    news2.setState(INews.State.NEW);

    INews news3 = createNews(feed, "News3");
    news3.setState(INews.State.NEW);

    ISearch search = createScopeSearch(bm1);

    ISearchFilter filter = fFactory.createSearchFilter(null, search, "All News in BM1");
    filter.setMatchAllNews(true);
    filter.setEnabled(true);
View Full Code Here

    news2.setState(INews.State.NEW);

    INews news3 = createNews(feed, "News3");
    news3.setState(INews.State.NEW);

    ISearch search = createScopeSearch(bm2);

    ISearchFilter filter = fFactory.createSearchFilter(null, search, "All News in BM2");
    filter.setMatchAllNews(true);
    filter.setEnabled(true);
View Full Code Here

    List<INews> binNews = bin.getNews();
    assertEquals(0, binNews.size());
  }

  private ISearch createStickySearch(boolean sticky) {
    ISearch search = fFactory.createSearch(null);
    ISearchField field = fFactory.createSearchField(INews.IS_FLAGGED, INews.class.getName());

    ISearchCondition condition = fFactory.createSearchCondition(field, SearchSpecifier.IS, sticky);
    search.addSearchCondition(condition);

    return search;
  }
View Full Code Here

    return search;
  }

  private ISearch createScopeSearch(IFolderChild scope) {
    ISearch search = fFactory.createSearch(null);
    ISearchField field = fFactory.createSearchField(INews.LOCATION, INews.class.getName());

    ISearchCondition condition = fFactory.createSearchCondition(field, SearchSpecifier.SCOPE, ModelUtils.toPrimitive(Arrays.asList(new IFolderChild[] { scope })));
    search.addSearchCondition(condition);

    return search;
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.ISearch

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.