Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.ICategory


    else if ("rights".equals(name) && type instanceof IFeed) //$NON-NLS-1$
      ((IFeed) type).setCopyright(element.getText());

    /* Subject */
    else if ("subject".equals(name) && type instanceof IEntity) { //$NON-NLS-1$
      ICategory category = Owl.getModelFactory().createCategory(null, (IEntity) type);
      category.setName(element.getText());
    }

    /* Identifier */
    else if ("identifier".equals(name) && type instanceof INews) { //$NON-NLS-1$
      Owl.getModelFactory().createGuid((INews) type, element.getText(), null);
View Full Code Here


    else if (entity instanceof IAttachment) {
      IAttachment attachment = (IAttachment) entity;
      modelEvent = new AttachmentEvent(attachment, root);
    }
    else if (entity instanceof ICategory) {
      ICategory category = (ICategory) entity;
      modelEvent = new CategoryEvent(category, root);
    }
    else if (entity instanceof IFeed) {
      IFeed feed = (IFeed) entity;
      modelEvent = new FeedEvent(feed, root);
View Full Code Here

    INews news = fFactory.createNews(null, feed, new Date());
    news.setTitle("News Title #1");
    news.setLink(new URI("http://www.link.com"));
    news.setState(INews.State.UNREAD);

    final ICategory category = fFactory.createCategory(null, news);
    category.setName("Category name");

    final IAttachment attachment = fFactory.createAttachment(null, news);
    attachment.setLink(new URI("http://attachment.com"));

    feed = DynamicDAO.save(feed);

    final INews savedNews = feed.getNews().get(0);
    savedNews.setTitle("News Title Updated #1");

    Collection<INews> newsList = new ArrayList<INews>();
    newsList.add(savedNews);

    NewsListener newsListener = new NewsAdapter() {
      @Override
      public void entitiesUpdated(Set<NewsEvent> events) {
        assertEquals(1, events.size());
        NewsEvent event = events.iterator().next();
        assertEquals(true, event.getEntity().equals(savedNews));
        INews oldNews = event.getOldNews();
        assertEquals(State.UNREAD, oldNews.getState());
        assertEquals(State.UNREAD, event.getEntity().getState());
        assertEquals(category.getName(), oldNews.getCategories().get(0).getName());
        IAttachment oldAttachment = oldNews.getAttachments().get(0);
        assertEquals(attachment.getLink(), oldAttachment.getLink());
        assertEquals(oldNews.getId(), oldAttachment.getNews().getId());
      }
    };
View Full Code Here

      IPerson author = fFactory.createPerson(null, news3);
      author.setName("Arnold Schwarzenegger");

      /* Category */
      INews news4 = createNews(feed, "lives", "http://www.news.com/news4.html", State.NEW);
      ICategory category = fFactory.createCategory(null, news4);
      category.setName("Roberts");

      /* Attachment Content */
      INews news5 = createNews(feed, "hungry", "http://www.news.com/news5.html", State.NEW);
      IAttachment attachment = fFactory.createAttachment(null, news5);
      attachment.setLink(new URI("http://www.attachment.com/att1news2.file"));
View Full Code Here

      IPerson author = fFactory.createPerson(null, news3);
      author.setName("Arnold Schwarzenegger");

      /* Category */
      INews news4 = createNews(feed, "lives", "http://www.news.com/news4.html", State.NEW);
      ICategory category = fFactory.createCategory(null, news4);
      category.setName("Roberts");

      /* Attachment Content */
      INews news5 = createNews(feed, "hungry", "http://www.news.com/news5.html", State.NEW);
      IAttachment attachment = fFactory.createAttachment(null, news5);
      attachment.setLink(new URI("http://www.attachment.com/att1news2.file"));
View Full Code Here

      IPerson author = fFactory.createPerson(null, news3);
      author.setName("Arnold Schwarzenegger");

      /* Category */
      INews news4 = createNews(feed, "lives", "http://www.news.com/news4.html", State.NEW);
      ICategory category = fFactory.createCategory(null, news4);
      category.setName("Roberts");

      /* Attachment Content */
      INews news5 = createNews(feed, "hungry", "http://www.news.com/news5.html", State.NEW);
      IAttachment attachment = fFactory.createAttachment(null, news5);
      attachment.setLink(new URI("http://www.attachment.com/att1news2.file"));
View Full Code Here

      /* First add some Types */
      IFeed feed = fFactory.createFeed(null, new URI("http://www.feed.com/feed.xml"));

      INews news = createNews(feed, "Friend", "http://www.news.com/news3.html", State.READ);
      ICategory category = fFactory.createCategory(null, news);
      category.setName("Global");
      news.addCategory(category);

      DynamicDAO.save(feed);

      /* Wait for Indexer */
 
View Full Code Here

    /* First add some Types */
    IFeed feed = fFactory.createFeed(null, new URI("http://www.feed.com/feed.xml"));

    INews news = createNews(feed, "Friend", "http://www.news.com/news3.html", State.READ);
    ICategory category = fFactory.createCategory(null, news);
    category.setName("Global");
    news.addCategory(category);

    DynamicDAO.save(feed);

    IFolder root = fFactory.createFolder(null, null, "Root");
View Full Code Here

    IFeed feed = fFactory.createFeed(null, new URI("http://www.feed.com/feed.xml"));
    INews news = createNews(feed, "IBM-Microsoft", "http://www.news.com/news1.html", State.READ);
    createNews(feed, "Foo", "http://www.news.com/news2.html", State.READ); //Used to validate count of results == 1
    createNews(feed, "Bar", "http://www.news.com/news3.html", State.READ); //Used to validate count of results == 1

    ICategory category = fFactory.createCategory(null, news);
    category.setName("Apple-Google");

    DynamicDAO.save(feed);

    /* Wait for Indexer */
    waitForIndexer();
View Full Code Here

    IFeed feed = fFactory.createFeed(null, new URI("http://www.feed.com/feed.xml"));
    INews news = createNews(feed, "IBM'Microsoft", "http://www.news.com/news1.html", State.READ);
    createNews(feed, "Foo", "http://www.news.com/news2.html", State.READ); //Used to validate count of results == 1
    createNews(feed, "Bar", "http://www.news.com/news3.html", State.READ); //Used to validate count of results == 1

    ICategory category = fFactory.createCategory(null, news);
    category.setName("Apple'Google");

    DynamicDAO.save(feed);

    /* Wait for Indexer */
    waitForIndexer();
View Full Code Here

TOP

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

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.