roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Johnson (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (ROL-1811) Windows Live Writer fail to do updates - solved
Date Sun, 24 May 2009 02:24:46 GMT

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

Dave Johnson edited comment on ROL-1811 at 5/23/09 7:24 PM:
------------------------------------------------------------

Apparently, Wordpress gets it wrong too.

Check the discussion here:
   http://comox.textdrive.com/pipermail/wp-xmlrpc/2007-November/000096.html
 
If you believe that, most blog servers get it wrong and return an array of structs. That's
probably why Windows Live Writer does it that way. Oh and check this, Microsoft docs get it
wrong as well:

   http://msdn.microsoft.com/en-us/library/aa905667.aspx

I'm inclined to make this configurable and default to array of structs as you suggest, Steven.

      was (Author: snoopdave):
    Apparently, Wordpress gets it wrong too.

Check the discussion here:
   http://comox.textdrive.com/pipermail/wp-xmlrpc/2007-November/000096.html
 
If you believe that, most blog servers get it wrong and return an array of structs. That's
probably why Windows Live Writer does it that way.

I'm inclined to make this configurable and default to array of structs as you suggest, Steven.
  
> 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.


Mime
View raw message