(My Original Blog Post:
-*http://api-madness.com/post/intro-to-the-atom-publishing-protocol-atompub/)
[youtube]http://www.youtube.com/watch?v=T04fKsD56LU[/youtube]
Attention! API Garbage (might be unreadable):entry media feed
Relations they re talking about the atom publishing protocol so you has an intro to be a publishing protocol if you want to know more details you can go and read RC 5023 what you should do if your city does not cover all of the details and that was just an overview so just a syndication started with just weblogs the atom publishing protocol was originally designed just for weblogs and that s the motivating example reviews today but just realize that it can be applied to other areas so let s go look at a
feed in your syndication format a
feed contains one
entry inside of it or weblog
entry and because it s XML is machine readable format and Sony aggregation case newsreaders and ago and will that
feed and look for new entries in those new entries show up at the beginning of the
feed and give you the early the metadata about the updated
entry so if you re going to design the protocol and innocently enough with your publishing protocol you really need to do for things you want to be able to create new entries in the weblog you want to build a retrieve any new entries for old entries you want to update entries that already exist and lastly you want to delete entries out so if you look at syndication right now as far as building a protocol really weary have retrieve the right-click and go to the URI or that
feed lives doing it and get the latest things is the fundamental idea of the atom publishing protocol and that is any changes you would make to a
feed are to be reflected in the weblog so for various reasons though you probably don t want to use the same exact
feed that you would put into navigator as you would for editing you may have drafts that you re working on and you want those drafts to be available for you to edit the really don t want those going up before their allowed to be seen in the public so to differentiate going to be the aggregation
feed and will be talking about today is that collection
feed we have retrieve word basically quarter of the way done with your publishing protocol we can retrieve how about creating what would you create will be a publishing protocol is a set list and you possibly think of retaken elementary and post it to the URI of the collection
feed that s just an
entry it s does no surrounding
feed element around so close that and that gets added to the
feed but we said before this change to the
feed will also get reflected in the weblog or so were innocents halfway done with your publishing protocol so we create and retrieve and the other two parts are update and delete something back and look at that
entry that was added to the collection
feed you create a new
entry in the server will add some other elements to that
entry in this case what you re seeing here is the edit URI and every
entry that is created will have it and that s the URI by which are going to update delete and retrieve that
entry so the result was case first which is delete this is actually just your going to send a simple HT P. delete message to the URI of that country and that s it there s nobody that goes along that request just delete once that the league is received by the server that
entry gets removed from the
feed might be said before that is reflected in the weblog that weblog
entry goes away but the subject create retrieve and delete what you need is update so at that edit URI you could actually do a get and get the full
entry and you will need to do that because according to publishing protocol specification the
entry that sits in the collection may not be the full
entry in my be abbreviated in order to keep bandwidth down so I can go to that edit URI duo jet and get the full workers inflation now if I wanted to update what was going on I can actually modify that
entry on my client and then put it back to that exact same URI and so in this case I ve updated the title I do it put another
entry we updated and the reflected in the
feed and on what luck sarong recovered all four parts of what you would want out of a publishing protocol creating retrieve in updating and deleting entries well poised on a source text is concerned about
media what if I wanted to add an image or sound or video preview that I am publishing protocol releases again the simplest possible thing you could imagine we take your
media needs in the image DB post request again to the same exact collection URI that adds it to their
media is slightly different in that when I post
media I actually create two distinct resources on creating a resource with a URI that is the actual
media itself like the image and then there s going to be what s called a
media link
entry that s the metadata about the picture with the title the time it was posted etc. we can see those two resources when we look at the
media link
entry that gets added to the collection the edit link points license of the
media link
entry and you manipulate that just like we did previously with entries I can do again on that to get the
entry and report on it to update it and I can send a delete to remove it and is the edit
media link that supports get and put so going to update the image I would change the image and put the image in the HDTV put to the edit
media URI if I wanted to update the title of that image I would update change the
media link
entry" that
entry HDTV put to the edit URI and I said before if you want to remove that
media youths in the delete again nobody to send a delete to the edit URI that was actually a slight distinction that s the way you end up removing the
media the metadata about the image and the image itself and we descend one delete the removal or so examples we ve done so far I ve assume that there is just one collection and were adding entries and our
media to that same collection that might not actually be the case that might actually be a little difficult to organize so we may actually break it down in the multiple collections the
media collection for entries and an im
mediate collection for all of your images that are the
media link blog you can break things down that way you discover which collections are available that s where service document comes in to play that contains information about all of the collections that service supports a severe look at a service document you ll see that there are collections grouped together into workspaces on a know here looking at a collection that just takes entries and what they are in the HREF that is the URI for our collection now we know to be without we can post to that to add new things to that collection is actually two collections in the service document and assess the second one is im
mediate collection and those except elements tell you the types of
media that you re allowed to post to that collection in this case it can accept JPEG s PNG s and yes okay to that finishes her overview of the atom publishing protocol if you will learn more you can always read RFC 4287 which is the Internet standard for the atom syndication format grocery RC 5023 which is the IETF standard for the atom publishing protocol in addition of video to follow this one is Jeff Fisher s intro to Google data which is available also on YouTube that covers how Google has implemented some of these standards and finally can always go to code.google.com/APIs/G. data which covers all of the documentation for Google s APIs thanks for
No comments:
Post a Comment