Package org.apache.abdera.model

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


                entry.setTitle(alert.getTitle());
                //entry.(alert.getSummary());                   
                entry.addLink(alert.getAddress());
                entry.setPublished(dateFormatter.parse(alert.getDate()));
                       
                feed.addEntry(entry);
            }
        } catch(Exception ex) {
            System.err.println("Exception " + ex.toString());
        }
       
View Full Code Here


        String license = "http://example.org";

        Abdera abdera = new Abdera();
        Feed feed = abdera.newFeed();

        Entry entry = feed.addEntry();

        LicenseHelper.addLicense(feed, license);

        assertTrue(LicenseHelper.hasLicense(feed, license));
        assertFalse(LicenseHelper.hasLicense(entry, license, false));
View Full Code Here

    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

        Abdera abdera = Abdera.getInstance();
        Feed feed = abdera.newFeed();
        feed.setBaseUri("http://example.org/");
        // add additional feed metadata
        Entry entry = feed.addEntry();
        // add additional feed metadata
        entry.addLink("alternate.xml"); // relative URI

        XPath xpath = abdera.getXPath();
        System.out.println(xpath.valueOf("abdera:resolve(/a:feed/a:entry/a:link/@href)", feed));
View Full Code Here

            ((IntegerElement)feed.addExtension(OpenSearchConstants.START_INDEX)).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

        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

    @Test
    public void testUnpublish() throws Exception {

        Abdera abdera = new Abdera();
        Feed feed = abdera.newFeed();
        Entry entry = feed.addEntry();
        assertEquals(1, feed.getEntries().size());
        entry = SharingHelper.unpublish(entry);
        assertEquals(0, feed.getEntries().size());
        Unpublished unpub = SharingHelper.getUnpublished(feed);
        assertEquals(1, unpub.getEntries().size());
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());
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

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.