Ben Langhinrichs

Photograph of Ben Langhinrichs

E-mail address - Ben Langhinrichs






November, 2003
SMTWTFS
      01
02 03 04 05 06 07 08
09 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30

Search the weblog





























Genii Weblog


Civility in critiquing the ideas of others is no vice. Rudeness in defending your own ideas is no virtue.


Mon 17 Nov 2003, 11:14 PM
A potential customer was evaluating our Midas Rich Text LSX recently, and commented that the documentation was great, but he wished there was one place where it listed the top ten ways to use Midas.  Now, I am not a big fan of top ten lists, especially the Dave Lettermen "Top Ten Stupid Pet Tricks" variety, but the customer is always right, so I decided to try creating a top ten list.  To give this list more lasting value, I'll try to post one post each few days and provide some explanation and links to relevant sample code and Help documents.  Starting with #10...

#10) Rich text comparisons with red-lining


Description
Midas enables rich text comparisons in two modes.  The comparison "with deletions" shows both additions and deletions.  It is generally considered the "Approver" view, since it allows a person approving the modifications to see what is removed as well as what is added or modified.  The comparison "without deletions" shows additions and modifications, but not deletions.  It is generally considered the "Public" view, since it allows the public to know what is new is a document without emphasizing what has been taken out.

History
Rich Text comparisons were introduced in Version 1.4, released in July 1998.  The functionality was developed as a custom enhancement at the request of a company in the UK that wanted to highlight changes to policy documents.

Comparison with standard Notes/Domino functionality
Standard classes in Notes/Domino have no rich text comparison ability at all, and there is no talk of adding such functionality.  Customers wanting such functionality sometimes resort to exporting data to MS Word, with all the data loss that entails, and doing the comparison there.

Documentation
Documented in the Help database by looking at the Contents view and going to 04 Midas Classes/04 GeniiRTComparison.  Start with the GeniiRTComparison class and look at the various properties.  Also look in particular at the Compare method.  Also, take a look at the Working with rich text comparisons document (02 Reference Guide/02 Working with/Working with rich text comparisons), which lists the assumptions and rules under which comparisons are made.

On-line demo
Review It! On-Line: An adaption of the downloadable Review It! sample demonstrates the Midas Rich Text LSX doing red-lined comparisons on the web. A slightly modified version that uses the rich text applet is also available upon request.

Sample Database
Review It! (Notes client, Web browser) Richtext comparison, Red-lining
Example shows how to use the red-lining rich text comparison features of the Midas Rich Text LSX both in the Notes client and on the web.

Sample Script Snippet
This is adapted from a customer's script, and is very similar to that of the on-line Review It! sample:

Dim cmp As New GeniiRTComparison
Dim flag As Variant

cmp.InsertionFont = "Blue"
cmp.InsertionTagFont = "Blue Superscript Roman"
cmp.DeletionFont = "Red +Strikethrough"
cmp.DeletionTagFont = "Red Superscript Roman"
cmp.TableRowDeletionTag="(-Rows)"
cmp.TableRowInsertionTag="(+Rows)"
cmp.TableColumnDeletionTag="(-Columns)"
cmp.TableColumnInsertionTag="(+Columns)"
cmp.BitmapDeletionTag="(-bmp)"
cmp.BitmapInsertionTag="(+bmp)"
cmp.SectionDeletionTag="(-section)"
cmp.SectionInsertionTag="(+section)"
cmp.DoclinkDeletionTag="(-link)"
cmp.DoclinkInsertionTag="(+link)"
   
cmp.IdentifyFontFaceChange =False
cmp.IdentifyColorChange = False
cmp.IdentifyBoldChange = True
cmp.IdentifyItalicChange = False
cmp.IdentifyPointSizeChange = True
cmp.IdentifyUnderlineChange = True
   
Call cmp.RTItemOriginal.ConnectBackend(doc.Handle, "BodyBefore", True)
Call cmp.RTItemRevised.ConnectBackend(cmp.RTItemOriginal.Handle, "BodyAfter",True)
Call cmp.RTItemCompared.ConnectBackend(cmp.RTItemOriginal.Handle, "ApproverBody",True)

' *** First, create the comparison "with deletions" into the ApproverBody field ****   
flag = cmp.Compare(True)
   
' *** Second, create the comparison "without deletions" into the PublicBody field ****   
Call cmp.RTItemCompared.ConnectBackend(cmp.RTItemOriginal.Handle, "PublicBody",True)
flag = cmp.Compare(False)

Copyright © 2003 Genii Software Ltd.

Mon 17 Nov 2003, 06:27 PM
I am a frequent reader and poster on the Notes 6 Gold forum as well as the Notes 4&5 Gold forum (How frequent?  See this post), and it has been a pleasure to see a familar name recently.  Neil Wainwright has been working with Notes/Domino for years, and often has very good ideas about ways it should be improved, but he has been away for a while.  Recently, I have seen his name popping up again, and it is good to see.

Anyway, Neil recently posted a gripe about table cell attributes, and why manually set table and table cell attributes don't override the computed attributes Domino thinks should apply.  Domino simply puts both sets of attributes in, and different browsers react differently, depending on whether the first or last attributes applies.  Even when it works, it is terribly sloppy HTML.

So why am I blogging about this?  Why, because this is something our Midas Rich Text LSX does properly, and has for years now.  When a table cell attribute is found that matches one we would add, we skip ours and use the manually added one.  That seems like the whole point of setting attributes.  We do it for cell attributes, row attributes and table attributes, and also for other rich text constructs.  I still think IBM should fix this for their HTML generation, but I am glad we are able to provide an alternative that works for those who need it.

Copyright © 2003 Genii Software Ltd.