Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.ISearchMark


  private boolean performOkMultiSearch(Set<IEntity> entitiesToSave) {
    Set<ISearchMark> searchesToUpdate = new HashSet<ISearchMark>(fEntities.size());

    for (IEntity entity : fEntities) {
      ISearchMark mark = (ISearchMark) entity;
      List<ISearchCondition> conditions = fSearchConditionList.createConditions(mark);

      if (!conditions.isEmpty()) {
        entitiesToSave.add(entity);
        searchesToUpdate.add(mark);
View Full Code Here


   */
  public void finish() {

    /* Reparent if necessary */
    for (IEntity entity : fEntities) {
      ISearchMark mark = (ISearchMark) entity;
      if (mark.getParent() != fFolderChooser.getFolder()) {
        ReparentInfo<IFolderChild, IFolder> reparent = new ReparentInfo<IFolderChild, IFolder>(mark, fFolderChooser.getFolder(), null, null);
        CoreUtils.reparentWithProperties(Collections.singletonList(reparent));
      }
    }
  }
View Full Code Here

        return select;
      }

      /* Search (exclude if another Search with same name Exists at same Location and same Conditions) */
      else if (element instanceof ISearchMark) {
        ISearchMark searchmark = (ISearchMark) element;
        Boolean select = cache.get(searchmark);
        if (select == null) {
          select = !CoreUtils.existsSearchMark(searchmark);
          cache.put(searchmark, select);
        }
View Full Code Here

      return false;
    }

    IFolder folder = fPage.getFolder();

    ISearchMark searchMark = factory.createSearchMark(null, folder, name, fPosition, fPosition != null ? true : null);
    searchMark.setMatchAllConditions(fPage.fMatchAllRadio.getSelection());

    fPage.fSearchConditionList.createConditions(searchMark);
    ISearchCondition locationCondition = fPage.getScopeCondition();
    if (locationCondition != null)
      searchMark.addSearchCondition(locationCondition);

    /* Copy all Properties from Parent or as Specified into this Mark */
    Map<String, Serializable> properties = folder.getProperties();
    for (Map.Entry<String, Serializable> property : properties.entrySet())
      searchMark.setProperty(property.getKey(), property.getValue());

    DynamicDAO.save(folder);

    /* Update the Search */
    Controller.getDefault().getSavedSearchService().updateSavedSearches(Collections.singleton(searchMark));
View Full Code Here

        news.addAll(feed.getVisibleNews());
      }

      /* Obtain this SearchMark's News */
      else if (mark instanceof ISearchMark) {
        ISearchMark searchMark = (ISearchMark) mark;
        List<NewsReference> matchingNews = searchMark.getResult();
        for (NewsReference newsRef : matchingNews) {
          INews resolvedNews = newsRef.resolve();
          if (resolvedNews != null) //TODO Remove once Bug 173 is fixed
            news.add(resolvedNews);
        }
View Full Code Here

        writer.write("<outline text=\"" + name + "\" xmlUrl=\"" + link + "\" />\n");
      }

      /* Export SearchMark */
      else if (mark instanceof ISearchMark) {
        ISearchMark searchMark = (ISearchMark) mark;
        List<ISearchCondition> conditions = searchMark.getSearchConditions();

        writer.write("<rssowl:savedsearch name=\"" + name + "\" matchAllConditions=\"" + searchMark.matchAllConditions() + "\">\n");
        for (ISearchCondition condition : conditions) {
          writer.write("\t<rssowl:searchcondition>\n");
          writer.write(toXML(condition));
          writer.write("\t</rssowl:searchcondition>\n");
        }
View Full Code Here

        return false;
    }

    /* Check if searchmark has unread if set as flag */
    else if (data instanceof ISearchMark) {
      ISearchMark searchmark = (ISearchMark) data;
      if (unread && searchmark.getResultCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED)) == 0)
        return false;
    }

    /* Folders are no valid navigation nodes */
    else if (data instanceof IFolder)
View Full Code Here

      return isMatch;
    }

    /* Element is a SearchMark */
    else if (element instanceof ISearchMark) {
      ISearchMark mark = (ISearchMark) element;
      boolean isMatch = false;

      switch (fType) {

        /* Show: All */
        case SHOW_ALL:
          isMatch = true;
          break;

        /* Show: New News */
        case SHOW_NEW:
          isMatch = mark.getResultCount(EnumSet.of(INews.State.NEW)) > 0;
          break;

        /* Show: Unread News */
        case SHOW_UNREAD:
          isMatch = mark.getResultCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED)) > 0;
          break;

        /* Show: Never visited Marks */
        case SHOW_NEVER_VISITED:
          isMatch = mark.getPopularity() <= 0;
          break;
      }

      /* Finally check the Pattern */
      if (isMatch && fMatcher != null) {
View Full Code Here

    /* Get selected Folder */
    fParent = fFolderChooser.getFolder();

    /* Create new Searchmark */
    ISearchMark searchMark = Owl.getModelFactory().createSearchMark(null, fParent, fNameInput.getText(), fPosition, fPosition != null ? true : null);
    searchMark.setMatchAllConditions(fMatchAllRadio.getSelection());

    /* Create Conditions and save in DB */
    fSearchConditionList.createConditions(searchMark);
    DynamicDAO.save(fParent);

View Full Code Here

        return bookmark.getPopularity() <= 0;
    }

    /* Element is a SearchMark */
    else if (element instanceof ISearchMark) {
      ISearchMark mark = (ISearchMark) element;

      /* First check the Pattern */
      if (fMatcher != null) {
        if (!wordMatches(mark))
          return false;
      }

      /* Show: All */
      if (fType == Type.SHOW_ALL)
        return true;

      /* Show: New News */
      else if (fType == Type.SHOW_NEW)
        return mark.getResultCount(EnumSet.of(INews.State.NEW)) > 0;

      /* Show: Unread News */
      else if (fType == Type.SHOW_UNREAD)
        return mark.getResultCount(EnumSet.of(INews.State.NEW, INews.State.UNREAD, INews.State.UPDATED)) > 0;

      /* Show: Never visited Marks */
      else if (fType == Type.SHOW_NEVER_VISITED)
        return mark.getPopularity() <= 0;
    }

    return false;
  }
View Full Code Here

TOP

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

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.