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


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.

Reply via email to