Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IGuid


    String link = news.getLinkAsText();
    if (StringUtils.isSet(link))
      return link;

    /* Fallback to Guid if available */
    IGuid guid = news.getGuid();
    if (guid != null) {
      String value = guid.getValue();
      if (URIUtils.looksLikeLink(value))
        return value;
    }

    return null;
View Full Code Here


    news1.setLink(new URI("http://www.rssowl.org/new"));

    assertFalse(news1.isEquivalent(news2));
    assertFalse(news2.isEquivalent(news1));

    IGuid guid1 = fFactory.createGuid(news1, "http://www.guid.org/", true);
    news1.setGuid(guid1);

    IGuid guid2 = fFactory.createGuid(news2, "http://www.guid.org/", true);
    news2.setGuid(guid2);

    assertTrue(news1.isEquivalent(news2));
    assertTrue(news2.isEquivalent(news1));
View Full Code Here

  private List<INews> copyWithoutDuplicatesSynced(List<INews> newsList) {
    Set<String> guids= new HashSet<String>(newsList.size());
    List<INews> newsListCopy = new ArrayList<INews>(newsList.size());
    for (INews news : newsList) {
      IGuid guid = news.getGuid();
      if (guid == null)
        continue; //Can not happen for a synchronized feed

      if (!guids.contains(guid.getValue())) {
        guids.add(guid.getValue());
        newsListCopy.add(news);
      }
    }

    return newsListCopy;
View Full Code Here

        processNamespaceAttributes(child, news);
      }

      /* Id */
      else if ("id".equals(name)) { //$NON-NLS-1$
        IGuid guid = Owl.getModelFactory().createGuid(news, child.getText(), null);

        processNamespaceAttributes(child, guid);
      }

      /* Link */
 
View Full Code Here

    /* Test Outgoing Sync */
    SyncService service = new SyncService();
    assertTrue(service.getStatus() == null);

    IGuid marker = feed.getNews().get(0).getGuid();
    SyncItem item = SyncItem.toSyncItem(feed.getNews().get(0));
    item.addLabel(label.getName());

    service.testSync(Collections.singleton(item));

    assertNotNull(service.getStatus());
    SyncStatus status = service.getStatus();
    assertEquals(1, status.getItemCount());
    assertEquals(1, status.getTotalItemCount());

    Controller.getDefault().reload(bm, null, null);

    assertNotNull(feed.getTitle());
    assertNotNull(feed.getPublishDate());
    assertFalse(feed.getNews().isEmpty());

    boolean labelFound = false;
    Outer: for (INews news : feed.getNews()) {
      if (news.getGuid().getValue().equals(marker.getValue())) {
        Set<ILabel> labels = news.getLabels();
        for (ILabel newsLabel : labels) {
          if (newsLabel.getName().equals(label.getName())) {
            assertTrue(newsLabel.equals(label));
            labelFound = true;
View Full Code Here

      label.getColor();
      label.getName();
    }

    else if (type instanceof IGuid) {
      IGuid guid = (IGuid) type;
      guid.getValue();
    }

    else if (type instanceof ICloud) {
      ICloud cloud = (ICloud) type;
      cloud.getDomain();
View Full Code Here

TOP

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

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.