Tip:
Highlight text to annotate it
X
>>Joe Gregorio: Hi, I am Joe Gregorio and I work for Google in developer relations.
As part of our on going series on Atom Publishing Protocol, today we are going to be covering
some of the advanced features, if you haven't had a chance yet please go to back and watch
the introduction to the atom publishing protocol which will cover all the basics. So let's
begin, in this presentation we goanna be covering four advanced features that we had not previously
covered; Paging, Drafts, Category Documents and the Slug header. Paging: Paging is for
what happens when you have too many entries for a single feed document. Previously we
talked about you would go and do a get on a collection, and you would retrieve the
feed document and within that feed document there would be entries and each entry would
correspond to a web Blog entry. If there are a lot of entries putting them all into a
single feed would actually be a bad idea there could be tens, hundreds or thousands of entries.
The paging that is built in the atom publishing protocol allows you to control how many of
those entries you are actually going to receive. The server decides how many entries go into
a feed and you retrieve that feed and you would like more entries you would follow
the next link seen here. So it's a link element with the relationship of next and you retrieve
with a get element and when you arrive, when you do that get feed you will receive yet
another feed and or retrieve the next batch of entries. Similarly that feed may contain
another link element with the next batch of entries within it and you can continue to
follow it in a chain until you get all the entries that you want. Drafts: Here we are
talking about editing an entry without making it public; if I post an entry to a collection
I can add the App control element and inside there add the draft element with the value
of yes .That tells the publishing system to keep it as a draft and not to make it public.
It will still show up at the collection feed and I can still edit it, add gets and puts
within it, I can delete it and remove it from the collection, but it will remain as part
of and will not update the actual web Blog itself and it will stay out of the public
feed. When I change this value from yes to no or remove the draft element completely
it will no longer be a draft and when I update that entry it will be made publicly available.
Category documents: You can add category elements to your entries and this is part of the atoms
indication formula. What we need to know thou in the publishing scenario is what categories
are available to the client to use when he creates an entry, those are actually listed
in the service document and in here we can see that there are two category elements
that are possible to use that is Joke and Serious in the skin which are defined by
a Uri :http//example.org/extras-cats. Categories are listed in the collection element in the
workspace that you are working with in the service document. Now there could be a lot
of categories elements that are possible to use and another situation you could run into
is were you have categories that you have to reuse them among different collections.
So an alternative way of listing this information is to actually create a stand alone category
document and just reference the URI For that .So here we have a categories element and
just as an HREF and if I do a get on that URI I would actually retrieve a category
document as you can see here and this is the exact information that we got in the service
document but I can now reuse it in multiple collection by just referencing that URI .An
optimization that you see here is that the skin has actually been lifted up and is in
the App categories element and so it does not appear in each of the atom categories
elements below this is just an optimization so that you don't have to keep repeating
the same information and it still means the same thing. The Slug header suggests to the
server what should the URI of the entry be. This is just a suggestion to the server and
the server can ignore this and it is optional to implement this, and that is actually done
by including a slug header when you post to create a new entry. And that's it those are
the four advanced features of the atom publishing protocol that were not previously covered
in the atom publishing protocol presentation and that's it. Thanks very much and have
fun.