Package org.rssowl.core.internal.persist

Examples of org.rssowl.core.internal.persist.BookMark


    subRootFolder1.addFolder(subRoot1Folder1, null, false);

    IFolder subRoot11Folder1 = new Folder(null, subRoot1Folder1, "SubRoot11Folder1");
    subRoot1Folder1.addFolder(subRoot11Folder1, null, false);

    IBookMark subRoot11Mark1 = new BookMark(null, subRoot1Folder1, feed, "SubRoot11Mark1");
    subRoot1Folder1.addMark(subRoot11Mark1, null, false);

    IBookMark subRoot1Mark1 = new BookMark(null, subRootFolder1, feed, "SubRoot1Mark1");
    subRootFolder1.addMark(subRoot1Mark1, null, false);

    IBookMark subRoot1Mark2 = new BookMark(null, subRootFolder1, feed, "SubRoot1Mark2");
    subRootFolder1.addMark(subRoot1Mark2, null, false);

    /* Begin Testing */
    assertEquals(true, CoreUtils.hasChildRelation(root, subRootFolder1));
    assertEquals(true, CoreUtils.hasChildRelation(root, subRoot1Folder1));
View Full Code Here


   */
  @Test
  public void testAddUpdateAndGetBookMark() {
    BookMarkListener bookMarkListener = null;
    try {
      final BookMark initialBookMark = (BookMark) createBookMark();
      final BookMark[] updatedBookMark = new BookMark[1];
      final boolean[] bookMarkAddedCalled = new boolean[] { false };
      final boolean[] bookMarkUpdatedCalled = new boolean[] { false };
      bookMarkListener = new BookMarkAdapter() {
        @Override
        public void entitiesAdded(Set<BookMarkEvent> events) {
          BookMarkEvent event = events.iterator().next();
          try {
            bookMarkAddedCalled[0] = true;
            BookMark dbBookMark = (BookMark) event.getEntity();
            initialBookMark.setId(dbBookMark.getId());
            assertTrue(initialBookMark.isIdentical(dbBookMark));
            dbBookMark.setName("Another name");
            updatedBookMark[0] = dbBookMark;
            DynamicDAO.save(dbBookMark);
          } catch (PersistenceException e) {
            fail(e.getMessage());
          }
        }

        @Override
        public void entitiesUpdated(Set<BookMarkEvent> events) {
          BookMarkEvent event = events.iterator().next();
          bookMarkUpdatedCalled[0] = true;
          BookMark dbBookMark = (BookMark) event.getEntity();
          assertTrue(updatedBookMark[0].isIdentical(dbBookMark));
        }
      };
      DynamicDAO.addEntityListener(IBookMark.class, bookMarkListener);
      DynamicDAO.save(initialBookMark);
View Full Code Here

    subRootFolder1.addFolder(subRoot1Folder1, null, false);

    IFolder subRoot11Folder1 = new Folder(null, subRoot1Folder1, "SubRoot11Folder1");
    subRoot1Folder1.addFolder(subRoot11Folder1, null, false);

    IBookMark subRoot11Mark1 = new BookMark(null, subRoot1Folder1, feed, "SubRoot11Mark1");
    subRoot1Folder1.addMark(subRoot11Mark1, null, false);

    IBookMark subRoot1Mark1 = new BookMark(null, subRootFolder1, feed, "SubRoot1Mark1");
    subRootFolder1.addMark(subRoot1Mark1, null, false);

    IBookMark subRoot1Mark2 = new BookMark(null, subRootFolder1, feed, "SubRoot1Mark2");
    subRootFolder1.addMark(subRoot1Mark2, null, false);

    /* Begin Testing */
    assertEquals(true, CoreUtils.hasChildRelation(root, subRootFolder1));
    assertEquals(true, CoreUtils.hasChildRelation(root, subRoot1Folder1));
View Full Code Here

    IFolder subRoot1Folder1 = new Folder(null, subRootFolder1, "SubRoot1Folder1");
    subRootFolder1.addFolder(subRoot1Folder1, null, false);

    subRoot1Folder1.addFolder(new Folder(null, subRoot1Folder1, "SubRoot11Folder1"), null, false);
    subRoot1Folder1.addMark(new BookMark(null, subRoot1Folder1, feed, "SubRoot11Mark1"), null, false);

    subRootFolder1.addMark(new BookMark(null, subRootFolder1, feed, "SubRoot1Mark1"), null, false);
    subRootFolder1.addMark(new BookMark(null, subRootFolder1, feed, "SubRoot1Mark2"), null, false);

    /* Sub Root 2 */
    IFolder subRootFolder2 = new Folder(null, root, "SubRootFolder2");
    root.addFolder(subRootFolder2, null, false);

    subRootFolder2.addMark(new BookMark(null, subRootFolder2, feed, "SubRoot2Mark1"), null, false);

    IFolder subRoot2Folder1 = new Folder(null, subRootFolder2, "SubRoot2Folder1");
    subRootFolder2.addFolder(subRoot2Folder1, null, false);

    IFolder subRoot21Folder1 = new Folder(null, subRoot2Folder1, "SubRoot21Folder1");
    subRoot2Folder1.addFolder(subRoot21Folder1, null, false);

    IBookMark subRoot211Mark1 = new BookMark(null, subRoot21Folder1, feed, "SubRoot211Mark1");
    subRoot21Folder1.addMark(subRoot211Mark1, null, false);

    /* Sub Root 3 */
    IFolder subRootFolder3 = new Folder(null, root, "SubRootFolder1");
    root.addFolder(subRootFolder3, null, false);

    IFolder subRoot3Folder1 = new Folder(null, subRootFolder3, "SubRoot3Folder1");
    subRootFolder3.addFolder(subRoot3Folder1, null, false);

    subRoot3Folder1.addMark(new BookMark(null, subRoot3Folder1, feed, "SubRoot31Mark1"), null, false);

    return beginFromRoot ? new ModelTreeNode(root) : new ModelTreeNode(subRoot211Mark1);
  }
View Full Code Here

    for (int i = 0; i < 5; i++)
      OwlUI.deleteImage(i);

    IFeed feed = new Feed(new URI("http://www.rssowl.org/node/feed"));
    IFolder root = new Folder(null, null, "Root");
    IBookMark bookmark = new BookMark(null, root, new FeedLinkReference(feed.getLink()), "Bookmark");
    root.addMark(bookmark, null, false);

    feed = DynamicDAO.save(feed);
    DynamicDAO.save(root);
View Full Code Here

        IFeed feed = new Feed(feedLink);

        feed = DynamicDAO.save(feed);

        IBookMark bookmark = new BookMark(null, rootFolder, new FeedLinkReference(feed.getLink()), "Bookmark");
        IPreferenceScope entityScope = Owl.getPreferenceService().getEntityScope(bookmark);
        entityScope.putInteger(DefaultPreferences.DEL_NEWS_BY_COUNT_VALUE, 50);
        rootFolder.addMark(bookmark, null, false);
        DynamicDAO.save(rootFolder);
      } catch (Exception e) {
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);
View Full Code Here

TOP

Related Classes of org.rssowl.core.internal.persist.BookMark

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.