Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IPerson


      INews news2 = createNews(feed, "Michael Jordan", "http://www.news.com/news2.html", State.NEW);
      news2.setDescription("This is a longer name like Benjamin Pasero.");

      /* Author */
      INews news3 = createNews(feed, "Jordan Kinsey", "http://www.news.com/news3.html", State.NEW);
      IPerson author = fFactory.createPerson(null, news3);
      author.setName("Benjamin Pasero");

      /* Category */
      INews news4 = createNews(feed, "McDonalds", "http://www.news.com/news4.html", State.NEW);
      ICategory category = fFactory.createCategory(null, news4);
      category.setName("Benjamin Pasero");
View Full Code Here


      INews news2 = createNews(feed, "News2", "http://www.news.com/news2.html", State.NEW);
      news2.setDescription("This is a longer name like Michael Jackson.");

      /* Author */
      INews news3 = createNews(feed, "News3", "http://www.news.com/news3.html", State.NEW);
      IPerson author = fFactory.createPerson(null, news3);
      author.setName("Arnold Schwarzenegger");

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

      INews news2 = createNews(feed, "News2", "http://www.news.com/news2.html", State.NEW);
      news2.setDescription("This is a longer name like Michael Jackson.");

      /* Author */
      INews news3 = createNews(feed, "News3", "http://www.news.com/news3.html", State.NEW);
      IPerson author = fFactory.createPerson(null, news3);
      author.setName("Arnold Schwarzenegger");

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

      INews news2 = createNews(feed, "News2", "http://www.news.com/news2.html", State.NEW);
      news2.setDescription("This is a longer name like Michael Jackson.");

      /* Author */
      INews news3 = createNews(feed, "News3", "http://www.news.com/news3.html", State.NEW);
      IPerson author = fFactory.createPerson(null, news3);
      author.setName("Arnold Schwarzenegger");

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

          Date date = DateUtils.getRecentDate(news);
          text = fDateFormat.format(date);
          break;

        case NewsTableControl.COL_AUTHOR:
          IPerson author = news.getAuthor();
          if (author != null) {
            if (author.getName() != null)
              text = author.getName();
            else if (author.getEmail() != null)
              text = author.getEmail().toString();
          }
          break;

        case NewsTableControl.COL_CATEGORY:
          List<ICategory> categories = news.getCategories();
View Full Code Here

  public static boolean isAuthorChange(Set<? extends ModelEvent> events) {
    for (ModelEvent modelEvent : events) {
      if (modelEvent instanceof NewsEvent) {
        NewsEvent event = (NewsEvent) modelEvent;

        IPerson oldAuthor = event.getOldNews() != null ? event.getOldNews().getAuthor() : null;
        IPerson newAuthor = event.getEntity().getAuthor();

        if (newAuthor != null && !newAuthor.equals(oldAuthor))
          return true;
        else if (oldAuthor != null && !oldAuthor.equals(newAuthor))
          return true;
      }
    }
View Full Code Here

  /**
   * @throws Exception
   */
  @Test
  public void testIsAuthorChange() throws Exception {
    IPerson author1 = new Person(null);
    author1.setName("Foo");

    IPerson author2 = new Person(null);
    author2.setName("Bar");

    IFeed feed = new Feed(new URI("http://www.link.com"));
    INews news1 = new News(null, feed, new Date());
    news1.setAuthor(author1);

View Full Code Here

    if ((fSearchTarget == SearchTarget.HEADLINE || fSearchTarget == SearchTarget.ALL))
      words.add(ModelUtils.getHeadline(news));

    /* Search Author */
    if (fSearchTarget == SearchTarget.AUTHOR || fSearchTarget == SearchTarget.ALL) {
      IPerson author = news.getAuthor();
      if (author != null) {
        words.add(author.getName());
        words.add(author.getEmail());
        words.add(author.getUri());
      }
    }

    /* Search Category */
    if (fSearchTarget == SearchTarget.CATEGORY || fSearchTarget == SearchTarget.ALL) {
View Full Code Here

        }
      };
      DynamicDAO.addEntityListener(IPerson.class, personListener);
      long savedJohnId = DynamicDAO.save(initialJohn).getId().longValue();
      System.gc();
      IPerson savedJohn = DynamicDAO.load(IPerson.class, savedJohnId);
      initialJohn.setId(savedJohn.getId());
      assertTrue(initialJohn.isIdentical(savedJohn));
      URI oldJohnEmail = savedJohn.getEmail();
      IPerson dan = createPersonDan(feed);
      dan.setEmail(oldJohnEmail);
      DynamicDAO.removeEntityListener(IPerson.class, personListener);
      DynamicDAO.save(dan);
      savedJohn.setEmail(createURI("anewemailaddress@gmail.com"));
      updatedJohn[0] = (Person) savedJohn;
      DynamicDAO.addEntityListener(IPerson.class, personListener);
View Full Code Here

      }
    }
  }

  private IPerson createPersonJohn(IPersistable type) {
    IPerson person = fTypesFactory.createPerson(null, type);
    person.setName("John");
    person.setEmail(createURI("john@hotmail.com"));
    person.setUri(createURI("http://mysite.hotmail.com"));
    person.setProperty("property", "property_value");
    return person;
  }
View Full Code Here

TOP

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

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.