Misc. Resources




Specified Mini-Lesson

MIDAS#7 Cross Reference Smartlinks (Midas Rich Text LSX)



The Cross Reference Smartlinks sample database shows how to use the Midas Rich Text LSX to create hyperlinks and mouseovers using the versatile LinkMatching method of the Midas Rich Text LSX. The main idea is that a Notes view can be used as a set of terms, and anywhere those terms appear in the rich text can be turned into a link back to the specific document or to a URL contained in the document (or contained in a formula which runs against the document), or into a mouseover tip or definition.
The video shows the database in action, but does not entirely explain that the LinkMatching method is a backend method that can be run in a scheduled agent, a web agent or other places aside from this pseudo-frontend use.The database was originally created in 2001 for Lotus Notes 5 using Midas V2, but has been updated and tested with all versions up to IBM Notes 9 and Midas V4.32 and the upcoming Midas V5.00, and contains features such as the MatchFont which are new in 4.32. One of the three agents which create the hyperlinks is shown, along with the single differing line for the other two agents.
Also of interest in the MedXRef.nsf database is the Parse Links agent, which traverses a rich text field and finds URL hotspots, then creates the medical terms and URLs from that hotspot. We copied an A-Z list on the WebMD website and pasted it in rich text field and then used this agent to parse out the terms.
If you would like to try out this sample and you do not currently have a Midas license, request an evaluation license, and one will be mailed to you. Download the Cross Reference Smartlinks sample db, or take a look at our many other sample databases at the Midas LSX Samples page.

This sample requires Midas 4.32 or higher.

AGENT: Cross Reference with links multi-match
' *** Domino front-end objects
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument

' *** Domino backend objects
Dim doc As NotesDocument
Dim mode As Integer

' *** Midas Rich Text LSX objects
Dim rtitem As New GeniiRTItem

' *** Get the backend document and edit mode from front end
Set uidoc = ws.CurrentDocument
mode = uidoc.EditMode
Set doc = uidoc.Document

' *** Connect to Body field and perform LinkMatching
Call rtitem.ConnectBackend(doc.Handle, "Body", False)
If rtitem.IsConnected Then
    If mode Then uidoc.Save
    uidoc.Close

    Call rtitem.Everything.LinkMatching("", "MedXref.nsf", "MedLinks", "Term", "Link", "")
    Set uidoc = ws.EditDocument(mode, doc)
End If

Note that the other two agents differ from the first only in the call to the LinkMatching method:

AGENT: Cross Reference with links multi-match
Call rtitem.Everything.LinkMatching("", "MedXref.nsf", "MedLinks", "Term", "Link", "SingleMatch='Yes' MatchFont='12pt' ")

AGENT: Cross Reference with links multi-match
Call rtitem.Everything.LinkMatching("", "MedXref.nsf", "Medical Glossary", "Term", "Definition", "Fieldname='Definition' Hotspot='Mouseover' Style='Highlight' ")


Copyright © 2014 Genii Software Ltd. All Rights Reserved.