How do you post via XMLRPC?

How on earth do you setup a page to post over XMLRPC using the Apache XMLRPC classes?

Miles found me this page but I swear, I can not get it to work at all. Anyway I tried to adopt the blojsom admin edit plugin to fit the purpose but still cant get that working either. So I'm stuck now…

Been doing more research into the whole problem.
apache xml-rpc metaWeblog api

Miles solves it…
Variables needed for it work, title, description, category. Stick these in html form elements with a form method=”post”, action=”thexmlrpc.jsp” and submit button and your away. Oh dont forget the Apache XMLRPC classes.

<%@ page import="org.apache.xmlrpc.*,
                java.util.*"%>
< ?xml version="1.0" encoding="UTF-8"? >
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
< html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" >
< head >
< title >Blogging using XMLRPC from a JSP based webclient< /title >
< /head >


<% // Grab the variables from the form before. String title = request.getParameter("title"); String description = request.getParameter("description"); String category = request.getParameter("category"); String blogServer = "http://something/blojsom/xmlrpc/blog"; // This is crap as we should really not use a hard-coded path //String errorUrl = "http://a/url/that/you/post/from"; // Slightly less crap... String errorUrl = request.getHeader("Referer"); Vector params=null; if ((title == null) || (title.length() < 1)) { response.sendRedirect(response.encodeRedirectURL(errorUrl )); } if ((description == null) || (description.length() < 1)) { response.sendRedirect(response.encodeRedirectURL( errorUrl )); } if ((category == null) || (category.length() < 1)) { response.sendRedirect(response.encodeRedirectURL( errorUrl )); } // Create XML RPC Client object XmlRpcClient xmlrpc=new XmlRpcClient(blogServer); Hashtable structContents=new Hashtable(); structContents.put("category", category); structContents.put("title", title); structContents.put("description", description); Boolean Booly = new Boolean(true); params=new Vector(); // Dummy for blojsom params.add("1"); params.add("username"); params.add("password"); params.add(structContents); // Publish this post params.add(Booly); String created = (String)xmlrpc.execute("metaWeblog.newPost",params); out.println("< p >This is the result: " + created + ".< /p >");
out.println("< p >This is the title: " + title + ".< /p >");
out.println("< p >This is the description: " + description + ".< /p >");
out.println("< p >This is the category: " + category + ".< /p >");
%>
< /body >
< /html >

Comments [Comments]
Trackbacks [0]

WTF : WTF’s The Future

WTF Event I attended yesterday, very good. Heres a load of links… Will write stuff around them over the course of the day.

Networked PVRs
Walked directly into the event with dave and started listening to a guy talking about the same idea as this Electronic programming guide for radios. His idea the Frequency clock seems pretty good and stood up to general questioning. I did ask about metadata which the whole system seemed to rely on alot. And yes he had thought quite hard about the issue, not sure he'd though too much about how producers would actual input the data. Some guy mentioned karmadownload which he runs. A lady from the BBC mentioned wrn.

The future of music, its digital because its remixable…
http://www.guerrillanews.com and
http://www.indymedia.org.uk

http://www.europeancreativeforum.org/

One Voice
At this point the whole event moved next door to the vertigo lounge. The choices of dicussions i cant exactly remember, but one was WTF's the future of wiki's. People talked about changing the world through wikis but its not happening. What can be done about it? And I was kind of keeping my mouth quite till Oliver Bradley outlined his idea. His idea takes the best parts of wikis and blogs. Then arranges them using lots of almost semantic technology to create a ground-up emergance aware system.
The semantic nature of well structured blogs or even better semantic blogs, could be systemanticly put closer together. So in Oliver's example he wanted to be able to see blogs which were physically and topic closer to his. I had to jump in and say at long last a idea which is possible and wouldnt require huge resources. I did show quite a few people the geourl stuff and wish I'd showed the London transport blog map too.
But these were only a step in the long path towards semantic blogs. The more metadata and semantic meaning you add to the blog, the easier it is for pools of blogs to be aggergated together for a long or short of period of time. And the author doesnt have to be involved in that at all. Oliver pointed out when he googles for a topic he usually gets about handful of related blogs, wouldnt it be nice if all those blogs got aggergated into one for the very short period of the search? Yes indeed, all google would need to do is know what rss is, and understand what a topic is made up of. Not impossible I would say, actually pretty trivial to do by google, and would give them even power than other search engines. Not to say all the web and others couldnt do the same, but the method they all use to decide whats a topic would become secret and the one which does that the best will be king of this area. I can just imagine google doing a good job because they own blogger and have already started using the AtomAPI.

But back to the event, unfortually it seemed the comments got taken as an attack on wiki's. So there was lots of talk about wikis vs blogs or collaboration vs personal publishing. And I felt the point was missed that these aggeragted blogs could be turned into a wiki. So all the subjects or topics were pulled from elsewhere and then edited and commented on using a wiki type interface. To me it makes no difference Blojsom as always had a wiki plugin built in, just not sure anyones done anything with it and/or if its survived the multiple user version of blojsom2?

More to come….

http://www.kendra.org.uk/ and http://jena.hpl.hp.com:3030/blojsom-hp/blog/ and http://webservices.xml.com/pub/a/ws/2003/04/15/semanticblog.html and http://www.google.com/search?q=semantic+blogging&sourceid=opera&num=50&ie=utf-8&oe=utf-8 and http://rdfweb.org/

Lots of crossover with my own ideas…

Comments [Comments]
Trackbacks [0]