Blog Navigator Professional posts again

Security versus compatibility and functionality. Is removing features a new course for Microsoft?

Originally posted on JoeUser.com

Last week it has been brought to my attention that our Blog Navigator can no longer post web articles. Alas, this was only a symptom of a much worse disease, but first things first…

This month in a noble effort of making the Windows platform more secure for us and our (perhaps future) kids ;) Microsoft rolled out a new set of updates, among which is this one innocently called MS05-013 and located in Microsoft Knowledge Base under a mysterious KB891781.

You will find more about the update and the horror it caused among the programmers using the control affected by the update on usenet, posts as this and this are only small sample of the damage. It seems that MS broke quite a few programs while making us more safe.

The effect, saying it bluntly is: IDHTMLEdit has been made useless and Blog Navigator fallen prey to that change.

Since IDHTMLEdit is simply a wrapper around MSHTML editor, I’ve examined quite a few approaches and some existing libraries, to fix the issue as fast and with as little modifications to the existing code as possible. After a day of hunting around and testing the existing approaches I’ve decided that if I want to retain the control over my code and keep it at a reasonable size, I need to do it myself.

Below is my simplistic (and working) approach to migrating from DHTML Editing Component to MSHTML editor (for Delphi programmers).

  1. I use a TEmbeddedWB as the web browser control wrapper as it offers quite a bit additional functionality. I’m assuming you use that instead of the TWebbrowser as well. If you’re not, it’a not a big problem to extract the functionalty you will need here.
  2. In the DhtmlEdit you operate on the DOM structure and that’s the interface the control does not allow you to access any loger and the change thaat makes it useless. The TWebBrowser offers a Document IDispatch which you can cast on IHTMLDocument2. This is exactly the structure you were working on before.
  3. Now the browser control itself does not offer the ExecCommand(…) functionality. but not all is lost. when you get to the IHTMLDocument2 interface as described before, you can pretty much do anythng you were doing before by calling its execCommand.
  4. You can also pull ann the formatting data from it by querrying it with its: queryCommandEnabled, execCommand, queryCommandIndeterm, queryCommandState, queryCommandSupported, queryCommandText and queryCommandValue methods.
  5. Now the problem is that IDHTMLEdit used numeric values while the Document requires you to use strings. The simplest method is to use a translating table which is what I did:
type
  TMSHtmlCommandTranslation = array [DECMD_BOLD .. DECMD_PROPERTIES] of WideString;
const
  MSHtmlCommandTranslation : TMSHtmlCommandTranslation = (
  'Bold',               //DECMD_BOLD = $00001388;
  '',                   //
  'Copy',               //DECMD_COPY = $0000138A;
  'Cut',                //DECMD_CUT = $0000138B;
  'Delete',             //DDECMD_DELETE = $0000138C;
  '',                   //DDECMD_DELETECELLS = $0000138D;
  '',                   //DDECMD_DELETECOLS = $0000138E;
  '',                   //DDECMD_DELETEROWS = $0000138F;
  'Find',               //DDECMD_FINDTEXT = $00001390;
  'FontName',           //DDECMD_FONT = $00001391;
  '',                   //DDECMD_GETBACKCOLOR = $00001392;
  '',                   //DDECMD_GETBLOCKFMT = $00001393;
  '',                   //DDECMD_GETBLOCKFMTNAMES = $00001394;
  '',                   //DDECMD_GETFONTNAME = $00001395;
  'FontSize',           //DDECMD_GETFONTSIZE = $00001396;
  '',                   //DDECMD_GETFORECOLOR = $00001397;
  'CreateLink',         //DDECMD_HYPERLINK = $00001398;
  'InsertImage',        //DDECMD_IMAGE = $00001399;
  'Indent',             //DDECMD_INDENT = $0000139A;
  '',                   //DDECMD_INSERTCELL = $0000139B;
  '',                   //DDECMD_INSERTCOL = $0000139C;
  '',                   //DDECMD_INSERTROW = $0000139D;
  '',                   //DDECMD_INSERTTABLE = $0000139E;
  'Italic',             //DDECMD_ITALIC = $0000139F;
  'JustifyCenter',      //DDECMD_JUSTIFYCENTER = $000013A0;
  'JustifyLeft',        //DDECMD_JUSTIFYLEFT = $000013A1;
  'JustifyRight',       //DDECMD_JUSTIFYRIGHT = $000013A2;
  '',                   //DDECMD_LOCK_ELEMENT = $000013A3;
  '',                   //DDECMD_MAKE_ABSOLUTE = $000013A4;
  '',                   //DDECMD_MERGECELLS = $000013A5;
  'InsertOrderedList', //DDECMD_ORDERLIST = $000013A6;
  'Outdent',            //DDECMD_OUTDENT = $000013A7;
  'Paste',              //DDECMD_PASTE = $000013A8;
  'Redo',               //DDECMD_REDO = $000013A9;
  '',                   //DDECMD_REMOVEFORMAT = $000013AA;
  'SelectAll',          //DDECMD_SELECTALL = $000013AB;
  '',                   //DDECMD_SEND_BACKWARD = $000013AC;
  '',                   //DDECMD_BRING_FORWARD = $000013AD;
  '',                   //DDECMD_SEND_BELOW_TEXT = $000013AE;
  '',                   //DDECMD_BRING_ABOVE_TEXT = $000013AF;
  '',                   //DDECMD_SEND_TO_BACK = $000013B0;
  '',                   //DDECMD_BRING_TO_FRONT = $000013B1;
  '',                   //DDECMD_SETBACKCOLOR = $000013B2;
  '',                   //DDECMD_SETBLOCKFMT = $000013B3;
  'FontName',           //DDECMD_SETFONTNAME = $000013B4;
  'FontSize',           //DDECMD_SETFONTSIZE = $000013B5;
  'ForeColor',          //DDECMD_SETFORECOLOR = $000013B6;
  '',                   //DDECMD_SPLITCELL = $000013B7;
  'Underline',          //DDECMD_UNDERLINE = $000013B8;
  'Undo',               //DDECMD_UNDO = $000013B9;
  'Unlink',             //DDECMD_UNLINK = $000013BA;
  'InsertUnorderedList',//DDECMD_UNORDERLIST = $000013BB;
  '');                  //DECMD_PROPERTIES = $000013BC;

I store the command values as the controls Tags so now instead of calling:

DHTMLEdit.ExecCommand(TControl(Sender).Tag,OLECMDEXECOPT_DODEFAULT);

I simply call:

FDocument.execCommand(MSHtmlCommandTranslation[TControl(Sender).Tag],True,variant)

where the FDocument is the IHTMLDocument2 DOM document I extracted from the TWebBrowser for the sake of not having to cast it each time I use it. and instead of:

DHTMLEdit.QueryStatus(TControl(Sender).Tag);

I can now use:

 FDocument.queryCommandValue(MSHtmlCommandTranslation[TControl(Sender).Tag]);
 FDocument.queryCommandEnabled(MSHtmlCommandTranslation[TControl(Sender).Tag]);

this allowed me to migrate away from DHTML Editing Component within one day after shunning all other options).

One thing that was pretty indispensible for DHTML Editing Component was that it called me back evary time a blok formatting was changed, it had this useful OnDisplayChanged event which was summoned every time the UI needed updating. That’s where TEmbeddedWB comes handy it implements a

function UpdateUI: HRESULT; stdcall;

which than triggers the OnUpdateUI event, which for our needs does exactly the save what the OnDisplayChanged event did. so you can simply call your previous OnDisplayChanged event with the numerical querries remapped to strings and… with minimal effort you have your control fully migrated to the MSHTML editor.

So… this post is the first post made with the updated Blog Navigator with its poat editong brought back to normal functionality.

Posted in Blog Navigator, Delphi, Software Development, Web applications
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
| 9 Comments »

Article editor shortcut summary

Originally posted on JoeUser.com

Stardock Blog Navigator Professional offers a host of keyboard accelerators while you edit your articles.
Here you have a short summary of the most important keystrokes used by the article editor.

Formatting

Description (Command) Key
Toggle bold formatting CtrL+B
Toggle italic formatting CtrL+I
Toggle underlining CtrL+U
Increase paragraph indent CtrL+T
Decrease paragraph indent CtrL+SHIFT+T

Posting and file operations

Description Key
Save the edited article into a locally stored file CtrL+S
Post the edited article to online blog (make it visible for the user butnot to the general public) ALT+S
Publish the edited article to online blog (make it visible for the general public) CtrL+SHIFT+S
Upload a file/image to an associated FTP account for use in the edited article ALT+U
Insert Image CtrL+SHIFT+I
Insert Horizontal line at the end of the edited article CtrL+SHIFT+H
Print edited article

CtrL+P

Movement

Description Key
Move one character to the right. If an absolutely positioned element is selected, nudge the element one pixel to the right. RIGHT ARROW
Move one character to the left. If an absolutely positioned element is selected, nudge the element one pixel to the left. LEFT ARROW
Move down one line. If an absolutely positioned element is selected, nudge the element down one pixel. DOWN ARROW
Move up one line. If an absolutely positioned element is selected, nudge the element up one pixel. UP ARROW
Move right one word CtrL+RIGHT ARROW
Move left one word CtrL+LEFT ARROW
Move to the end of the current line END
Move to the start of the current line HOME
Move down one paragraph CtrL+DOWN ARROW
Move up one paragraph CtrL+UP ARROW
Move down one page PAGE DOWN
Move up one page PAGE UP
Move to the beginning of the document CtrL+HOME
Move to the end of the document CtrL+END
Cycle selection through block-level elements within the control TAB
Reverse-cycle selection through block-level elements within the control SHIFT+TAB

Selection

Description (Command) Key
Extend the selection one character to the right SHIFT+RIGHT ARROW
Extend the selection one character to the left SHIFT+LEFT ARROW
Extend the selection right one word CtrL+SHIFT+RIGHT ARROW
Extend the selection left one word CtrL+SHIFT+LEFT ARROW
Extend the selection up one line SHIFT+UP ARROW
Extend the selection down one line SHIFT+DOWN ARROW
Extend the selection to the end of the current line SHIFT+END
Extend the selection to the start of the current line SHIFT+HOME
Extend the selection down one page SHIFT+PAGE DOWN
Extend the selection up one page SHIFT+PAGE UP
Extend the selection to the end of the document CtrL+SHIFT+END
Extend the selection to the beginning of the document CtrL+SHIFT+HOME
Select all elements in the document CtrL+A

Editing

Description (Command) Key
Delete the selection or, if there is no selection, the character to the left of the insertion point BACKSPACE
Delete all of a word to the left of the insertion pointer, not including the space before CtrL+BACKSPACE
Copy the selection to the Clipboard CtrL+C
Paste the contents of the Clipboard to the current location CtrL+V
Cut the selection to the Clipboard CtrL+X
Delete the selection without placing it on the Clipboard DELETE
Toggle between inserting and overwriting text INSERT
Undo the most recent formatting commands CtrL+Z
Re-do the most recently undone commands CtrL+Y
Find text CtrL+F
Display the Hyperlink dialog box if the insertion point is within an <a> element CtrL+L
Toggle absolute positioning for the selected element CtrL+K

absolute positioning

A CSS feature that allows elements in a Web page to be positioned using style attributes that function like x and y coordinates. Using CSS styles, absolutely positioned elements also support a z-index that allows them to appear in front of or behind other elements on the page. Absolute positioning is a DHTML feature implemented through various style attributes.

Partially copyright ? 2004 Microsoft Corporation. All rights reserved.

Posted in Blog Navigator, Blogging, Web applications
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
| 30 Comments »

You thought you’ve tried them all already – now it’s time to try the ultimate experience!

Originally posted on JoeUser.com

First of all let me express how excited I am about the release of Blog Navigator. I think we did a good job on it and I am trully amazed at our approach to its release. 

Let me explain why.  Mind that Stardock kept a guy :) ) on a payroll for a better part of a year to do this.

We’ve been discussing the Blog Navigator release yesterday and Brad actually decided to remove ALL the RSS related limitations from the free edition of Blog Navigator! What does that mean? It means there is no longer a limit of a single instance of Basket, Article Monitor and Web Search (Internet Article Monitor) in the free version! You get everything that makes it a great RSS reader and it’s NOT a trial or a shareware that will nag you in any way, neither you are limited at how you use it. You can use it at home, and you can use it at work (I would not however recommend taking it to the beach – notebooks don’t like the sand involved)!

Thank you Stardock!

If you’re into RSS/feeds/syndication and already have a reader – Blog Navigator comes with a handfull of importing filters – it’s very likely that you will be able to move all your feeds within a minute or even have them autodetected and done automatically. So if you want to be sure you never miss an article on your favorite sites, want to monitor for a specific topic or any set of them or just need a cool web browser that will get some more articles in the background for you while you read another one – give it a whirl, share it with a friend, tell a co-worker they can speed up and enrich their daily lecture.

We really tried to make it the best possible syndication experience out there – now you can see if we succeeded. Tell us if you like it. We will gladly hear what we can do to make it better. I would like to thank all beta testers withough which suggestions it would not be what it is now – stressing the enormous part of Brad Wardell and Kris Kwilas in shaping the product and Randy Cox whose suggestions and patience in testing the consecutive versions of betas went beyond all limits.

For the best possible experience read my series of articles on Blog Navigator features and how to make the best use of it

You will find the first part of the series of the articles here.

The Stardock Blog Navigator feature tour – Part IV

Blogging with Blog Navigator Professional – Creating a blog account

Originally posted on JoeUser.com

The third part of the article already available here…

Reading blogs is one thing, and alot of programs allows you to do that with better or worse results. What makes Blog Navigator unique is among other features (like search article monitors, baskets and search blogs) its ability to both read and write blogs.

Let’s setup Blog Navigator Professional to use an account on JoeUser.

There’s not much to show really… I’m not sure it could actually be easier. Let me add my JoeUser account to Blog navigator as a first sample:

Adding account from main menu

Now I have the regular dialog like adding any other feed or folder type where you enter it’s name and various properties. The most insteresing tab that defines my account access info is the “Account” tab.

Blog account preferences dialog

I entered my username and the password and selected JoeUser.com from the “Blog Service” combobox. If you do not have an account on a service you want to use, simply click the “Create your blog own here” link below the combo and Blog Navigator will take you to the blogging service site where you will be able to create one.

Now I press the OK button and… that’s it!

Newly added blog

Since I had articles on that account already Blog Navigator retrieved the last 20 posts and now allows me to edit them, delete and add new articles.

Blog Navigator comes with a handful of predefined list of popular blog services you may select from the list where i selecvted JoeUser.com in my sample. Alternatively you can setup your own custom blog service. All you need to know (or ask the admin of your site for) is the URL (address) of the so called “RPC-XML end point”. If you do not know what to ask – just point your blog service admin ad this article and he/she will surely know what to give you.

Still most probably it will be your own service setup on your own server – in that case consult the documentation of the web application to obtain the entry point to the XML-RPC API and the API type the application supports.

Let’s setup my Joeuser account the harder way…

Setting up account the harder way - selecting custom service

I select the “Custom…” blog service from the combo box, which happens to be the defaulty one… but I digress…

Setting up account the harder way - selecting the API

I’ve read in the site documentation… well actually I helped designed it, but I digress again … that the api the web site supports is the JoeUser.com API (which else!) so I select it from the combo box and…

Setting up account the harder way - setting up the endpoint

enter the XML-RPC end point I obtained from my admin – Pat. (actually we’ve came up with that address while designing the JoeUser.com XML-RPC API, but let’s pretend I had to go through the pain of asking Pat for it :) ).

Well…

Setting up account the harder way - Two accounts?!?!

actually now I’m left with two Blogging accounts pointing to one account in a service – not very practical… but hey! It’s possible and Blog Navigator can handle it just fine, so why not.

Actually I can delete the other one – deleting an account does not delete it on server. That’s actually different than deleting your posts – Blog Navigator will also delete them on server. It will however inform you and make sure you are aware of the consequences and that this is what you really want to do.

In the next part I’ll show you how to write an article to our newly added account.

The fifth part of the article already available here…

Posted in Blog Navigator, Blogging, Software, Web applications
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
| Leave a Comment »