Extending Opds

19

Click here to load reader

description

Slides from my "Extending OPDS" talk at the Making Books Apparent event in San Francisco.

Transcript of Extending Opds

Page 1: Extending Opds

Extending OPDS

Hadrien GardeurFeedbooks

Page 2: Extending Opds

OPDS is an extension

Page 3: Extending Opds

Basic OPDS catalog

Atom feedsSame requirements than an Atom entry atom:title atom:author atom:id atom:updated

If it’s a publication, the requirement is at least one acquisition link.

Page 4: Extending Opds

element atom:entry { atomCommonAttributes, (atomAuthor* & atomCategory* & atomContent? & atomContributor* & atomId & atomLink* & atomPublished? & atomRights? & atomSource? & atomSummary? & atomTitle& atomUpdated & extensionElement*)

}

Scary but Cool stuff

Cool !

Page 5: Extending Opds

Metadata

AtomDublinCore Terms (dcterms:issued)

Prism (prism:issue)

New attributes in the OPDS namespace(opds:price, opds:gateway)

Page 6: Extending Opds

Link Relations

For feed-level or entry-level linksGive a meaning to what you’re linking toDifferent type, different meaning

In OPDS we use:1. Link relations from the IANA link registry Link header draft2. Our own link relations (http://opds-spec.org/relation)

Page 7: Extending Opds

Why ?

Page 8: Extending Opds

More Metadata

Support new type of publications Provide more and better information… without affecting the user experience on mobile devices

More meaningful links

Page 9: Extending Opds

New Features

Comments (implemented on Feedbooks)

ReviewsAnnotations Publishing (implemented on Feedbooks)

OPDS shopping cart

Page 10: Extending Opds

How ?

Page 11: Extending Opds

Partial & Full Entries

Like in AtomPub, you shouldn’t assume that an entry in a collection feed is a full entry

A partial entry can link to a full entry<atom:link rel="alternate" type= "application/atom+xml;type=entry" href=" …" />

Required & Recommended metadata MUST be in partialYou can add anything you want in full entries

Page 12: Extending Opds

New Link Relations

Use link relations from the Link Header draftNew features in OPDS: http://opds-spec.org/relationCreate your own: http://mydomain.com/relation

Associate a link with a new type… or media parameters in a type

Page 13: Extending Opds

Use AtomPub !

Don’t limit yourself to GET requests !CRUD with POST, GET, UPDATE and DELETE

AtomPub = Service Documents, Workspaces and Collections

New link relations: edit, edit-media

Page 14: Extending Opds

Example: Comments

Page 15: Extending Opds

On Feedbooks

Based on the Atom Threading Extension Link Relations: replies, in-reply-toAttributes: thr:count, thr:updated

AtomPub to POST comment (no UPDATE or DELETE)

Page 16: Extending Opds

In our entries

Nothing in the partial entry, MUST GET full entry

<atom:link rel="replies" thr:count="2" thr:updated="…" />

thr:count gives the total number of comments thr:updated is the timestamp for the last update (last comment)

Page 17: Extending Opds

Collection feed for Comments

A comment is a normal Atom entry atom:author for the user atom:content for the comment

app:collection to POST content (no service document) href attribute for the URI app:accept to list the types (application/atom+xml;type=entry)

Page 18: Extending Opds

Best Practices

Don’t create stuff on your own search for RFCs read and participate on mailing lists: atom-syntax, atom & opdsUse the IANA link registry and Link Header draft

Use link relationsMetadata not included in the specs MUST be in the full entry

Page 19: Extending Opds

That’s all folks !