Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleImportant Note

The Atom Syndication Format data model can also be used to produce Atom Feeds and Atom Entries in HTML (text/html) and JSON (application/json) formats. For more details regarding HTML see section HTML (TBD). For JSON format see section (TBD)

Atom Feed Support

TBD

 

Supported

Media Types

Data Model

Provider registration

Read

Yes

application/atom+xml

org.apache.wink.common.model.atom.AtomFeed
org.apache.wink.common.model.synd.SyndFeed

Not required. Registered by default

Write

Yes

application/atom+xml

org.apache.wink.common.model.atom.AtomFeed
org.apache.wink.common.model.synd.SyndFeed

Not required. Registered by default

Atom Entry Support

TBD

 

Supported

Media Types

Data Model

Provider registration

Read

Yes

multipart application/* atom+xml

org.apache.wink.common.model.multipartatom.InMultiPart, AtomEntry
org.apache.wink.common.model.multipartsynd.BufferedInMultiPart SyndEntry

Not required. Registered by default

Write

Yes

multipart application/* atom+xml

org.apache.wink.common.model.multipartatom.OutMultiPart, AtomEntry
org.apache.wink.common.model.multipartsynd.BufferedOutMultiPart SyndEntry

Not required. Registered by default

Examples

TBD

Producing Atom Feed

TBD

Code Block

    @GET
    @Produces(MediaType.APPLICATION_ATOM_XML)
    public AtomFeed getFeed() {
        AtomFeed feed = new AtomFeed();
        feed.setId("http://example.com/atomfeed");
        feed.setTitle(new AtomText("Example"));
        feed.setUpdated(new Date());
        AtomLink link1 = new AtomLink();
        ...
            
        return feed;
    }
}

Consuming Atom Feed

TBD

Code Block

        @POST
    @Consumes(MediaType.APPLICATION_ATOM_XML)
    public void setFeed(AtomFeed feed) {
        ...
                
        return;
    }

Producing Atom Entry

TBD

Code Block

    @GET
    @Produces(MediaType.APPLICATION_ATOM_XML)
    public AtomEntry getEntry() {
        AtomEntry entry = new AtomEntry();
        entry.setId("http://example.com/entry");
        entry.setTitle(new AtomText("Web Demo"));
        entry.getLinks().add(link2);
        entry.setUpdated(new Date());
        entry.setPublished(new Date());
        ...
        return entry;
    }

Consuming Atom Entry

TBD

Code Block

    @POST
    @Consumes(MediaType.APPLICATION_ATOM_XML)
    public void setEntry(AtomEntry entry) {
        ...
                
        return;
   }

Atom Providers

Apache Wink provides a set of entity providers that are capable of mapping Atom Feed and Atom Entry XML documents to and from an Atom data model.

...