You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by "Dave Johnson (JIRA)" <ji...@apache.org> on 2009/05/24 04:08:45 UTC

[jira] Commented: (ROL-1811) Windows Live Writer fail to do updates - solved

    [ https://issues.apache.org/jira/browse/ROL-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712481#action_12712481 ] 

Dave Johnson commented on ROL-1811:
-----------------------------------

Which MetaWeblog API spec are you refering to?

Roller follows what believe to be the one and only MetaWeblog API spec which says:

(from http://www.xmlrpc.com/metaWeblogApi#metawebloggetrecentposts)

"metaWeblog.getCategories (blogid, username, password) returns struct. The struct returned contains one struct for each category, containing the following elements: description, htmlUrl and rssUrl."

That's exactly what Roller does, it returns a struct of structs, which in Java is a hashtable of hashtables and not a list of hashtables as you suggest. If we change this to satisfy Windows Live Writer, we'll likely be breaking other clients.




> Windows Live Writer fail to do updates - solved 
> ------------------------------------------------
>
>                 Key: ROL-1811
>                 URL: https://issues.apache.org/jira/browse/ROL-1811
>             Project: Roller
>          Issue Type: Bug
>          Components: Web Services
>    Affects Versions: 4.0.1
>            Reporter: Steven Board
>            Assignee: Roller Unassigned
>            Priority: Minor
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> Hi Guys, 
> I know you're aware that Windows Live Writer is unable to perform updates to roller blogs using the xml rpc, however I thought I would let you know why and how I fixed it locally incase you wanted to apply this fix to the next release of roller.
> The reason the update to blogs fails is actually due to the org.apache.roller.weblogger.webservices.xmlrpc.MetaWeblogAPIHandler.getCategories method actually having two bugs.
> The first is trivial and is the fact that you pass the userId to the MetaWeblogAPIHandler.createCategoryStruct(WeblogCategory category, String userid) method, rather than the blogId.  The createCategoryStruct method then incorrectly creates the rssUrl and htmlUrls.
> The second is the fact that the getCategories method does not comply with the MetaWeblog API.  The method you have created returns a Hashtable with the categories as keys with the values being another Hashtable as defined by the MetaWeblog API for the getCategories method.  The getCategories should just return the values from the currently returned Hashtable as a List.
> e.g. The getCategories method should be something like the below.
> 	public Object getCategories(String blogid, String userid, String password)
> 			throws Exception {
> 		mLogger
> 				.debug("STEVEN BAORD custom getCategories() Called =====[ SUPPORTED ]=====");
> 		mLogger.debug((new StringBuilder()).append("     BlogId: ").append(
> 				blogid).toString());
> 		mLogger.debug((new StringBuilder()).append("     UserId: ").append(
> 				userid).toString());
> 		Weblog website = validate(blogid, userid, password);
> 		Weblogger roller = WebloggerFactory.getWeblogger();
> 		try {
> 			WeblogManager weblogMgr = roller.getWeblogManager();
> 			List cats = weblogMgr.getWeblogCategories(website, false);
> 			ArrayList<Hashtable> result = new ArrayList<Hashtable>();
> 			WeblogCategory category;
> 			Iterator wbcItr = cats.iterator();
> 			while (wbcItr.hasNext()) {
> 				category = (WeblogCategory) wbcItr.next();
> 				result.add(createCategoryStruct(category, blogid));
> 			}
> 			return result;
> 		} catch (Exception e) {
> 			String msg = "ERROR in MetaWeblogAPIHandler.getCategories";
> 			mLogger.error(msg, e);
> 			throw new XmlRpcException(1000, msg);
> 		}
> 	}
> For anyone else wanting to fix this locally you also need to set the site.absoluteurl property in the roller_properties tables within the database to the url for your roller instance.  e.g. http://<your-domain>/roller.  This is to make sure that the rssUrl and httpUrl for the categories are correctly created with their full paths. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.