Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IBookMark


      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here


      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      final int removedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
View Full Code Here

      assertEquals(0, getUnreadCount(feed));
      assertEquals(0, getNewCount(feed));

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      newsListener = new NewsListener() {
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

    AttachmentListener attachmentListener = null;
    try {
      IFeed feed = new Feed(new URI("inmemory://rss_2_0.xml")); //$NON-NLS-1$
      feed = DynamicDAO.save(feed);

      IBookMark bookmark = createBookMark(feed);

      final int addedCounter[] = new int[] { 0 };
      final int updatedCounter[] = new int[] { 0 };
      attachmentListener = new AttachmentListener() {
        public void entitiesAdded(Set<AttachmentEvent> events) {
View Full Code Here

    assertEquals(0, getUnreadCount(feed));
    assertEquals(0, getNewCount(feed));

    FeedReference feedRef = new FeedReference(feed.getId());

    IBookMark bookmark = createBookMark(feed);
    IPreferenceScope preferences = Owl.getPreferenceService().getEntityScope(bookmark);
    preferences.putInteger(DefaultPreferences.DEL_NEWS_BY_COUNT_VALUE, 0);
    preferences.putBoolean(DefaultPreferences.DEL_NEWS_BY_COUNT_STATE, true);

    /* First Reload */
 
View Full Code Here

      IFeed feed = new Feed(new URI("inmemory://rss_2_0.xml")); //$NON-NLS-1$
      feed = DynamicDAO.save(feed);

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      InMemoryProtocolHandler.FEED = generateFeedWithDuplicateNews("News Title", null, null, null, "Description", null, null, null);
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      DynamicDAO.delete(feedRef.resolve());
    }

    /* Duplicate News with: Title, Link */
    {
      IFeed feed = new Feed(new URI("inmemory://rss_2_0.xml")); //$NON-NLS-1$
      feed = DynamicDAO.save(feed);

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      InMemoryProtocolHandler.FEED = generateFeedWithDuplicateNews("News Title", "http://www.link.com", null, null, "Description", null, null, null);
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      DynamicDAO.delete(feedRef.resolve());
    }

    /* Duplicate News with: Title, Guid */
    {
      IFeed feed = new Feed(new URI("inmemory://rss_2_0.xml")); //$NON-NLS-1$
      feed = DynamicDAO.save(feed);

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      InMemoryProtocolHandler.FEED = generateFeedWithDuplicateNews("News Title", null, "http://www.link.com", null, "Description", null, null, null);
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      DynamicDAO.delete(feedRef.resolve());
    }

    /* Duplicate News with: Title, Link, Guid */
    {
      IFeed feed = new Feed(new URI("inmemory://rss_2_0.xml")); //$NON-NLS-1$
      feed = DynamicDAO.save(feed);

      FeedReference feedRef = new FeedReference(feed.getId());

      IBookMark bookmark = createBookMark(feed);

      InMemoryProtocolHandler.FEED = generateFeedWithDuplicateNews("News Title", "http://www.link.com", "http://www.guid.com", null, "Description", null, null, null);
      fController.reload(bookmark, null, new NullProgressMonitor());
      assertEquals(1, feedRef.resolve().getNews().size());
      DynamicDAO.delete(feedRef.resolve());
View Full Code Here

          }
        }

        feed = DynamicDAO.save(feed);

        IBookMark bookmark = new BookMark(null, rootFolder, new FeedLinkReference(feed.getLink()), "Bookmark");

        if (withRetention)
          Owl.getPreferenceService().getEntityScope(bookmark).putBoolean(DefaultPreferences.DEL_READ_NEWS_STATE, true);

        rootFolder.addMark(bookmark, null, false);
        DynamicDAO.save(rootFolder);
      } catch (Exception e) {
        Activator.getDefault().logError(e.getMessage(), e);
      }
    }

    /* Create Tasks */
    List<IMark> marks = rootFolder.getMarks();
    for (IMark mark : marks) {
      if (mark instanceof IBookMark) {
        final IBookMark bookmark = (IBookMark) mark;

        tasks.add(new TaskAdapter() {
          public IStatus run(IProgressMonitor monitor) {
            return fController.reload(bookmark, null, new NullProgressMonitor());
          }
View Full Code Here

TOP

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

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.