Package org.rssowl.core.persist.reference

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


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

    FeedReference feedRef = new FeedReference(feed.getId());
    System.gc();
    DynamicDAO.delete(feedRef.resolve());
    assertNull(DynamicDAO.load(IFeed.class, feedRef.getId()));
  }
View Full Code Here


  @Test
  public void testAddAndDeleteFeed() {
    try {
      IFeed feed = createFeed();
      feed = DynamicDAO.save(feed);
      DynamicDAO.delete(new FeedReference(feed.getId()).resolve());
      assertNull(DynamicDAO.load(IFeed.class, feed.getId()));
    } catch (PersistenceException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    else {
      URI uri = createURI(link);
      if (uri != null) {

        /* Check if a Feed with the URL already exists */
        FeedReference feedRef = Owl.getPersistenceService().getDAOService().getFeedDAO().loadReference(uri);

        /* Create a new Feed then */
        if (feedRef == null) {
          IFeed feed = Owl.getModelFactory().createFeed(null, uri);
          feed.setHomepage(homepage != null ? createURI(homepage) : null);
View Full Code Here

  public final FeedReference loadReference(URI link) {
    IFeed feed = DBHelper.loadFeed(fDb, link, null);
    if (feed == null) {
      return null;
    }
    return new FeedReference(feed.getId());
  }
View Full Code Here

    }

    IFeedDAO feedDAO = DynamicDAO.getDAO(IFeedDAO.class);

    /* Check if a Feed with the URL already exists */
    FeedReference feedRef = feedDAO.loadReference(uriObj[0]);

    /* Create a new Feed then */
    if (feedRef == null) {
      IFeed feed = Owl.getModelFactory().createFeed(null, uriObj[0]);
      feed = feedDAO.save(feed);
View Full Code Here

          /* Create URL */
          URI newFeedLink = new URI(uriAsString.trim());
          fReloadRequired = true;

          /* Try to load this Feed from the DB (might be existing already) */
          FeedReference feedRef = daoService.getFeedDAO().loadReference(newFeedLink);

          /* This is a new Feed, so create it! */
          if (feedRef == null) {
            IFeed feed = Owl.getModelFactory().createFeed(null, newFeedLink);
            feed = DynamicDAO.save(feed);
View Full Code Here

  public final FeedReference loadReference(URI link) {
    IFeed feed = DBHelper.loadFeed(fDb, link, null);
    if (feed == null) {
      return null;
    }
    return new FeedReference(feed.getId());
  }
View Full Code Here

    AttachmentListener attachmentListener = null;
    PersonListener personListener = null;
    CategoryListener categoryListener = null;
    try {
      IFeed feed = fFactory.createFeed(null, new URI("http://www.foobar.com"));
      FeedReference feedReference = new FeedReference(DynamicDAO.save(feed).getId());

      /* Check News Added */
      final INews news = fFactory.createNews(null, feedReference.resolve(), new Date());
      news.setTitle("News Title");
      final boolean newsAdded[] = new boolean[1];
      newsListener = new NewsAdapter() {
        @Override
        public void entitiesAdded(Set<NewsEvent> events) {
View Full Code Here

  public void testDeleteFeedNewsAndAttachment() throws Exception {
    NewsListener newsListener = null;
    AttachmentListener attachmentListener = null;
    try {
      IFeed feed = fFactory.createFeed(null, new URI("http://www.foobar.com"));
      FeedReference feedReference = new FeedReference(DynamicDAO.save(feed).getId());

      /* Check News Added */
      final INews news = fFactory.createNews(null, feedReference.resolve(), new Date());
      news.setTitle("News Title");
      final IAttachment attachment0 = fFactory.createAttachment(null, news);
      attachment0.setLink(new URI("http://www.attachment1.com"));
      final IAttachment attachment1 = fFactory.createAttachment(null, news);
      attachment1.setLink(new URI("http://www.attachment1.com"));
View Full Code Here

    NewsListener newsListener = null;
    AttachmentListener attachmentListener = null;
    try {
      final URI feedURI = new URI("http://www.foobar.com");
      IFeed feed = fFactory.createFeed(null, feedURI);
      FeedReference feedReference = new FeedReference(DynamicDAO.save(feed).getId());

      /* Check News Added */
      final INews news = fFactory.createNews(null, feedReference.resolve(), new Date());
      news.setTitle("News Title");
      final IAttachment attachment1 = fFactory.createAttachment(null, news);
      attachment1.setLink(new URI("http://www.attachment1.com"));
      DynamicDAO.save(news);

View Full Code Here

TOP

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

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.