Forum OpenACS Development: Re: Help needed with lars-blogger

Collapse
Posted by Vinod Kurup on
I just wanted to mention that I'm working on getting support for the Blogger and MetaWeblog API into lars-blogger. Unfortunately, I didn't get it done in time for BloggerCon, but it should hopefully be done soon.

I've taken Dave's ns_xmlrpc module and made it a normal OpenACS service package, using tDOM instead of ns_xml. I think it should be a singleton package.

ns_xmlrpc sets up a registered proc that processes all requests to http://mysite/RPC2. I was going to set up an index.vuh to do the same thing in my package, but I've noticed a slight problem. We redirect users from /RPC2 to /RPC2/, but some XMLRPC clients (at least 2 that I've tested - pythons xmlrpc lib and validator.xmlrpc.com) do not follow redirects. While you could always make sure to tell your users to include the trailing slash in the URL, that seems unfriendly. Could we do a rp_internal_redirect instead of ad_returnredirect when redirecting from http://mysite/blah to http://mysite/blah/ or would that cause some other problems?

In the meantime, I guess I'll revert to using a registered proc.

Collapse
Posted by Tilmann Singer on
Vinod, try to set up a RPC2.vuh directly instead of RPC2/index.vuh. AFAIK it should serve a request to RPC2 without redirect to RPC2/. It should also be able to serve requests to RPC2/bla/foo, if that is needed.
Collapse
Posted by Vinod Kurup on
Til,

But then, if I wanted my XML-RPC server to be at http://example.com/RPC2, I'd need to put the RPC2.vuh in /web/example/www/, right? That would probably be un-kosher for my package to be adding files to the www directory, I think.

I initially hoped to use the index.vuh functionality to give the user more flexibility about what URL their XMLRPC server would listen on. Mount it at RPC2 and it would listen on http://example.com/RPC2. Mount it at rpc and it would listen on http://example.com/rpc. Cool, I thought - less work for me 😊 But, it's kinda irrelevant since it's easy enough to set up a registered proc and then set up a simple admin interface to change the URL if you want.

I also just noticed that there is a protocol called RSD (http://archipelago.phrasewise.com/rsd) which means Really Simple Discovery and allows clients to find out all this info automatically.

Collapse
Posted by Tilmann Singer on
Vinod, you're right. If you put that in a mountable package it would need to be at least at http://example.com/mountpoint/RPC2 to avoid the redirect.