Package org.apache.abdera.model

Examples of org.apache.abdera.model.Source


     assertNotNull(doc);
    
     Feed feed = doc.getRoot();
     List<Entry> entries = feed.getEntries();
     for (Entry entry : entries) {
       Source source = entry.getSource();
       assertNotNull(source);
       assertEquals(source.getCategories().size(),2);
     }
   }  
View Full Code Here


     assertNotNull(doc);
    
     Feed feed = doc.getRoot();
     List<Entry> entries = feed.getEntries();
     for (Entry entry : entries) {
       Source source = entry.getSource();
       assertNotNull(source);
       assertEquals(source.getContributors().size(),2);
     }
   }
View Full Code Here

     //http://feedvalidator.org/testcases/atom/4.2.11/source-entry.xml
     IRI uri = baseURI.resolve("4.2.11/source-entry.xml");
     Document<Feed> doc = get(uri);
     assertNotNull(doc);
     Entry entry = doc.getRoot().getEntries().get(0);
     Source source = entry.getSource();
     assertNotNull(source);
   }
View Full Code Here

    dateTime.setString(AtomDate.format(now));
    assertEquals(dateTime.getString(), AtomDate.format(now));
    assertEquals(dateTime.getDate(), now);
    Service service = factory.newService();
    assertNotNull(service);
    Source source = factory.newSource();
    assertNotNull(source);
    el = factory.newElement(Constants.NAME);
    assertNotNull(el);
    assertEquals(el.getQName(), Constants.NAME);
    el = factory.newElement(Constants.NAME);
View Full Code Here

    Link link = getSelfLink();
    return (link != null) ? link.getResolvedHref() : null;
  }

  public Source getSource() {
    Source source = getExtension(RssConstants.QNAME_SOURCE);
    if (source == null) getExtension(RssConstants.QNAME_DC_SOURCE);
    return source;
  }
View Full Code Here

    } else if (element instanceof Source) {
      jstream.startObject();
      writeLanguageFields(element, jstream);
      if (!isSameAsParentBase(element))
        jstream.writeField("xml:base", element.getResolvedBaseUri());
      Source source = (Source)element;
      jstream.writeField("id", source.getId());
      writeElement("title", source.getTitleElement(),jstream);
      writeElement("subtitle", source.getSubtitleElement(),jstream);
      writeElement("rights", source.getRightsElement(),jstream);
      jstream.writeField("updated", source.getUpdated());
      writeElement("generator", source.getGenerator(),jstream);
      if (source.getIconElement() != null)
        jstream.writeField("icon", source.getIconElement().getResolvedValue());
      if (source.getLogoElement() != null)
        jstream.writeField("logo", source.getLogoElement().getResolvedValue());
      writeList("authors",source.getAuthors(),jstream);
      writeList("contributors",source.getContributors(),jstream);
      writeList("links",source.getLinks(),jstream);
      writeList("categories",source.getCategories(),jstream);
      if (FeedPagingHelper.isComplete(source))
        jstream.writeField("complete",true);     
      if (FeedPagingHelper.isArchive(source))
        jstream.writeField("archive",true);
      if (source instanceof Feed) {
View Full Code Here

      if (altlink != null) {
        irt.setHref(altlink.getResolvedHref());
        if (altlink.getMimeType() != null)
          irt.setMimeType(altlink.getMimeType());
      }
      Source src = ref.getSource();
      if (src != null) {
        Link selflink = src.getSelfLink();
        if (selflink != null)
          irt.setSource(selflink.getResolvedHref());
      }
    } catch (Exception e) {}
    return irt;
View Full Code Here

            try {
              if (o instanceof OMNode) {
                OMNode node = (OMNode) o;
                List<Link> links = null;
                if (node instanceof Source) {
                  Source source = (Source) node;
                  links = source.getLinks("alternate");
                } else if (node instanceof Entry) {
                  Entry entry = (Entry) node;
                  links = entry.getLinks("alternate");
                }
                if (links != null) results.addAll(links);
View Full Code Here

      List<Link> links = null;
      if (base instanceof Source) {
        links = ((Source)base).getLinks(Link.REL_LICENSE);
      } else if (base instanceof Entry) {
        Entry entry = (Entry)base;
        Source source = entry.getSource();
        Base parent = entry.getParentElement();
        links = entry.getLinks(Link.REL_LICENSE);
        if (inherited && (links == null || links.size() == 0) && source != null) {
          links = getLicense(source, false);
        }
View Full Code Here

    //http://feedvalidator.org/testcases/atom/4.1.2/multiple-sources.xml
    IRI uri = baseURI.resolve("4.1.2/multiple-sources.xml");
    Document<Feed> doc = get(uri);
    assertNotNull(doc);
    Entry entry = doc.getRoot().getEntries().get(0);
    Source source = entry.getSource();
    assertEquals(source.getId(), new IRI("urn:uuid:9b056ae0-f778-11d9-8cd6-0800200c9a66"));
  }  
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.Source

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.