Abdera, a Java AtomPub
   implementation
     David Calavera
         11870.com
vanity slide
•Software architect at 11870.com


• Open source “aholic”: Hudson, Netbeans


• Commiter of the Apache Abdera...
Overview
•Atom Publishing Protocol implementation


• Atom Syndication Format implementation


• version 0.5 comming soon
Creating feeds
Abdera abdera = new Abdera();
Feed feed = abdera.newFeed();
feed.setId(quot;tag:example.org,2008:/fooquot;)...
Reading feeds
Abdera abdera = new Abdera();
Parser parser = abdera.getParser();
URL url = new URL(quot;http://example.org/...
How does a server work?
•   from top to bottom
    • AbderaServlet
    • RequestContext
    • AbderaFilters
    • Provider...
Target resolvers
•   RouteManager
TargetResolver ts = new RouteManager()
    .addRoute(quot;servicequot;, quot;/quot;, Tar...
Adapters
•   CollectionAdapter
ResponseContext postEntry(RequestContext request);
ResponseContext deleteEntry(RequestConte...
Adapters
•   MediaCollectionAdapter
ResponseContext postMedia(RequestContext request);
ResponseContext deleteMedia(Request...
More stuff
•   Spring integration
•   Multipart media creation
•   OAuth
•   Open search
•   JSON Serialization
•   Custom...
Questions?
•   Resources
    • Abdera: http://incubator.apache.org/abdera
    • AtomPub: http://ietf.org/rfc/rfc5023
    •...
Upcoming SlideShare
Loading in...5
×

ApacheCon: Abdera A Java Atom Pub Implementation

2,561

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,561
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
24
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

ApacheCon: Abdera A Java Atom Pub Implementation

  1. 1. Abdera, a Java AtomPub implementation David Calavera 11870.com
  2. 2. vanity slide •Software architect at 11870.com • Open source “aholic”: Hudson, Netbeans • Commiter of the Apache Abdera project
  3. 3. Overview •Atom Publishing Protocol implementation • Atom Syndication Format implementation • version 0.5 comming soon
  4. 4. Creating feeds Abdera abdera = new Abdera(); Feed feed = abdera.newFeed(); feed.setId(quot;tag:example.org,2008:/fooquot;); feed.setTitle(quot;Test Feedquot;); feed.setSubtitle(quot;Feed subtitlequot;); feed.setUpdated(new Date()); feed.addAuthor(quot;David Calaveraquot;); feed.addLink(quot;http://example.comquot;); feed.addLink(quot;http://example.com/fooquot;,quot;selfquot;); Entry entry = feed.addEntry(); entry.setId(quot;tag:example.org,2007:/foo/entries/1quot;); entry.setTitle(quot;Entry titlequot;); entry.setSummaryAsHtml(quot;<p>This is the entry title</p>quot;); entry.setUpdated(new Date());
  5. 5. Reading feeds Abdera abdera = new Abdera(); Parser parser = abdera.getParser(); URL url = new URL(quot;http://example.org/feedquot;); Document<Feed> doc = parser.parse(url.openStream(),url); Feed feed = doc.getRoot(); System.out.println(feed.getTitle()); for (Entry entry : feed.getEntries()) { System.out.println(quot;tquot; + entry.getTitle()); }
  6. 6. How does a server work? • from top to bottom • AbderaServlet • RequestContext • AbderaFilters • Provider • TargetResolver • RequestProcessor • Adapter
  7. 7. Target resolvers • RouteManager TargetResolver ts = new RouteManager() .addRoute(quot;servicequot;, quot;/quot;, TargetType.TYPE_SERVICE) .addRoute(quot;feedquot;, quot;/:collectionquot;, TargetType.TYPE_COLLECTION) .addRoute(quot;entryquot;, quot;/:collection/:entry:quot;, TargetType.TYPE_ENTRY) .addRoute(quot;openSearchquot;, quot;/os.xmlquot;, CustomTargetType.OPEN_SEARCH); • RegexTargetResolver TargetResolver ts = new RegexTargetResolver() .setPattern(quot;/atom(?[^#]*)?quot;, TargetType.TYPE_SERVICE) .setPattern(quot;/atom/([^/#?;]+)$quot;, TargetType.TYPE_COLLECTION) .setPattern(quot;/atom/([^/#?]+)/([^/#?]+)$quot;, TargetType.TYPE_ENTRY) .setPattern(quot;/os.xmlquot;, CustomTargetType.OPEN_SEARCH);
  8. 8. Adapters • CollectionAdapter ResponseContext postEntry(RequestContext request); ResponseContext deleteEntry(RequestContext request); ResponseContext getEntry(RequestContext request); ResponseContext headEntry(RequestContext request); ResponseContext optionsEntry(RequestContext request); ResponseContext putEntry(RequestContext request); ResponseContext getFeed(RequestContext request); ResponseContext getCategories(RequestContext request);
  9. 9. Adapters • MediaCollectionAdapter ResponseContext postMedia(RequestContext request); ResponseContext deleteMedia(RequestContext request); ResponseContext getMedia(RequestContext request); ResponseContext headMedia(RequestContext request); ResponseContext optionsMedia(RequestContext request); ResponseContext putMedia(RequestContext request);
  10. 10. More stuff • Spring integration • Multipart media creation • OAuth • Open search • JSON Serialization • Custom writers • Pre-built adapters
  11. 11. Questions? • Resources • Abdera: http://incubator.apache.org/abdera • AtomPub: http://ietf.org/rfc/rfc5023 • Atom format: http://ietf.org/rfc/rfc4287 • Atom list: http://www.imc.org/atom-syntax • My blog: http://thinkincode.net
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×