Package org.rssowl.core.persist.reference

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


      final IFeed feed = fFactory.createFeed(null, new URI("http://www.feed.com"));
      final FeedReference feedRef = new FeedReference(DynamicDAO.save(feed).getId());

      IBookMark bookMark1 = fFactory.createBookMark(null, rootRef.resolve(), new FeedLinkReference(feed.getLink()), "Root BookMark");
      root = DynamicDAO.save(bookMark1.getParent());
      final BookMarkReference bookMarkRef1 = new BookMarkReference(root.getMarks().get(0).getId());

      IBookMark bookMark2 = fFactory.createBookMark(null, rootChildRef.resolve(), new FeedLinkReference(feed.getLink()), "Root Child BookMark");
      rootChild = DynamicDAO.save(bookMark2.getParent());
      final BookMarkReference bookMarkRef2 = new BookMarkReference(rootChild.getMarks().get(0).getId());

      IBookMark bookMark3 = fFactory.createBookMark(null, rootChildChild1Ref.resolve(), new FeedLinkReference(feed.getLink()), "Root Child Child #1 BookMark");
      rootChildChild1 = DynamicDAO.save(bookMark3.getParent());
      final BookMarkReference bookMarkRef3 = new BookMarkReference(rootChildChild1.getMarks().get(0).getId());

      final boolean bookMarkEventsIssued[] = new boolean[3];
      final boolean feedEventsIssued[] = new boolean[1];

      bookMarkListener = new BookMarkAdapter() {
        @Override
        public void entitiesDeleted(Set<BookMarkEvent> events) {
          for (BookMarkEvent event : events) {
            IBookMark bookMark = event.getEntity();

            if (bookMarkRef1.references(bookMark))
              bookMarkEventsIssued[0] = true;

            else if (bookMarkRef2.references(bookMark))
              bookMarkEventsIssued[1] = true;

            else if (bookMarkRef3.references(bookMark))
              bookMarkEventsIssued[2] = true;
          }
        }
      };
      DynamicDAO.addEntityListener(IBookMark.class, bookMarkListener);
View Full Code Here


    /* BookMarks */
    for (int i = 0; primitives[1] != null && i < primitives[1].length; i++) {
      try {
        if (primitives[1][i] != null) {
          IBookMark bookmark = new BookMarkReference(primitives[1][i]).resolve();
          if (bookmark != null)
            childs.add(bookmark);
        }
      } catch (PersistenceException e) {
        /* Ignore - Could be deleted already */
 
View Full Code Here

  private Object getInput(Object obj) {

    /* Bookmark: Return BookMarkReference */
    if (obj instanceof IBookMark)
      return new BookMarkReference(((IBookMark) obj).getId());

    /* Searchmark: Return SearchMarkReference */
    else if (obj instanceof ISearchMark)
      return new SearchMarkReference(((ISearchMark) obj).getId());

View Full Code Here

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

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

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

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

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

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

      final IFeed feed = fFactory.createFeed(null, new URI("http://www.feed.com"));
      final FeedReference feedRef = new FeedReference(DynamicDAO.save(feed).getId());

      IBookMark bookMark1 = fFactory.createBookMark(null, rootRef.resolve(), new FeedLinkReference(feed.getLink()), "Root BookMark");
      root = DynamicDAO.save(bookMark1.getParent());
      final BookMarkReference bookMarkRef1 = new BookMarkReference(root.getMarks().get(0).getId());

      IBookMark bookMark2 = fFactory.createBookMark(null, rootChildRef.resolve(), new FeedLinkReference(feed.getLink()), "Root Child BookMark");
      rootChild = DynamicDAO.save(bookMark2.getParent());
      final BookMarkReference bookMarkRef2 = new BookMarkReference(rootChild.getMarks().get(0).getId());

      IBookMark bookMark3 = fFactory.createBookMark(null, rootChildChild1Ref.resolve(), new FeedLinkReference(feed.getLink()), "Root Child Child #1 BookMark");
      rootChildChild1 = DynamicDAO.save(bookMark3.getParent());
      final BookMarkReference bookMarkRef3 = new BookMarkReference(rootChildChild1.getMarks().get(0).getId());

      final boolean bookMarkEventsIssued[] = new boolean[3];
      final boolean feedEventsIssued[] = new boolean[1];

      bookMarkListener = new BookMarkAdapter() {
        @Override
        public void entitiesDeleted(Set<BookMarkEvent> events) {
          for (BookMarkEvent event : events) {
            IBookMark bookMark = event.getEntity();

            if (bookMarkRef1.references(bookMark))
              bookMarkEventsIssued[0] = true;

            else if (bookMarkRef2.references(bookMark))
              bookMarkEventsIssued[1] = true;

            else if (bookMarkRef3.references(bookMark))
              bookMarkEventsIssued[2] = true;
          }
        }
      };
      DynamicDAO.addEntityListener(IBookMark.class, bookMarkListener);
View Full Code Here

        }
      }
    }

    else if (entity instanceof IBookMark) {
      IBookMark bookmark = new BookMarkReference(entity.getId()).resolve();
      count += bookmark.getFeedLinkReference().resolve().getVisibleNews().size();
    }

    else if (entity instanceof IFeed) {
      count += ((IFeed) entity).getVisibleNews().size();
View Full Code Here

    /* BookMarks */
    for (int i = 0; primitives[BOOKMARK] != null && i < primitives[BOOKMARK].length; i++) {
      try {
        if (primitives[BOOKMARK][i] != null && primitives[BOOKMARK][i] != 0) {
          IBookMark bookmark = new BookMarkReference(primitives[BOOKMARK][i]).resolve();
          if (bookmark != null)
            childs.add(bookmark);
        }
      } catch (PersistenceException e) {
        /* Ignore - Could be deleted already */
 
View Full Code Here

    return super.toString() + "Belongs to Feed = " + fFeedLink + ")"; //$NON-NLS-1$ //$NON-NLS-2$
  }

  /* getIdAsPrimitive is synchronized so this method doesn't need to be */
  public BookMarkReference toReference() {
    return new BookMarkReference(getIdAsPrimitive());
  }
View Full Code Here

      }

      /* Receive BookMarks */
      for (int i = 0; value[1] != null && i < value[1].length; i++) {
        if (value[1][i] != null) {
          IBookMark bookmark = new BookMarkReference(value[1][i]).resolve();
          if (bookmark != null)
            addBookMarkLocationClause(bQuery, bookmark);
        }
      }

View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.reference.BookMarkReference

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.