Dave Johnson on open web technologies, social software and software development
Dave Johnson in Links
01:48PM Jul 26, 2004
Comments [0]
Tags:
Links
Dave Johnson in General
01:38PM Jul 26, 2004
Comments [0]
Tags:
General
Dave Johnson in General
10:37AM Jul 26, 2004
Comments [1]
Tags:
General
I've been working to learn Atom as quickly as possible and so I've been reading the developing format and API specifications, following the mailing list, watching the issues list and experimenting with Atom4J and the Blogger.com Atom API implementations. Atom is pretty simple, so I'm going to take a stab at explaining it in a couple of paragraphs. To follow this explanation, you'll need to have a basic understanding of the Web including both HTTP and XML.
Atom is a new standard for publishing on the Web. Atom defines both a data format for Web publishing and a protocol for interacting with a Web publishing system, such as a Weblog server, a Wiki, or a Content Management System.
The Atom format is an XML based format. A file that is formatted according to the Atom Format specification is known as an Atom feed. The top-level XML element is <feed>. An Atom feed is made up of a collection of Atom entries, represented as XML <entry> elements. Each entry has a title, a summary, text content, and other attributes. FYI, an Atom formatted file must be served as application/atom+xml or it won't work.
The Atom API, a Web services protocol, is defined in terms of HTTP URIs and HTTP verbs such as GET, PUT, POST, and DELETE. The Atom API specification defines three classes of URIs: Feed URI, Post URI, and Edit URI.
A Feed URI provides a way to get Atom entries. If you do a GET on a Feed URI, you will receive an Atom feed. If the server knows who you are, this Atom feed may contains a series of <link> elements, just like the ones in HTML, that point to the Feed URIs for each of the Blogs, or Wiki namespaces or Content Management document collections, that you are allowed to edit. If the server knows which Blog you are requesting, then the Atom feed will contain the latest entries from that Blog. In that case, the feed will also contain the Post URI for the Blog, Feed URI for fetching the next and previous batch of entries, and each entry will contain an Edit URI for editing that entry.
A Post URI provides a way to create new entries on a server. You create a new entry by using an HTTP POST to write the that entry to the server as an XML <entry> element.
An Edit URI provides a way to edit an entry on a server. To get a specific entry, you do a GET on the Edit URI for that entry. To update an entry, you POST the <entry> XML representation of that entry to the Edit URI for that entry. To delete an entry you do a DELETE on the entry's Edit URI. The use of the PUT and DELETE verbs is problematic for some devices with limited HTTP support and a workaround is being sought.
Currently, authentication is done via WSSE and each Atom API request must carry an HTTP header that contains a valid WSSE token. Mark Pilgrim explained this in his XML.com column and Claud Montpetit illustrated it with a nice and concise Java example. However, WSSE seems to have fallen out of favor and may not be included in a future version of the spec.
Did I get something wrong? Please correct me. Leave a comment.
Dave Johnson in Blogging
03:39AM Jul 21, 2004
Comments [1]
Tags:
Blogging
I ate a big ole slab of Dive into Python cake today (thanks Mark). The cake is probably gone by now, but you can buy the book on Amazon so get to it!
Dave Johnson in General
01:59PM Jul 20, 2004
Comments [1]
Tags:
General
Dave Johnson in Links
01:45PM Jul 19, 2004
Comments [0]
Tags:
Links
Dave Johnson in Links
01:44PM Jul 19, 2004
Comments [0]
Tags:
Links
Dave Johnson in Links
01:44PM Jul 19, 2004
Comments [0]
Tags:
Links
Dave Johnson in Links
01:42PM Jul 19, 2004
Comments [0]
Tags:
Links
Dave Johnson in Links
12:47PM Jul 19, 2004
Comments [0]
Tags:
Links
Happy news today: Lance accepted me as a committer on Atom4J (thanks Lance). I'm going to be helping him to keep Atom4J in line with the developing Atom Format and API specs. Atom4J, by the way, is not just an Atom Format parser, it is also a Atom API server framework. If you want to add Atom API support to your Java-based Web application, all you have to do is to extend the abstract org.osjava.atom4j.servlet.AtomServlet
and provide implementions for a handful of abstract methods. I'm interested in adding Atom API client capabilties to Atom4J and I've already made some progress on that front.
Now, on to the less happy part of the story. Atom4J is hosted at OSJava.org in a Subversion archive. This is my first experience with Subversion and getting set up took some time. I ran into some problems on my platform of choice, which is Mac OS X, but I eventually found some level of success. Here's what I did:
fink install svn
. Unfortunately, the version of svn that it installs does not support SSL and is therefore useless to me.UPDATE: In his O'Reilly weblog Brian Coyner shows how to build Subversion and Java bindings on Mac OS X. I wonder if his instructions result in an SSL capable client.
Dave Johnson in Java
04:46AM Jul 18, 2004
Comments [3]
Tags:
Java
Scott Hudson asks "Is there any way to modify Roller to insert the category information around each entry, so we can do additional CSS styling?" The answer is yes, with a little page template hacking you can do almost anything to your Roller Blog.
To add a div around each entry with a style class that varies with the entry category, you need to add some code to your Blog's day template. Find the foreach loop in your day template that iterates over each day's Blog entries and add a div tag around the contents of that foreach, as shown below. To give each category it's own category, you use a Velocity expression to get the category name $entry.category.name
.
#foreach( $entry in $entries ) <p> <div class="cat_$entry.category.name"> ... display one weblog entry, code removed for brevity ... </div> </p> #end
Now that you've got class, you can add some style. You can do this by adding CSS to your main Blog page or to your CSS template if you have one. For example, if you have categories General, Music, and Java and you'd like ot put a red border around your General entries, a green border around your music entries, and a blue border around your Java entries, you would add the following CSS:
.cat_General { padding: 3px; border-left: 5px red solid; border-right: 1px red solid; border-top: 1px red solid; border-bottom: 1px red solid; } .cat_Music { padding: 3px; border-left: 5px green solid; border-right: 1px green solid; border-top: 1px green solid; border-bottom: 1px red solid; } .cat_Java { padding: 3px; border-left: 5px blue solid; border-right: 1px blue solid; border-top: 1px blue solid; border-bottom: 1px blue solid; }
Below is a screenshot that shows what this looks like (and yes, I'm aware of the border mix-up on the Music post):
Dave Johnson in Roller
05:08AM Jul 17, 2004
Comments [0]
Tags:
Roller
To make it easier for folks to try Roller, I have created a standalone Roller demo by bundling Roller with JSPWiki, Tomcat, and the tiny pure-Java HSQLDB database. Everything is preconfigured and ready to run. All you need to do to try Roller is the following:
1. Download roller-demo-0.9.9.2.zip from SourceForge (an 18MB download) 2. Unzip the file into a directory on your hard-drive (directory name should have no spaces) 3. Ensure that the JAVA_HOME environment variable is set to point to your JDK 4. Ensure that CATALINA_HOME is NOT set in your environment 5. To start Roller, either: - on Windows: open the Roller bin directory and double-click on startup.bat - on UNIX: cd to the Roller bin directory, chmod +x on all files, run ./startup.sh 6. Point your browser at http://localhost:8080 7. Login as testuser1/testuser1, admin/admin, or register as a new user 8. Get rollin'
Dave Johnson in Roller
06:41PM Jul 07, 2004
Comments [15]
Tags:
Roller
Dave Johnson in Links
06:30PM Jul 06, 2004
Comments [0]
Tags:
Links
« Previous page | Main | Next page »