Examples of NewsBinReference


Examples of org.rssowl.core.persist.reference.NewsBinReference

    /* Location: Bin */
    if (news.getParentId() > 0) {
      String location = fMapBinIdToLocation.get(news.getParentId());
      if (location == null) {
        NewsBinReference ref = new NewsBinReference(news.getParentId());
        INewsBin bin = ref.resolve();
        location = bin.getName();
        fMapBinIdToLocation.put(news.getParentId(), location);
      }

      return location;
View Full Code Here

Examples of org.rssowl.core.persist.reference.NewsBinReference

    INewsMark lastOpenedNewsMark = null;
    for (int i = 0; i < newsToOpen.size() && openedEditors < maxOpenEditors; i++) {
      INews news = newsToOpen.get(i);
      INewsMark newsmark;
      if (news.getParentId() != 0)
        newsmark = new NewsBinReference(news.getParentId()).resolve();
      else
        newsmark = CoreUtils.getBookMark(news.getFeedReference());

      /* Open and Select */
      if (newsmark != null) {
View Full Code Here

Examples of org.rssowl.core.persist.reference.NewsBinReference

        if (end < 0)
          end = parameters.length();

        StringTokenizer tokenizer = new StringTokenizer(parameters.substring(start, end), ",");//$NON-NLS-1$
        while (tokenizer.hasMoreElements()) {
          NewsBinReference ref = new NewsBinReference(Long.valueOf((String) tokenizer.nextElement()));
          elements.addAll(Arrays.asList(newsContentProvider.getElements(ref)));
        }
      }

      /* Look for SearchMarks that are to displayed */
 
View Full Code Here

Examples of org.rssowl.core.persist.reference.NewsBinReference

    /* News Bins */
    if (primitives.length == 3) {
      for (int i = 0; primitives[NEWSBIN] != null && i < primitives[NEWSBIN].length; i++) {
        try {
          if (primitives[NEWSBIN][i] != null && primitives[NEWSBIN][i] != 0) {
            INewsBin newsbin = new NewsBinReference(primitives[NEWSBIN][i]).resolve();
            if (newsbin != null)
              childs.add(newsbin);
          }
        } catch (PersistenceException e) {
          /* Ignore - Could be deleted already */
 
View Full Code Here

Examples of org.rssowl.core.persist.reference.NewsBinReference

  public synchronized List<NewsReference> getNewsRefs(Set<State> states) {
    return fNewsContainer.getNews(states);
  }

  public NewsBinReference toReference() {
    return new NewsBinReference(getIdAsPrimitive());
  }
View Full Code Here

Examples of org.rssowl.core.persist.reference.NewsBinReference

      /* Receive NewsBins */
      if (value.length == 3) {
        for (int i = 0; value[2] != null && i < value[2].length; i++) {
          if (value[2][i] != null) {
            INewsBin newsbin = new NewsBinReference(value[2][i]).resolve();
            if (newsbin != null)
              addNewsBinLocationClause(bQuery, newsbin);
          }
        }
      }
View Full Code Here

Examples of org.rssowl.core.persist.reference.NewsBinReference

    DynamicDAO.save(fFactory.createNews(news2, bin));
    DynamicDAO.save(fFactory.createNews(news3, bin));

    DynamicDAO.save(bin);

    NewsBinReference binRef = new NewsBinReference(bin.getId());
    int popularity = bin.getPopularity();
    Date lastVisitDate = bin.getLastVisitDate();

    if (lastVisitDate == null) {
      lastVisitDate = new Date();
    }
    Thread.sleep(100);

    INewsBinDAO dao = DynamicDAO.getDAO(INewsBinDAO.class);
    dao.visited(bin);
    bin = null;
    System.gc();

    bin = binRef.resolve();
    assertEquals(popularity + 1, bin.getPopularity());
    assertTrue(bin.getLastVisitDate().compareTo(lastVisitDate) > 0);
    assertTrue(bin.getLastVisitDate().compareTo(new Date()) < 0);
    assertEquals(3, bin.getNews().size());

    bin = null;
    System.gc();

    bin = binRef.resolve();
    dao.visited(bin);
    dao.visited(bin);
    dao.visited(bin);

    bin = null;
    System.gc();

    bin = binRef.resolve();
    assertEquals(3, bin.getNews().size());
  }
View Full Code Here

Examples of org.rssowl.core.persist.reference.NewsBinReference

          /* Location: Bin */
          if (news.getParentId() > 0) {
            String location = fMapBinIdToLocation.get(news.getParentId());
            if (location == null) {
              NewsBinReference ref = new NewsBinReference(news.getParentId());
              INewsBin bin = ref.resolve();
              location = bin.getName();
              fMapBinIdToLocation.put(news.getParentId(), location);
            }

            text = location;
View Full Code Here

Examples of org.rssowl.core.persist.reference.NewsBinReference

      if (MoveNewsAction.ID.equals(action.getActionId()) || CopyNewsAction.ID.equals(action.getActionId())) {
        Object value = action.getData();
        if (value instanceof Long[]) {
          Long[] binIds = (Long[]) value;
          for (Long binId : binIds) {
            INewsBin bin = new NewsBinReference(binId).resolve();
            if (bin != null && !selectedElements.contains(bin))
              selectedElements.add(bin);
          }
        }
      }
View Full Code Here

Examples of org.rssowl.core.persist.reference.NewsBinReference

          /* Location: Bin */
          if (news.getParentId() > 0) {
            String location = fMapBinIdToLocation.get(news.getParentId());
            if (location == null) {
              NewsBinReference ref = new NewsBinReference(news.getParentId());
              INewsBin bin = ref.resolve();
              location = bin.getName();
              fMapBinIdToLocation.put(news.getParentId(), location);
            }

            text = location;
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.