Status |
Proposed |
Target Release |
4.1 |
Issue |
|
Original Authors |
Dave Johnson |
Abstract
Make tag statistics data available via a simple XML format so that other applications can access our tag data.
Requirements
Requirements satisfied by this proposal:
- Make tag statistics available in XML format
- Provide name, tag frequency and view URI for each tag
- Provide weblog specific tag data
- Provide site-wide tag data
Issues
Issues to be considered
- If possible, don't invent new format
Design
URIs to be supported
- /roller-services/tagdata - get tag data for entire site
- /roller-services/tagdata/weblogs/<handle> - get tag data for specific weblog
Request parameters supported:
- page: page number of results to be returned
- prefix: only return tags that start with this string
- format: format to be returned 'xml' for Atom categories, 'json' for JSON
New classes to be created
- TagDataServlet: New Servlet that returns tag data
- TagDataCache: New cache to be used by Servlet to cache tag content
Format to be returned
Instead of inventing a new format, return tag data in Atom protocol Categories format and add a couple of extension elements to hold tag frequency and view URI. If there are a large number of tags, server can use the <atom:link> element to specify a next and previous URI for paging. For example:
<categories fixed="no" xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:tagdata="http://roller.apache.org/ns/tagdata"> <atom:category term="java" tagdata:frequency="2" tagdata:href="http://localhost:8080/roller/myblog/tags/java" /> <atom:category term="monkey" tagdata:frequency="1" tagdata:href="http://localhost:8080/roller/myblog/tags/monkey" /> <atom:category term="monkeys" tagdata:frequency="1" tagdata:href="http://localhost:8080/roller/myblog/tags/monkeys" /> <atom:category term="music" tagdata:frequency="1" tagdata:href="http://localhost:8080/roller/myblog/tags/music" /> <atom:link rel="next" href="http://localhost:8080/roller/roller-services/tagdata/weblog/myblog/?page=1" /> </categories>
Comments
Please comment on the Roller dev mailing list.