Examples of IPerson


Examples of org.rssowl.core.persist.IPerson

      }

      else if ("reporter".equals(name)) { //$NON-NLS-1$
        URI uri = URIUtils.createURI(child.getText());
        if (uri != null) {
          IPerson person = Owl.getModelFactory().createPerson(null, feed);
          person.setEmail(uri);
        }
      }

      /* Bug-ID */
      else if ("bug_id".equals(name)) { //$NON-NLS-1$
View Full Code Here

Examples of org.rssowl.core.persist.IPerson

      /* Who */
      else if ("who".equals(name)) { //$NON-NLS-1$
        URI uri = URIUtils.createURI(child.getText());
        if (uri != null) {
          IPerson person = Owl.getModelFactory().createPerson(null, news);
          person.setEmail(uri);
        }
        news.setTitle("Comment from " + child.getText());
      }

      /* Date of the comment */
 
View Full Code Here

Examples of org.rssowl.core.persist.IPerson

      source.getName();
      source.getLink();
    }

    else if (type instanceof IPerson) {
      IPerson person = (IPerson) type;
      person.getEmail();
      person.getName();
      person.getUri();
    }

    else if (type instanceof IImage) {
      IImage image = (IImage) type;
      image.getDescription();
View Full Code Here

Examples of org.rssowl.core.persist.IPerson

        category.setName(attribute.getValue());
    }
  }

  private void processAuthor(Element element, IPersistable type) {
    IPerson person = Owl.getModelFactory().createPerson(null, type);

    /* Check wether the Attributes are to be processed by a Contribution */
    processNamespaceAttributes(element, person);

    /* Interpret Children */
    List< ? > personChilds = element.getChildren();
    for (Iterator< ? > iter = personChilds.iterator(); iter.hasNext();) {
      Element child = (Element) iter.next();
      String name = child.getName().toLowerCase();

      /* Check wether this Element is to be processed by a Contribution */
      if (processElementExtern(child, person))
        continue;

      /* Name */
      else if ("name".equals(name)) { //$NON-NLS-1$
        person.setName(child.getText());
        processNamespaceAttributes(child, person);
      }

      /* EMail */
      else if ("email".equals(name)) { //$NON-NLS-1$
        URI uri = URIUtils.createURI(child.getText());
        if (uri != null)
          person.setEmail(uri);
        processNamespaceAttributes(child, person);
      }

      /* URI */
      else if ("uri".equals(name)) { //$NON-NLS-1$
        URI uri = URIUtils.createURI(child.getText());
        if (uri != null)
          person.setUri(uri);
        processNamespaceAttributes(child, person);
      }
    }
  }
View Full Code Here

Examples of org.rssowl.core.persist.IPerson

        ((INews) type).setPublishDate(DateUtils.parseDate(element.getText()));
    }

    /* Creator / Publisher */
    else if ("creator".equals(name) || "publisher".equals(name)) { //$NON-NLS-1$ //$NON-NLS-2$
      IPerson person = Owl.getModelFactory().createPerson(null, type);
      person.setName(element.getText());
    }

    /* Language */
    else if ("language".equals(name) && type instanceof IFeed) //$NON-NLS-1$
      ((IFeed) type).setLanguage(element.getText());
View Full Code Here

Examples of org.rssowl.core.persist.IPerson

    /* Group Input */
    int nextId = Group.UNKNOWN_AUTHOR.ordinal() + AUTHOR_ID_BEGIN;
    for (Object object : input) {
      if (object instanceof INews) {
        INews news = (INews) object;
        IPerson author = news.getAuthor();
        EntityGroup group = gDefault;

        if (author != null) {
          String name = author.getName();
          if (!StringUtils.isSet(name))
            name = Group.UNKNOWN_AUTHOR.getName();

          group = groupCache.get(name);
          if (group == null) {
View Full Code Here

Examples of org.rssowl.core.persist.IPerson

  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

Examples of org.rssowl.core.persist.IPerson

          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

Examples of org.rssowl.core.persist.IPerson

  public byte[] getFeedIcon(URI link) {
    return loadFavicon(link, false);
  }

  private void interpretFrom(INews news, String value) {
    IPerson person = Owl.getModelFactory().createPerson(null, news);
    value = value.trim();

    /* Complex value */
    if (value.contains(" ")) {

      /* Remove quotes first */
      value = value.replace("\"", "");
      value = value.replace("'", "");

      /* foo@bar.com (Forename Name) */
      if (value.contains("(") && value.contains(")")) {
        int start = value.indexOf('(');
        int end = value.indexOf(')');

        /* E-Mail */
        if (start > 0)
          person.setEmail(URIUtils.createURI(value.substring(0, start)));

        /* Name */
        if (start < end)
          person.setName(value.substring(start + 1, end).trim());
      }

      /* Forename Name <foo@bar.com> */
      if (value.contains("<") && value.contains(">")) {
        int start = value.indexOf('<');
        int end = value.indexOf('>');

        /* Name */
        if (start > 0)
          person.setName(value.substring(0, start).trim());

        /* E-Mail */
        if (start < end)
          person.setEmail(URIUtils.createURI(value.substring(start + 1, end)));
      }
    }

    /* Simple Value (EMail) */
    else if (value.contains("@"))
      person.setEmail(URIUtils.createURI(value));

    /* Simple Value (Name) */
    else
      person.setName(value);

    news.setAuthor(person);
  }
View Full Code Here

Examples of org.rssowl.core.persist.IPerson

      news4.setState(INews.State.NEW);
    }

    /* Group by Author */
    {
      IPerson author1 = fFactory.createPerson(null, news1);
      author1.setName("Author 1");

      IPerson author2 = fFactory.createPerson(null, news2);
      author2.setName("Author 2");

      fGrouping.setType(NewsGrouping.Type.GROUP_BY_AUTHOR);
      List<EntityGroup> group = fGrouping.group(input);

      assertEquals(3, group.size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.