progress on rationalising file attachments API vs TTW ( a podcasting pre-release issue :o)

13-July-2005

trackbacks (1) email this
We've more or less solved the aggravating gotcha whereby files attached via the blogging API clients 'lived' in a central blog_mm folder, whereas files attached Through The Web 'lived' inside the blog entry object. This will greatly simplify our re-working of the rendering of all our views, and make it pretty simple to support 'podcasting' file enclosures in our feeds.

Steve has spent a lot of time and effort implementing the blogging APIs for KNotes, and done a great job of it: us authors can happily move between API clients like ecto and through-the-web (TTW) editing in a seamless way. But there are some aspects of our functionality where the API is just fundamentally so different from the web interfaces that issues spring up. One of those is the following:

  • If I attached a file through the API, it ended up in the blog_mm foldr for the weblog the entry is in.
  • If I attach a file through the web interface, it is created directly within the weblog entry as a Zope container object.

Why? Because of the way the API sends the files up to the server. From the client's point of view, it needs to send the files up before it can post the entry in which the files appear: until the server gets back to it, the client cannot know what the URLs for the attached files will be. So when an API client posts and entry which has a file attachment, it first posts the attachments. But this means that when our server-side of the APi gets the request to create the file attachments on the server, it does not yet have a weblog entry to put them into! Thus, we decided to follow blog-publishing practice and stash these in a folder called 'blog_mm' inside the weblog object.

But in our through-the-web interface, it makes much more sense to create these files directly inside the blog-entry object. Again this is a fundamental and natural consequence of the way Zope works and the way weblogs and web interfaces work.

OK. We have file attachments in two different possible locations. We also have information about them in an SQL table to enable very fast rendering. But that meands that every time we write a render we hav two cases to take care of. Ugh! For instance, requests have been coming in for some of that podcasting stuff everyone's been haring about. Easy-peasy - except for the two-faces-of-attachments :o)

So - yesterday Steve implemented a system on our test server which moves files from blog_mm into the weblog object when an entry is posted via the API. It was tricky ( don't ask :o) but it works. So we can now attack all the render efficiency issues in a clear an simple way. One such issue i to deliver file enclosures in feeds - RSS-2 and/or atom. That will be quite easy now; the only issue is that RSS-2 apparently only allows one enclosure, which mean that the natural approach ( any file attachment becomes an emclosure) will not work. We'll post sometime soon with news about which way we fell on that issue, and about how to podcast with KNotes :o)


Mike Malloch; 13-July-2005 11:21:00; forum (0) help

Comments please

If you are already registered here, please click the "Login" button to send your username/password with the comment. Click the "Anonymous" button to leave a comment without logging in.

Please tell us who you are

E-Mail Address (Required)
We need a valid email address in order for you to post a comment. You will recieve an email containing a special validation link. The comment will not be published until validated
Name
Please leave your name
Title
Lead-in
Body Text ( HTML tags are allowed )
Validation
Please enter the text from the image above
Preview your comment

1 Trackbacks (links from other content)

Click the title of a trackback to open the link in its own site context -

1 Knotations entry on planned podcast support

link to KNotations blog entry on planned syndication enhancements in KNotes
favicon for the site posting this trackback admin, , Knotations entry on planned podcast support, 2005-08-31 09:32:58.62

Linking and trackbacks

When linking to this weblog entry, please use the 'permalink', which is http://www.knownet.com/Members/mmalloch/blog/entries/2617057958

Some weblog systems will ask you for a "trackback link" (most systems will find this special 'hook' automatically, in the code for this page).

The trackback link for this entry is http://www.knownet.com/Members/mmalloch/blog/entries/2617057958/tb