Package org.apache.abdera.factory

Examples of org.apache.abdera.factory.Factory


       
        return feed;
    }

    public Feed query(String queryString) {
        Factory factory = Abdera.getNewFactory();
        Feed feed = factory.newFeed();
        feed.setTitle(feedTitle);
        feed.setSubtitle(feedDescription);
        Person author = factory.newAuthor();
        author.setName(feedAuthor);
        feed.addAuthor(author);
        feed.addLink("http://incubator.apache.org/tuscany", "alternate");
       
        Feed allFeed = getFeed();
View Full Code Here


     * @return the structure containing alerts
     */   
    public org.apache.abdera.model.Feed getFeed() {
       
        // Create a new Feed
        Factory factory = Abdera.getNewFactory();
        Feed feed = factory.newFeed();
        feed.setTitle("Apache Tuscany Feed Aggregator");
        feed.setSubtitle("A sample showing an SCA application to aggregate various types of feeds");
        feed.addAuthor("Apache Tuscany");
        feed.addLink("http://incubator.apache.org/tuscany");
        // Aggregate entries from feed1 and feed2
        try {       
            AlertsType alerts = this.alerts.getAllNewAlerts("");
           
            for( Object alertObject : alerts.getAlert() ){        
                AlertType alert = ((AlertType)alertObject);
                Entry entry = factory.newEntry();
                entry.setTitle(alert.getTitle());
                //entry.(alert.getSummary());                   
                entry.addLink(alert.getAddress());
                entry.setPublished(dateFormatter.parse(alert.getDate()));
                       
View Full Code Here

 
    @Test
  public void testPost() throws Exception {
    System.out.println(">>>ContentNegotiationTest.testPost");
    // Testing of entry creation
    Factory factory = abdera.getFactory();
    String customerName = "Fred Farkle";
    Entry entry = factory.newEntry();
    entry.setTitle("customer " + customerName);
    entry.setUpdated(new Date());
    entry.addAuthor("Apache Tuscany");
    // ID created by collection.
    Content content = abdera.getFactory().newContent();
View Full Code Here

    // MediaCollection role
    public Entry postMedia(String title, String slug, String contentType, InputStream media) {
        System.out.println(">>> MediaCollectionImpl.postMedia title=" + title + ", slug=" + slug + ", contentType=" + contentType );

        Factory factory = abdera.getFactory();
        Entry entry = factory.newEntry();
        // Must provide entry to media as per Atom Pub spec (http://tools.ietf.org/html/rfc5023#section-9.6)
        // <?xml version="1.0"?>
        // <entry xmlns="http://www.w3.org/2005/Atom">
        //   <title>The Beach</title> (REQUIRED)
        //   <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> (REQUIRED)
View Full Code Here

    //          <author><name>Captain Lansing</name></author>
    //          <content>It's something moving... solid metal</content>
    //        </entry>   
   
    // Testing of entry creation
    Factory factory = abdera.getFactory();
    String customerName = "Fred Farkle";
    Entry entry = factory.newEntry();
    entry.setTitle("customer " + customerName);
    entry.setUpdated(new Date());
    entry.addAuthor("Apache Tuscany");
    // ID created by collection.
        // entry.setId(id); // auto-provided
View Full Code Here

    //         <updated>2007-02-24T16:34:06Z</updated>
    //         <author><name>Captain Lansing</name></author>
    //         <content>Update: it's a hoax!</content>
    //       </entry>
    // Testing of entry creation
    Factory factory = abdera.getFactory();
    String customerName = "Molly Ringwald";
    Entry entry = factory.newEntry();
    entry.setTitle("customer " + customerName);
    entry.setUpdated( new Date());
    entry.addAuthor("Apache Tuscany");
    String id = eTag.substring( 1, eTag.length()-1);
        entry.setId(id); // auto-provided
View Full Code Here

  @Test
    public void testModifiedGetIfNoneMatch() throws Exception {   
    System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedModifiedGetIfNoneMatch");
    // Post some new content to the feed.
    Factory factory = abdera.getFactory();
    String customerName = "Fred Farkle";
    Entry entry = factory.newEntry();
    entry.setTitle("customer " + customerName);
    entry.setUpdated(new Date());
    entry.addAuthor("Apache Tuscany");
    Content content = abdera.getFactory().newContent();
    content.setContentType(Content.Type.TEXT);
View Full Code Here

        //          <author><name>Captain Lansing</name></author>
        //          <content>It's something moving... solid metal</content>
        //        </entry>

        // Testing of entry creation
        Factory factory = abdera.getFactory();
        String customerName = "Fred Farkle";
        Entry entry = factory.newEntry();
        entry.setTitle("customer " + customerName);
        entry.setUpdated(new Date());
        entry.addAuthor("Apache Tuscany");
        // ID created by collection.
        // entry.setId(id); // auto-provided
View Full Code Here

        //         <updated>2007-02-24T16:34:06Z</updated>
        //         <author><name>Captain Lansing</name></author>
        //         <content>Update: it's a hoax!</content>
        //       </entry>
        // Testing of entry creation
        Factory factory = abdera.getFactory();
        String customerName = "Molly Ringwald";
        Entry entry = factory.newEntry();
        entry.setTitle("customer " + customerName);
        entry.setUpdated( new Date());
        entry.addAuthor("Apache Tuscany");
        String id = eTag.substring( 1, eTag.length()-1);
        entry.setId(id); // auto-provided
View Full Code Here

    @Test
    public void testModifiedGetIfNoneMatch() throws Exception {
        //System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedModifiedGetIfNoneMatch");
        // Post some new content to the feed.
        Factory factory = abdera.getFactory();
        String customerName = "Fred Farkle";
        Entry entry = factory.newEntry();
        entry.setTitle("customer " + customerName);
        entry.setUpdated(new Date());
        entry.addAuthor("Apache Tuscany");
        Content content = abdera.getFactory().newContent();
        content.setContentType(Content.Type.TEXT);
View Full Code Here

TOP

Related Classes of org.apache.abdera.factory.Factory

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.