Package org.apache.abdera.model

Examples of org.apache.abdera.model.Feed.addEntry()


  public static void main(String... args) throws Exception {
   
    Abdera abdera = new Abdera();
    Feed feed = abdera.newFeed();
    Entry entry = feed.addEntry();
   
    // Add a license to the feed
    LicenseHelper.addLicense(feed, "http://example.org/foo", "Foo");
   
    // does the feed have a license link?
View Full Code Here


   
    Entry e2 = SharingHelper.createEntry(abdera, "jms", f1);
    e2.newId();
   
    Entry e3 = (Entry) e2.clone();
    f2.addEntry(e3);
   
    // concurrent modification of the same entry by two different users in two different feeds
    SharingHelper.updateEntry(e2, "bob");
    SharingHelper.updateEntry(e3, "joe");
   
View Full Code Here

        try {
            for (Book b : books.values()) {
               
                Entry e = AtomUtils.createBookEntry(b);
               
                f.addEntry(e);
            }
        } catch (Exception ex) {
            // ignore
        }
        return f;
View Full Code Here

                .setValue(startIndex);
        }
        for (T entity : searchResults) {
            Entry entry = factory.newEntry();
            this.fillEntry(entry, entity);
            feed.addEntry(entry);
        }
        this.postProcess(feed, searchRequest, parameters, searchResults);
        return feed;
    }
}
View Full Code Here

    entry2.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5b");
    entry2.setUpdated(new Date());
    entry2.setSummary("A response");
   
    // Creates an entry and appends it to the end of the list
    Entry entry3 = feed.addEntry();
    entry3.setTitleAsXhtml("<p>Test</p>");
    entry3.addLink("/2003/12/13/atom03/2");
    entry3.setId("HTTP://www.Example.org/foo/../bar", true); // normalizes the id to the value http://www.example.org/bar
    entry3.setUpdated(new Date());
    entry3.setSummaryAsHtml("<p><a href=\"foo\">Test</a></p>").setBaseUri("http://example.org/site/");
View Full Code Here

    entry3.setUpdated(new Date());
    entry3.setSummaryAsHtml("<p><a href=\"foo\">Test</a></p>").setBaseUri("http://example.org/site/");
    entry3.setSource(feed.getAsSource());
   
    // Out-of-line content
    Entry entry4 = feed.addEntry();
    entry4.setTitle("re: Atom-Powered Robots Run Amok");
    entry4.addLink("/2003/12/13/atom03/3");
    entry4.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-cafebabecafe");
    entry4.setUpdated(new Date());
    entry4.setSummary("An entry with out-of-line content");
View Full Code Here

    entry4.setUpdated(new Date());
    entry4.setSummary("An entry with out-of-line content");
    entry4.setContent(new IRI("http://example.org/0xcafebabe"), "text/html");
   
    // Base64 binary content
    Entry entry5 = feed.addEntry();
    entry5.setTitle("re: Atom-Powered Robots Run Amok");
    entry5.addLink("/2003/12/13/atom03/4");
    entry5.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5c");
    entry5.setUpdated(new Date());
    entry5.setSummary("A simple Base64 encoded binary image");
View Full Code Here

    entry5.setSummary("A simple Base64 encoded binary image");
    URL url = Create.class.getResource("/atom-logo75px.gif");
    entry5.setContent(new DataHandler(new URLDataSource(url)), "image/gif");
   
    // XML content
    Entry entry6 = feed.addEntry();
    entry6.setTitle("re: Atom-Powered Robots Run Amok");
    entry6.addLink("/2003/12/13/atom03/5");
    entry6.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-80cb323feb5d");
    entry6.setUpdated(new Date());
    entry6.setSummary("XML content");
View Full Code Here

        for (Entry entry: entries) {
          Date entryUpdated = entry.getUpdated();
          if (( entryUpdated != null ) && ( entryUpdated.compareTo( feedUpdated ) > 0 )) {
            feedUpdated = entryUpdated;
          }
            feed.addEntry(entry);
        }
        feed.setUpdated( feedUpdated );
        // Note that feed id should be permanent, immutable, and unique
        // in order to support proper ETag creation.
        // Tough to do when the feed is regenerated with each get.
View Full Code Here

            entries = sort.sort(entries);
        }
       
        // Add the entries to the new feed
        for (Entry entry: entries) {
            feed.addEntry(entry);
        }
       
        return feed;
    }
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.