Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.ISearch


      filterElement.setAttribute(Attributes.ENABLED.get(), String.valueOf(isEnabled));
      filterElement.setAttribute(Attributes.MATCH_ALL_NEWS.get(), String.valueOf(matchAllNews));
      body.addContent(filterElement);

      /* Export Search if provided */
      ISearch search = filter.getSearch();
      if (search != null) {
        List<ISearchCondition> conditions = search.getSearchConditions();

        Element searchElement = new Element(Tag.SEARCH.get(), RSSOWL_NS);
        searchElement.setAttribute(Attributes.MATCH_ALL_CONDITIONS.get(), String.valueOf(search.matchAllConditions()));
        filterElement.addContent(searchElement);

        for (ISearchCondition condition : conditions) {
          Element conditionElement = new Element(Tag.SEARCH_CONDITION.get(), RSSOWL_NS);
          searchElement.addContent(conditionElement);
View Full Code Here


    else if (entity instanceof IPreference) {
      IPreference pref = (IPreference) entity;
      modelEvent = new PreferenceEvent(pref);
    }
    else if (entity instanceof ISearch) {
      ISearch search = (ISearch) entity;
      modelEvent = new SearchEvent(search, root);
    }
    else if (entity instanceof ISearchFilter) {
      ISearchFilter filter = (ISearchFilter) entity;
      modelEvent = new SearchFilterEvent(filter, root);
View Full Code Here

    return fEditedFilter != null ? fEditedFilter : fAddedFilter;
  }

  private ISearchFilter createFilter(List<IFilterAction> actions) {
    IModelFactory factory = Owl.getModelFactory();
    ISearch search = createSearch();

    /* Create Actions */
    ISearchFilter filter = factory.createSearchFilter(null, search, fNameInput.getText());
    filter.setEnabled(true);
    filter.setMatchAllNews(fMatchAllNewsRadio.getSelection());
View Full Code Here

    return filter;
  }

  private ISearch createSearch() {
    IModelFactory factory = Owl.getModelFactory();
    ISearch search = null;
    ISearchCondition locationCondition = fLocationControl.toScopeCondition();

    /* Only use Location Condition */
    if (locationCondition != null && fMatchAllNewsRadio.getSelection()) {
      search = factory.createSearch(null);
      search.addSearchCondition(locationCondition);
    }

    /* Build Conditions from Location and List */
    else if (!fMatchAllNewsRadio.getSelection()) {
      List<ISearchCondition> conditions = fSearchConditionList.createConditions();
      if (locationCondition != null)
        conditions.add(locationCondition);
      search = factory.createSearch(null);
      search.setMatchAllConditions(fMatchAllRadio.getSelection());
      for (ISearchCondition condition : conditions) {
        search.addSearchCondition(condition);
      }
    }

    return search;
  }
View Full Code Here

    /* Update Conditioner */
    fEditedFilter.setMatchAllNews(fMatchAllNewsRadio.getSelection());

    /* Update Search */
    ISearch oldSearch = fEditedFilter.getSearch();
    fEditedFilter.setSearch(createSearch());
    if (oldSearch != null)
      DynamicDAO.delete(oldSearch);
  }
View Full Code Here

    return fEditedFilter != null ? fEditedFilter : fAddedFilter;
  }

  private ISearchFilter createFilter(List<IFilterAction> actions) {
    IModelFactory factory = Owl.getModelFactory();
    ISearch search = createSearch();

    /* Create Actions */
    ISearchFilter filter = factory.createSearchFilter(null, search, fNameInput.getText());
    filter.setEnabled(true);
    filter.setMatchAllNews(fMatchAllNewsRadio.getSelection());
View Full Code Here

    return filter;
  }

  private ISearch createSearch() {
    IModelFactory factory = Owl.getModelFactory();
    ISearch search = null;
    ISearchCondition locationCondition = fLocationControl.toScopeCondition();

    /* Only use Location Condition */
    if (locationCondition != null && fMatchAllNewsRadio.getSelection()) {
      search = factory.createSearch(null);
      search.addSearchCondition(locationCondition);
    }

    /* Build Conditions from Location and List */
    else if (!fMatchAllNewsRadio.getSelection()) {
      List<ISearchCondition> conditions = fSearchConditionList.createConditions();
      if (locationCondition != null)
        conditions.add(locationCondition);
      search = factory.createSearch(null);
      search.setMatchAllConditions(fMatchAllRadio.getSelection());
      for (ISearchCondition condition : conditions) {
        search.addSearchCondition(condition);
      }
    }

    return search;
  }
View Full Code Here

    /* Update Conditioner */
    fEditedFilter.setMatchAllNews(fMatchAllNewsRadio.getSelection());

    /* Update Search */
    ISearch oldSearch = fEditedFilter.getSearch();
    fEditedFilter.setSearch(createSearch());
    if (oldSearch != null)
      DynamicDAO.delete(oldSearch);
  }
View Full Code Here

   * bin that no longer exists.
   */
  public static boolean isOrphaned(ISearchFilter filter) {

    /* Check Search */
    ISearch search = filter.getSearch();
    if (search != null && isOrphaned(search))
      return true;

    /* Check Actions */
    boolean isOrphaned = false;
View Full Code Here

      modelEvent = new SearchConditionEvent(searchCond, root);
    } else if (entity instanceof IPreference) {
      IPreference pref = (IPreference) entity;
      modelEvent = new PreferenceEvent(pref);
    } else if (entity instanceof ISearch) {
      ISearch search = (ISearch) entity;
      modelEvent = new SearchEvent(search, root);
    } else if (entity instanceof ISearchFilter) {
      ISearchFilter filter = (ISearchFilter) entity;
      modelEvent = new SearchFilterEvent(filter, root);
    }
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.