Blogging with Windows Live Writer and Word - creating categories?

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
11/8/2011 1:10:46 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

Blogging with Windows Live Writer and Word - creating categories?

With a mojoPortal blog we can create and edit posts using Windows Live Writer and MS Word - works a treat (though I expect the HTML from Word is ghastly).

However, although you can assign categories (which both products do pull down from the blog) it seems you cannot create new categories. I tried creating one in Word, and it gave error on publishing. Without the new category it posted the same article fine.

Am I correct here?  If so, can this be changed in mojoPortal to permit creating categories?  Or is this a fundamental limitation of the metaweblog API.

11/9/2011 9:51:33 AM
Gravatar
Total Posts 18439

Re: Blogging with Windows Live Writer and Word - creating categories?

Hi Crispin,

It seems that it is and isn't a limitation of MetaWeblog API. Is is in the sense that there is not method defined for specifically adding categories, but with some googling I found this post which provides an idea of how to implement support for adding categories.

I've added an item in our project tracker to look into implementing a solution for this.

Best,

Joe

11/9/2011 9:59:45 AM
Gravatar
Total Posts 18439

Re: Blogging with Windows Live Writer and Word - creating categories?

I wonder if you can find an error in your mojoportal log corresponding to the error on publishing in Live Writer?

The error details may help me solve this. I can probably try it myself but if you already have an error in your log it would saveme some time.

Thanks,

Joe

11/10/2011 4:28:56 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: Blogging with Windows Live Writer and Word - creating categories?

WLW doesn't give any mechanism for adding a new category when config'd with a MetaWeblogAPI blog.  When used with a WordPress blog it gives the ability to add categories and also tags (lighter weight). I've not tested it with other APIs.

MS Word does give a mechanism to add a category (with a mojoPortal blog), but it errors on posting. There is no error in the mojoPortal system log, but Fiddlers shows this:

POST:

<methodCall><methodName>metaWeblog.editPost</methodName>

<params><param><value><string>8</string></value></param>

<param><value><string>myusername@isp.com</string></value></param>

<param><value><string>mypassword-unencrypted</string></value></param>

<param><value><struct><member><name>title</name>

<value><string>My Post Title</string></value></member><member><name>description</name>

<value><string>myblogpoststring-escapedhtml</string></value></member>

<member><name>categories</name>

<value><array><data><value><string>ANEXISTINGCATEGORY</string></value>

<value><string>MYNEWCATEGORY</string></value></data></array></value></member></struct></value></param>

<param><value><boolean>1</boolean></value></param></params></methodCall>

Response:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 10 Nov 2011 22:19:32 GMT
Content-Length: 440

<?xml version="1.0"?>
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
          <name>faultCode</name>
          <value>
            <i4>0</i4>
          </value>
        </member>
        <member>
          <name>faultString</name>
          <value>
            <string>Could not update post.</string>
          </value>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>

Hope this helps.

 

11/11/2011 8:32:44 AM
Gravatar
Total Posts 18439

Re: Blogging with Windows Live Writer and Word - creating categories?

Hi Crispin,

I've got new categories working on my local machine so it should work in the next release. 

One thing though is I haven't yet figured out the best way to tell live writer that new categories are supported. I've been trying this morning with a manifest file but so far it doesn't seem to work. The one solution that works so far is as described in the article I linked before, choosing Community Server instead of MetaWebLogApi, seems to work and makes the live writer UI show a new category option and the new category is indeed created. I may figure out a better way before the next release, but if not at least this way will work.

Best,

Joe

11/12/2011 2:28:47 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: Blogging with Windows Live Writer and Word - creating categories?

Great - looking forward to trying this in the next release (and no problem pretending blog is a Community Server so long as this is in the how-to). 

I don't know if you spotted my other thread, but I'm chewing on how to create a good company knowledge base with mojo, where some content is private and some public, and where we also have fast authoring tools. I'm considering blog vs pages or a combination of the two...

Blog = fast authoring with Word / WLW,  however content must be entirely public or private.

Pages =  structure + full control over access, but (relatively) clunky authoring in TinyMCE or CKEditor.

Ideally I'll go for a blog for the public point-in-time content,  plus pages for structured content (product documentation, how-to's etc) some of which will be public others not. But the lack of quick authoring is a big problem - staff are very busy and if it takes twice as long as doing it in Word docs they will not buy in.

In a WordPress site I can create and publish actual pages in WLW... you just create a "new page" (instead of "new post") then choose which existing page it should sit beneath (if any) + order, and away you go.

Is there any way this could work with mojoPortal, to create a page with an HTML content feature on it, using some default settings for page/content security? This would give us the quick authoring we need.  

This must come down to the manifest for the API, because with the metaweblog api the "new page" option is greyed out in WLW.

best wishes

PS I've just checked that link you posted about WLW capabilities, and I see that only the WordPress API supports new pages by default, but that you should in theory be able to include these methods as options into the WLW manifest for the others (just as you have been trying to do for new categories - is caching getting in the way here?).

11/13/2011 7:35:01 AM
Gravatar
Total Posts 18439

Re: Blogging with Windows Live Writer and Word - creating categories?

Hi Crispin,

I found that the manifest file does work if I add a link to it in the head section. It doesn't seem to automatically find it in the root, but it might be because I'm using extensionless urls in my testing so the blog url is /blog

Possibly Live Writer is interpreting that as a folder named /blog and looking for it in that folder which does not exist, but using the meta element I can point it to the manifest in the root and it does respect the indicators for new category support.

I am going to look into the idea of supporting editing "pages" but their model of pages is different than ours so I don't think a perfect solution is possible but perhaps an imperfect one that is still very useful. The problem is that the concept of page in mojoPortal is just as a container for features and multiple instances of html or other features may be on the page whereas in the wordpress model pages are one to one with their content so editing a page is editing the content.

What we might be able to do is implement something to simulate that one to one correspondence between content and pages. For example we could define that the first html content element in the center pane that the user has edit permission on is the page content and we could possibly encapsulate it in a way to make that content instance editable from WLW. Support for adding new pages would entail creating a page with a single html instance in the center and creating the friendly url. I'm not entirely sure this idea is feasible, but I like the idea of being able to edit pages in WLW and plan to give it a try as soon as I can.

I've been working on our live writer support for the past couple of days and have replaced our previous implementation with a cleaner one with easier to understand code based on the implementation from BlogEngine.NET. I will probably push these changes to the default branch of our source code repository later today.

Best,

Joe

11/13/2011 9:57:29 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: Blogging with Windows Live Writer and Word - creating categories?

Hi Joe

That's exactly what I was thinking - new "page" from WLW = page + html content in center panel, and like you say for existing pages.  I completely agree that something is better than nothing here, if you can find a way to achieve it, even though clearly there will be limitations.  It's all about fast user-friendly authoring.  I suppose the alternative is a) finding an HTML content editor inside mojoPortal that approaches the user-friendliness of WLW and handles images efficiently, and b) making it a little easier to create a new page (the page template idea being perhaps the best angle of attack here).

Incidentally, if you are working in this area, we have noticed that when we post with WLW the images go into a specific folder under the site; however when we post from Word, the images get dropped in the site root, which is less desirable. Are you able to catch these and park them in a suitable sub-folder?

And related, should all these be under the "media" folder?  I've only just realized the role of the media folder from Jamie E's post, and I'm now having to reorganize files in several sites.  Is there some documentation that I've missed about the purpose of the default folders under each site? 

 

 

11/14/2011 11:06:47 AM
Gravatar
Total Posts 18439

Re: Blogging with Windows Live Writer and Word - creating categories?

Hi Crispin,

I've just updated the demo site with the latest code. You can try Live Writer with the blog there. I haven't got to working on html/page edit support yet, but the things that are working in Live Writer include:

  • adding new categories
  • enabling or disabling comments on a post
  • images are now uploaded to /media/wlw/ or in a user specific folder depending on user permissions just like if using the web page to upload.
  • I've noticed that some skins (especially Artisteer skins) don't look right in WLW because the background images/colors are shown in the post. A similar problem existed previously in the web editors but we got around it by adding a body class="wysiwygeditor" to the editor window body so we could override it. So I added logic to detect the WLW user agent and add that class to the body so we can override it in WLW the same as the web page editors.
  • If SSL is available and the user tries to use the metaweblogapi.ashx url without https it will throw an error. I also updated the documentation to emphasize that if SSL is available users should use https with the metaweblogapi.ashx because otherwise the credentials are passed in clear text with each request. I noticed that Word 2007 gives a warning if not using SSL but WLW does not. So when you try the demo site you'll need to use https.
  • It is now possible to disable the metaweblogapi by adding this to user.config <add key="DisableMetaWeblogApi" value="true"/> Previously this could be done by removing the handler mapping in Web.config, but with the new implementation this handler mapping is not needed and actually needs to be removed because it points to the old implementation class which no longer exists.

I'm still very interested in trying to get page editing working but not sure just how soon I can get to it.

Best,

Joe

11/17/2011 12:28:35 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: Blogging with Windows Live Writer and Word - creating categories?

Thanks Joe, great improvements and I look forward to implementing them.

2 q's:

I mentioned in previous post that images posted from Word go into site root folder - can you fix that? as for WLW?

I noticed today that publishing from WLW with the "post draft to blog" tool instead of the "Publish" tool makes no difference - the post is fully published in the mojoPortal blog. Any way of making this create a draft post in mojoPortal?

 

 

 

11/17/2011 2:36:07 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

Re: Blogging with Windows Live Writer and Word - creating categories?

PS a colleague has just pointed me at this great WLW plugin for inserting formatted code snippets ...

http://plugins.live.com/writer/detail/insert-code-for-windows-live-writer

and this which pastes direct from VS

http://plugins.live.com/writer/detail/paste-from-visual-studio

 

You must sign in to post in the forums. This thread is closed to new posts.