« New Feature: Transparent support for better image resizing via "Import Image 2 Lotus Notes" (II2LN) | Main| Enhancement: Allow to set encoding for RSS output »

Bugfix: MetaWebLogAPI now accepts content larger than one segment (>64kB)

Tags: Agent Bug Fix

To facilitate blog-editing for some friends, I searched for external blog-applications which could be configured to work with the MetaWebLog API-support in Blogsphere. Among others I found the nice looking-and simple to use Windows Live Writer from Microsoft, The configuration went flawlessly and I was amazed about the MetaWebLog API support in Blogsphere. Windows Live Writer retrieved all settings completely automatically!! The first test message was posted without any problem, and I though I was finished. When I tried to post a somewhat larger post with some images, I quickly got an error message like this;

A picture named M2

The message is in Norwegian, but the essence is that the metaWeblog.newMediaObject returned an invalid response. When I debugged the problem, I saw that the newMediaObject tries to get the item Request_Content. According to Lotus Knowledgebase technote #1240370 with the title Using REQUEST_CONTENT with Web agents and large POST data, Domino started from version 7 and onwards, to use multiple Request_Content_nnn fields to lift the one-segment-only limit.  In other words, when the post is larger than one segment, a single Request_Content-field is not present anymore, but replaced with multiple Request_Content_nnn fields instead.

I am no Java-programmer, so the code I have introduced in the agent (AGNT - XML-RPC MetaWebLog API)|xml-rpc, can probably be reworked and tuned a lot. However, below you see the code which not extracts all content from all Request_Content_nnn fields into a Java String. This string is then converted to an InputStream, all which is stacked within a try/catch block.It also works fine with a single segment Request_Content-field too . Below you see the code which extracts the content and converts the string a the InputStream within the try-block

A picture named M2

and terminated here;

A picture named M3

With this change, I can use Windows Live Writer to add blog-entries with ease.  There is still a perhaps similar issue when I try to retrieve an existing, large, blog-entry with WLW, since WLW complains about some problems then. I also have some issues with encoding between WLW and Blogsphere, but that will be another update.

Calendar

Search Site

Tag Cloud

Domino BlogSphere
Version 3.0.2

A Code Snippit

The Home URL of this db is http://dev.blogsphere.net/blogsphere/bsphere3.nsf