Package org.rssowl.core.persist.reference

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


    INews news = fTypesFactory.createNews(null, feed, new Date());
    fTypesFactory.createGuid(news, "http://www.link.com", true);
    DynamicDAO.save(feed);

    IFolder folder = fTypesFactory.createFolder(null, null, "Folder");
    IBookMark bookMark = fTypesFactory.createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "Mark");
    INewsBin newsBin = fTypesFactory.createNewsBin(null, folder, "bin");
    DynamicDAO.save(folder);

    INews newsCopy = fTypesFactory.createNews(news, newsBin);
    DynamicDAO.save(newsCopy);
View Full Code Here


    INews news = fTypesFactory.createNews(null, feed, new Date());
    fTypesFactory.createGuid(news, "http://www.link.com", true);
    DynamicDAO.save(feed);

    IFolder folder = fTypesFactory.createFolder(null, null, "Folder");
    fTypesFactory.createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "BookMark");
    INewsBin newsBin = fTypesFactory.createNewsBin(null, folder, "NewsBin");
    DynamicDAO.save(folder);

    INews newsCopy = fTypesFactory.createNews(news, newsBin);
    DynamicDAO.save(newsCopy);
View Full Code Here

    IFeed feed = createFeed();
    INews news = fTypesFactory.createNews(null, feed, new Date());
    DynamicDAO.save(feed);

    IFolder folder = fTypesFactory.createFolder(null, null, "Folder");
    fTypesFactory.createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "BookMark");
    NewsBin bin = (NewsBin) fTypesFactory.createNewsBin(null, folder, "News Bin");
    DynamicDAO.save(folder);

    INews newsCopy = fTypesFactory.createNews(news, bin);
    DynamicDAO.save(newsCopy);
View Full Code Here

    IFeed feed = createFeed();
    IFeed savedFeed = Owl.getPersistenceService().getDAOService().getFeedDAO().load(feed.getLink());
    if (savedFeed == null)
      savedFeed = DynamicDAO.save(feed);

    IBookMark bookMark = fTypesFactory.createBookMark(null, folder, new FeedLinkReference(savedFeed.getLink()), "Default bookmark");
    bookMark.setLastVisitDate(createDate());
    bookMark.setPopularity(50);
    bookMark.setErrorLoading(false);
    return bookMark;
  }
View Full Code Here

    news.setState(INews.State.DELETED);

    DynamicDAO.save(news);

    IFolder folder = Owl.getModelFactory().createFolder(null, null, "Root");
    IBookMark bookmark = Owl.getModelFactory().createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "Bookmark");

    DynamicDAO.save(bookmark);

    assertEquals(0, bookmark.getStickyNewsCount());
    assertEquals(0, bookmark.getNewsCount(INews.State.getVisible()));
View Full Code Here

    news.setFlagged(true);

    DynamicDAO.save(news);

    IFolder folder = Owl.getModelFactory().createFolder(null, null, "Root");
    IBookMark bookmark = Owl.getModelFactory().createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "Bookmark");

    DynamicDAO.save(bookmark);

    assertEquals(1, bookmark.getStickyNewsCount());
    assertEquals(1, bookmark.getNewsCount(INews.State.getVisible()));
View Full Code Here

    } catch (URISyntaxException e) {
      return null;
    }

    /* Check if a BookMark exists for the Link */
    Collection<IBookMark> existingBookmarks = DynamicDAO.getDAO(IBookMarkDAO.class).loadAll(new FeedLinkReference(linkAsURI));
    if (existingBookmarks.size() > 0)
      return existingBookmarks.iterator().next();

    /* Try again swapping feed:// with http:// and vice versa */
    if (link.startsWith(URIUtils.FEED) || link.startsWith(URIUtils.HTTP)) {
      if (link.startsWith(URIUtils.FEED))
        link = URIUtils.HTTP + link.substring(URIUtils.FEED.length());
      else if (link.startsWith(URIUtils.HTTP))
        link = URIUtils.FEED + link.substring(URIUtils.HTTP.length());

      try {
        linkAsURI = new URI(URIUtils.fastEncode(link));
      } catch (URISyntaxException e) {
        return null;
      }

      existingBookmarks = DynamicDAO.getDAO(IBookMarkDAO.class).loadAll(new FeedLinkReference(linkAsURI));
      if (existingBookmarks.size() > 0)
        return existingBookmarks.iterator().next();
    }

    return null;
View Full Code Here

    /* Group Input */
    int nextId = 0;
    for (Object object : input) {
      if (object instanceof INews) {
        INews news = (INews) object;
        FeedLinkReference feedRef = news.getFeedReference();

        IBookMark bookmark = feedToBookMarkCache.get(feedRef);
        if (bookmark == null) {
          Collection<IBookMark> bookmarks = bookmarkDao.loadAll(feedRef);
          if (bookmarks.isEmpty())
View Full Code Here

    IFeed feed = fFactory.createFeed(null, new URI("http://www.link.com"));
    feed.setTitle("Feed Name");
    DynamicDAO.save(feed);

    IBookMark bookmark= fFactory.createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "Feed Name");
    DynamicDAO.save(bookmark);

    INews news1 = fFactory.createNews(null, feed, new Date());
    news1.setTitle("News 1");
    news1.setPublishDate(fToday);
View Full Code Here

    /* Folder, Bookmark and Searchmark */
    IFolder folder = fFactory.createFolder(null, null, "Folder");
    folder.setProperty("key", "value");
    folder.setProperty("value", "key");

    IBookMark bm = fFactory.createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "BookMark");
    bm.setProperty("key", "value");
    bm.setProperty("value", "key");

    IFeed anotherFeed = fFactory.createFeed(null, URI.create("http://www.rssowl.org"));

    INews news1 = fFactory.createNews(null, anotherFeed, new Date());
    news1.setState(INews.State.NEW);

    INews news2 = fFactory.createNews(null, anotherFeed, new Date());
    news2.setState(INews.State.UNREAD);

    INews news4 = fFactory.createNews(null, anotherFeed, new Date());
    news4.setState(INews.State.READ);
    news4.setFlagged(true);

    INews news5 = fFactory.createNews(null, anotherFeed, new Date());
    news5.setState(INews.State.READ);
    news5.setFlagged(true);

    INews news6 = fFactory.createNews(null, anotherFeed, new Date());
    news6.setState(INews.State.READ);
    news6.setFlagged(true);

    INews news7 = fFactory.createNews(null, anotherFeed, new Date());
    news7.setState(INews.State.HIDDEN);

    DynamicDAO.save(anotherFeed);

    bm = fFactory.createBookMark(null, folder, new FeedLinkReference(URI.create("http://www.rssowl.org")), "Other BookMark");
    NewsCounter counter = DynamicDAO.getDAO(INewsCounterDAO.class).load();
    NewsCounterItem item = new NewsCounterItem(1, 2, 3);
    counter.put(bm.getFeedLinkReference().getLinkAsText(), item);
    DynamicDAO.save(counter);
    ((BookMark) bm).setNewsCounter(counter);
View Full Code Here

TOP

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

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.