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

 

11/18/2011 7:52:59 AM
Gravatar
Total Posts 18439

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

Hi Crispin,

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

I'm not sure how it was possible in the old implementation for it to work differently in word than in WLW since both are using the same api. I'm pretty sure it is consistent in the new implementation. Have you tried it on our demo site with Word?

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?

Thanks! I'll investigate that, I had not tried post draft to blog yet.

Best,

Joe

11/18/2011 9:14:01 AM
Gravatar
Total Posts 537
feet planted firmly on the ground

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

I've posted two posts to the demo site http://demo.mojoportal.com/blog

One from Word and one from WLW. Both created categories successfully, and both put images into the media\wlw folder.

Looking good.

Posting a true draft will be very useful for our workflow if it's possible, and ultimately authoring simple pages.....

Thanks

 

11/26/2011 10:22:58 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 build which now supports editing pages (with the caveats previously discussed) along with blog posts. It now supports posting both pages or blog posts as draft in addition to direct publishing.

I could use some additional testing so if you have time please do test it on the demo site. Note that every time the demo site gets reset you will need to re-configure your settings for it in Live Writer because the ids on things change, it is a new site and a new blog when it gets reset even though it has the same content. 

Thanks,

Joe

11/26/2011 3:25:18 PM
Gravatar
Total Posts 537
feet planted firmly on the ground

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

I've had a 10 minute play and this is working exactly as I had hoped - a fantastic new feature and worth shouting about.  This really makes mojoPortal work for our company knowledge base where quick authoring of pages in a hierarchy is a priority. I have published root and child pages, all appearing as expected in the demo site.

I've also tested posting blog posts as draft, and adding categories - working fine.

Regarding security, clearly this ability to post pages should be controlled...  the ability to create pages at root level or below any other page should (IMO) be governed by whether the connecting account is in the "roles that can create root level pages", or the roles permitted to create child pages under each other page. Ideally the pages returned to WLW as the possible parent pages should be only the ones you have permissions to use.  I've not tested whether this is already implemented.  If this is too complex, an interim solution would be to limit this to the administrator and content publisher roles.

Thanks for this excellent addition. I look forward to it in the next release.

PS I noticed in passing that the Site Analytics Pro demo pages are throwing some non-fatal errors on the demo site.

 

11/27/2011 7:20:07 AM
Gravatar
Total Posts 18439

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

Hi Crispin,

Regarding security, clearly this ability to post pages should be controlled...  the ability to create pages at root level or below any other page should (IMO) be governed by whether the connecting account is in the "roles that can create root level pages", or the roles permitted to create child pages under each other page. Ideally the pages returned to WLW as the possible parent pages should be only the ones you have permissions to use.  I've not tested whether this is already implemented.  If this is too complex, an interim solution would be to limit this to the administrator and content publisher roles.

Of course security rules must be enforced and are enforced when using the metaweblog api. I would never release this functionality without doing that.

For pages there are basically 2 methods for getting a list of pages wp.getPages gets the list of pages available for editing and this method only returns pages that the user can edit and that have an html instance in the center pane. From WLW UI it is the File > Open recent post > Open From: selected blog > Pages radio button that shows these.

Then there is wp.getPageList which is used to populate the parent page dropdown. However we cannot limit this to only pages the user can edit because the user may be able to edit the child page but not the parent page, and we cannot limit it to pages that have an html instance because the parent page may not. So the best solution I could think of was to limit it to pages for which the user has view permissions. Therefore we have to assume that the user cannot edit any pages that are child pages of pages for which he has no view permissions. While technically he could have such permission, even from the web UI that would be unusual since the child nodes of a page he has no view permission on would not be in the menu.

So the result is that the parent page list may include pages that the user cannot edit and cannot create child pages below. In that case if the user tries to make one of those pages the parent we throw an error with a message about it that is shown in the error dialog of WLW indicating to the user that they cannot use the selected parent page. However this is only if the user is trying to change the parent page. The page he can edit may already have a parent that he has no permission on so we have to make it show those pages and we have to let the user keep that selected in the parent dropdown. We just can't let him move other pages there or create new pages there.

Thanks for letting me know about the error on In Site Analytics demo. I've fixed that.

Best,

Joe

11/30/2011 10:23:12 AM
Gravatar
Total Posts 18439

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

Very close to releasing a new version of mojoPortal with this new feature so I've created a new article Using Windows Live Writer to Create and Edit CMS Pages.

Best,

Joe

12/1/2011 1:39:46 PM
Gravatar
Total Posts 125

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

Love the function to create and edit pages in WLW. If there was not Blog instance on the site, is it possible to set up WLW just for page creation and edit?

Thanks

12/1/2011 1:46:48 PM
Gravatar
Total Posts 18439

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

Currently no, but I've been thinking about that. The problem is live writer wants to configure a blog id since it really is a blogging tool. Pages are just seen as additional functionality that lets you create pages in your blog site.

We don't need the blog id and don't use it for page editing but Live Writer doesn't know that. Possibly we could make it return a special item in the getUserBlogs method it uses during blog configuration, something with  -1 for the id and "Pages Only" for the blog title might work.

But for now you could just create a blog on a role protected page so no-one else can see it, as long as the editor user is in the role you can configure that blog in WLW and just don't use it for blogs if you don't want a blog.

Best,

Joe

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