Notes Resources




Mini-Lessons

Midas Rich Text LSX: The world's leading LotusScript extension library

Rich Text doesn't have to be hard. HTML/XHTML and MIME don't have to be inaccessible.

The Midas Rich Text LSX extends LotusScript and allows you to expand your business logic. The easiest and most powerful rich text toolkit for IBM Notes and Domino is also the best and most flexible CSV, EPUB, HTML and MIME generator. Give it a try, and make rich text your business.

NOTES#6 Apps Fidelity: Sneak Peek 2 (AppsFidelity)


This brief preview demo shows how AppsFidelity allows you to access a magical file attachment in EPUB format with the rendered document and up to 7 additional linked documents. AppsFidelity is still under development, so any features are tentative at this point.



NOTES#5 Apps Fidelity: sneak peek (AppsFidelity)


This brief preview demo shows how AppsFidelity allows you to access a magical file attachment with the rendered document. AppsFidelity is still under development, so any features are tentative at this point.



MIDAS#20 Domino Blog to WordPress: Using CSV to migrate posts (Midas LSX)


This brief demo shows a technique using the Export to CSV sample with Midas V5.11 to generate custom columns from a database using the IBM Domino Blog template into a CSV file that can be used to import to WordPress. The idea came from Alan Lepofsky who wants to do just that. It is likely that the exact field definitions will be enhanced as we go through some real world blogs and see where slight tweaks are needed (for example, the fields having to do with podcasts or with extra HTML.
The new Export to CSV 1.4 sample db will be up on the Midas LSX sample page as soon as Midas 5.11 is released, probably Sept. 4, 2014. In the meantime, the field definitions show look like this:





MIDAS#19 AutoCheck: Technique to verify LSX installation in database (Midas LSX)


This brief demo shows a new technique we have developed to improve the user experience for a customer downloading one of our sample databases. It can easily be copied for use in a customer database, or for use by another ISV who wants to verify an LSX or other software installation prior to use.
The first Midas LSX sample database to use the new code is the Export to CSV sample db, though all samples on the Midas LSX sample page will have this added soon. You may download the Export to CSV sample to try the code for yourself, but the event script is also included below. While it looks simple, it relies on a number of very specific interactions, so be careful when modifying it.
Sub Postopen(Source As NotesUIDatabase)
Const VersionNeeded = "5.1"
Dim ws As New NotesUIWorkspace
Dim s As New NotesSession
 
On Error GoTo CatchError
Call s.SetEnvironmentVar("MidasLSX_VersionNum", "", False)
 
Print "Check to see if Midas LSX is installed with V"+VersionNeeded+" or higher"
Execute |Uselsx "*lsxrtc"
Dim gSession As New GeniiSession
Dim sess As New NotesSession
Call sess.SetEnvironmentVar("MidasLSX_VersionNum", CStr(gSession.Version), False)|
 
If s.getenvironmentstring("MidasLSX_VersionNum", False) < VersionNeeded Then
MessageBox "A newer version of the Midas LSX is needed. To update your installation, click 'OK' and follow the instructions"
Call ws.OpenPage("MidasLSXInstallation")
Else
Print "Verified that Midas LSX V"+s.getenvironmentstring("MidasLSX_VersionNum", False)+" is installed"
End If
 
Exit Sub
 
CatchError:
MessageBox "The Midas LSX must be installed in order to use this database. Click 'OK' and follow the instructions to install."
Call ws.OpenPage("MidasLSXInstallation")
Exit Sub
End Sub



MIDAS#18 Out of Notes Part 10: To SQL Server/DB2 (Midas LSX)


Out of Notes, part 10: To SQL Server or DB2 is the first in the series since we released the Genii Software Raodmap. As such, it shows how we are dealing with customers in Lane 2, who have a Notes infrastructure but have either no dedicated Notes development staff, or a severely limited staff. It can also apply to customers in Lane 1 who are actively migrating data out of Notes and into a different infrastructure.
In this video, we demonstrate the Export to CSV sample database, a data driven database which empowers a user to export an entire database or portions of it to CSV format. Each form is exported to a separate CSV file, with either every field or selected fields represented. Rich text fields are represented in HTML/XHTML and included in the CSV. Images may be included internally or exported to disk where they can be imported separately. Links between documents may be preserved in a variety of ways.
Once the export is done, the CSV can be imported into SQL Server using a script such as SharePoint or another SQL or other database which takes CSV input. The process is very fast and scales well. No changes are necessary to prepare the databases to be exported, and the Export to CSV will work equally well on databases with a locked design, such as 3rd party databases from a proprietary vendor who is no longer in business or cannot provide details on the databases.
The Export to CSV database requires that Midas LSX 5.x be installed along with a valid license file, but an auto-install document in the database will take care of this installation silently if the license and software have been added to it.
Importing CSV files into SQL Server is easy with a technique such as the one described in How to create and populate a table in a single step as part of a CSV import or using Powershell.
Importing CSV files into DB2 is also easy with a technique such as the one described in Import of CSV-file or using utilities such as DB2eClp.

Rough transcript:
This is Ben Langhinrichs of Genii Software with Out of Notes Part 10: To SQL or DB2.

We have customers who want to take data and use it in a relational database such as SQL Server or DB2. I'm going to show you how to do this with Midas and our new Roadmap.

This is the Mini-Lessons.info site, and it runs off a database. Each lesson is a separate document with complex data inside it. So, if we go into the Export to CSV database and create an Export Directive, all we have to do is pick the database.

We're going to export everything from the database. We'll go to the c:\export\ directory, use all the forms and all the fields. We'll save it (the Export Directive form), and then we can run the agent. You don't need a developer for this.

There's the c:\export\ directory. Click this (view action) and switch over and we'll see there is now a Lessons subdirectory and there's the CSV file. Every item in the Lessons is now represented by a separate column. The first row has the titles (item names). Down here (in a subdirectory) we have the additional images and attachments.

Similarly, we can take the Lotusphere Sessions database from a couple years back. In this case we don't want everything, we don't want those people and things like that, we just want the sessions, and we just want some of the fields.

We're going to create a new Directive, pick the Sessions database and this time we're going to select the JournalEntry form, which is what stores the Session, and then we'll just put a few of the field names in.

The idea here is to take some Notes data, and without having to have a Notes developer at all - because not everybody has those anymore - you can just specify the information you want and export a high fidelity version of that.

In this case, there's no rich text, so when we look at the CSV file what we're going to find is just the items that we specified, the session id, session title and session abstract.

We can pull that into DB2 or SQL Server and use that as we need it. I've provided some links in the description below about how to take that CSV file and easily put it into SQL Server or DB2.

Thank you for joining us, and visit us again at Mini-Lessons.info



MIDAS#17 Midas for Non-Developers Part 1: To CSV (Midas Rich Text LSX)


Midas for Non-Developers: In this series, we will look at how the Midas LSX can be used by administrators or users who have no development experience in Notes, and who may not even have Domino Designer. Each lesson will focus on a separate Notes database which is ready to use out of the box, though it would be best if the database were signed by an administrator to prevent ECL errors.
Part 1: Export to CSV: In the first of the series, we demonstrate the Export to CSV database. In this, a customer can specify a database and location and export all the documents ibn the database to CSV format. Each form is exported to a separate CSV file, with every field (except a few non-essential Notes system fields) represented unless the user chooses a subset of fields or a different order than the standard. Rich text fields are represented in HTML/XHTML and included in the CSV. Images may be included internally or exported to disk from where they can be imported separately. Links between documents may be preserved in a variety of ways.
Once the export is done, the CSV can be imported into SharePoint or another SQL or other database which takes CSV input. The process is very fast and scales well. No changes are necessary to prepare the databases to be exported, and the Export to CSV will work equally well on databases with a locked design, such as 3rd party databases from a proprietary vendor who is no longer in business or cannot provide details on the databases.
The Export to CSV database requires that Midas LSX 5.x be installed along with a valid license file, but an auto-install document in the database will take care of this installation silently if the license and software have been added to it.

Rough transcript (coming soon):



MIDAS#16 Out of Notes Part 9: Professional Polish (Midas Rich Text LSX)


Out Of Notes, part 9: Professional Polish. While it is useful to publish Notes content in a variety of formats, companies require more than a regimented export. They require the ability to customize the look and feel of the exported data, customize the content to maintain certain corporate standards, redact information that may not be appropriate to leave the internal database and package the content with a professional cover image and possibly action oriented end pages. With Midas LSX V5, these are all possible, and in this video I show a few of the choices made and how they improve the professional appearance as well as the content control required for corporate or government use.
While there are four agents used, this last is the compilation of most of the techniques. This agent will only work in Midas V5.00.

This extended sample requires Midas 5.00 or higher. If you would like to try out this sample, request an evaluation license, and specify that you want to try Version 5, and one will be mailed to you as soon as the new version is released.

The four ePub files are linked below. From an iPhone or iPad, you can open these directly.


AGENT: Publish Thread with polished contents
Option Public
Option Declare
UseLSX "*lsxrtc"

Sub Initialize
Dim s As New NotesSession
Dim rtitem As New GeniiRTItem
Dim gcoll As New GeniiCollection("", S.CurrentDatabase.FilePath, "All Documents", "ID:"+CStr(s.DocumentContext.NoteID))
Call gcoll.AddLinked()
On Event ActOnResult From gcoll Call ActOnResult
Call rtitem.ConnectPageBody("", "CurbAppealDiscussion.nsf", "IntroEpub")
Call gcoll.ExportToEPub("c:\demo\thread4.epub", _
"Threadmap='Yes' Sort='No' Expand='32' UseTheme='yes' dc:title='Thread 4: Polished'", rtitem)
End Sub

Sub ActOnResult(Source As GeniiCollection, resultItem As GeniiRTItem)
Dim rtchunk As GeniiRTChunk
Set rtchunk = resultItem.DefineChunk("Table ID 'myBody'")
Call resultItem.DefineFont("Arial")
rtchunk.Font = "10 pt Arial"
Call rtchunk.RegexReplace("(^|[\D*])(4\d|5[1‒5]{1})\d{2}[ \\-]?\d{4}[ \\-]?\d{4}[ \\-]?(\d{4})([\D*]|$)", "$1xxxx-xxxx-xxxx-$3$4")
End Sub


Rough transcript (coming soon):



MIDAS#15 Out of Notes Part 8: Integrating with Notes 9 and the Browser Plugin (Midas Rich Text LSX)


Out Of Notes, part 8: Integrating with Notes 9 and the Browser Plugin shows an easy way we can use the Midas V5 capsule views from inside either the IBM Notes 9 Social Edition client or the IBM Notes 9 browser plugin. The goal is a one click agent that creates a capsule MHT file.
The agents used for the demo are shown below. This agent will only work in Midas V5.00.

This extended sample requires Midas 5.00 or higher. If you would like to try out this sample, request an evaluation license, and specify that you want to try Version 5, and one will be mailed to you as soon as the new version is released.


AGENT: Open Selected in Capsule MHT
Dim ui As New NotesUIWorkspace
Dim s As New NotesSession
Dim db As NotesDatabase
Dim coll As NotesDocumentCollection
Dim doc As NotesDocument

Dim gcoll As New GeniiCollection

Set db = s.Currentdatabase
Set coll = db.UnprocessedDocuments
Set doc = coll.GetFirstDocument
While Not (doc Is Nothing)
   If gcoll.AddDocBackend(doc.Handle) Then
      Print "Added "+doc.StreetAddress(0)
   End If
   Set doc = coll.GetNextDocument(doc)
Wend
Call gcoll.ExportToMIME("c:\demo\DesignerHelp.mht", |Content-Type: text/html; charset="iso−8859‒1"|, |charset="iso−8859‒1"|, _
   |Capsule='Yes' RenderWithForm='Yes' charset="iso−8859‒1" PreserveTabs='8'|)
Call ui.URLOpen("file://c:/demo/DesignerHelp.mht", True)


Rough transcript (used for Closed Captions as well):
This is Ben Langhinrichs of Genii Software with a Mini-Lesson called Out of Notes Part 8: Integrating with Notes 9 and the Browser Plugin.

Switching to our desktop, let's open up IBM Notes 9 Social Edition. Once we're in there, we're going to open up the Designer Help database because that is a known, standard database. We've added an agent to this. I'll show you that in a little bit.

So, we do a search in here. We're going to search for "rich text programming". Let's see what that comes up with. It will come up with 46 documents. If we select those documents now we're going to run the agent. It's called "Open selected in capsule MHT".

Click on that and it opens up the capsule view in the embedded browser inside Notes. We can cycle through the different documents. This agent uses Midas Version 5, of course. We can cycle up and down, and again all in the integrated browser. So this is one way you can use the Midas 5 capsule views inside the Notes 9 client.

But another way is to go into the browser. This is the Firefox browser and we're going to open up the browser plugin. If you go in here, it's pretty much the same thing. We'll go into the Designer Help database in the workspace inside Firefox.

We'll do a different search this time. We'll search for "MAPI". It has fewer documents, 8 documents, so we're going to select those and and again run the "Open selected in capsule MHT" agent, and the only real difference is that it opens up in the Internet Explorer browser to view this, instead of the integrated browser. Just as before, we can see all the well-rendered documents that matched our search, but inside the browser.

If we switch over, we can look at what the code for this looks like. Basically, we just take each of the selected documents and add it to the collection and then call ExportToMime. At the bottom, you'll notice that we've used Capsule='Yes'. That just says it's going to be a capsule view and not integrated separately. Finally we do a NotesUIWorkspace.URLOpen and that just opens the MHT file we've just created.

That's an easy way to integrate with Notes 9 and the browser plugin.

Thank you very much.



MIDAS#14 Out of Notes Part 7: MultiDatabase Export (Midas Rich Text LSX)


Out Of Notes, part 7: MultiDatabase Export shows how we can create collections to be exported with documents from more than one database at a time. There are different ways to include documents from multiple databases. The first we show is by using any of the standard methods to add documents (AddByView, AddByFormula, AddDocBackend, AddByFTSearch) but doing so individually with multiple databases. These documents do not need to be related or connected in any way, The second way we show is by including links at the time of export. That pulls in documents that are linked via doclink, whether or not the documents are in the same or other databases. These linked documents are then accessible following the doclinks in the exported collection, whether in EPUB or HTML or MHT.
The agents used for the demo are shown below. This agent will only work in Midas V5.00.

This extended sample requires Midas 5.00 or higher. If you would like to try out this sample, request an evaluation license, and specify that you want to try Version 5, and one will be mailed to you as soon as the new version is released.

AGENT: Publish Thread
Coming shortly

Rough transcript (used for Closed Captions as well):
Coming shortly



MIDAS#13 Out of Notes Part 6: By a Thread (Midas Rich Text LSX)


Out Of Notes, part 6: By a Thread shows we can easily export or publish a single thread from a discussion database. It also shows how a response hierarchy can be represented in an EPUB file and navigated per document with a small thread map.
The agent used for the export is shown below. This agent will only work in Midas V5.00.

This extended sample requires Midas 5.00 or higher. If you would like to try out this sample, request an evaluation license, and specify that you want to try Version 5, and one will be mailed to you as soon as the new version is released.

AGENT: Publish Thread
Coming shortly

Rough transcript (used for Closed Captions as well):
Coming shortly



MIDAS#12 Out of Notes Part 5 : To SharePoint (Midas Rich Text LSX)


Out Of Notes, part 5: To SharePoint shows how a Notes database can be exported to CSV (comma-separated-values), the technique we have developed with a few early adopter companies to take Notes data to SharePoint with maximum flexibility and fidelity. In this export, all fields can be included or only a subset. Rich text fields are converted to HTML or XHTML while images and attachments are extracted as separate files which can be loaded to SharePoint in a separate sweep. Since a CSV file is a plain text field, it is also available for easy post-processing in Excel or using various tools that work with CSV files.
The export to CSV can work with any size collection, and a size limit can be established so that a series of CSV files can be created for very, very large databases. The export is very fast. In this demo, a single CSV file is created for the 124,200 documents, each of which has four rich text fields with total of over 3.5GB of extracted images, and the entire export takes approximately 20 minutes.
The agent used for the export is shown below. This agent will only work in Midas V5.00, and exports of over 1000 documents require the Midas Exports add-on license. An additional feature is that this does not require access to the design of the database, but can extract the data from locked-design databases as well.

This extended sample requires Midas 5.00 or higher. If you would like to try out this sample, request an evaluation license, and specify that you want to try Version 5, and one will be mailed to you as soon as the new version is released.

AGENT: Export to CSV
Set coll = db.Search(|Form="|+form.name+|"|, Nothing, 0)
If coll.count > 0 Then
   Set gcoll = New GeniiCollection
   Set doc = coll.GetFirstDocument
   count = 0
   While Not (doc Is Nothing)
      If gcoll.AddDocBackend(doc.Handle) Then
         count = count + 1
         If count Mod 1000 = 0 Then
            Print CStr(count)+" documents added for Form '"+form.name+"'"
         End If
         Set doc = coll.GetNextDocument(doc)
      Else
         Set doc = Nothing
      End If
   Wend
   Print "exportsubdir-"+form.name+": "+CStr(count)+" of "+CStr(coll.Count)+" documents collected. Exporting..."
   successful = gcoll.ExportToCSV(exportdir+"\"+exportsubdir+"-"+form.name+".csv", actiondoc.Properties(0))
   Delete gcoll
End If

Rough transcript (used for Closed Captions as well):
This is Ben Langhinrichs of Genii Software with a mini-lesson called Out of Notes Part 5: To SharePoint. In this case, we're going to take a version of our Curb Appeal daatabase that I've been showing you which has house listings. This one is a much larger version.

It has 124,200 documents and has about 3.6GB of information. We're going to export it to a CSV (comma-separated values) in order to be able to import it into SharePoint. If we look in this, we'll see that each field has a photograph, and it has four different rich text fields and a number of other values.

So now what we're going to do is export this to our CSV file, and we use this helper database we have. First let's export the Curb Appeal database which just has 46 documents, and that's practically instantaneous, but if we go look, it will give us an idea of what we're getting.

We have a CSV file right here and we just open it in Excel. You can see how each of the fields is represented, and how there is HTML for the rich text fields. So, if we go back out, we'll see that there are references to photographs, and one that has the photographs. Those will then be extracted and can be loaded into SharePoint separately.

After, we go in here and here are all those photographs. But let's take a look now at the much larger database, and let's start the export.

In reality, this takes about 20 minutes, but I sped it up for the purposes of this demo so you can see roughly what it does. It's going to go and extract all of those images, the 3.6GB of images, and the CSV file and it's going to take it out to those same directories where it can be imported.

See, right there it has exported everything. Now if I go back and look at the directory, you'll see that there are a lot of images. In this case, there are 124,200 because there's actually exactly one for each document. If we look at the CSV file... I'm not going to try to open it right now, but it's 800MB. That's big, but it'ss easy to load into SharePoint. I've done this with customers with much larger ones than that actually.

And that's what it takes to take your data out of Notes, an entire database, it can even be a locked design, take it out and export it to SharePoint.

Thank you very much and stay tuned for more episodes.



MIDAS#11 Out of Notes Part 4: Linked Collections (Midas Rich Text LSX)


Out Of Notes, part 4: Linked Collections shows how we can create collections of data with Midas 5 that include both the chosen documents and documents linked to from those documents. In this case, it shows how we can ePublish a couple of selected documents from the Midas Help database, and how the EPUB file created includes the documents linked to those documents via doclinks in the rich text. As shown in the previous segment of this series, EPUB is the most widely accepted eBook format. An ePub file can be opened natively on an iPad or iPhone, B&N Nook, many other Android devices and PCs, all without adding any software.
Because the ePub format is a single file collection of documents with its own navigation, it falls into the same category of "capsule views" that I demonstrated in my earlier segment, Out of Notes, part 2: Capsule Views. In future segments, I will show both other ways to create ePub files from Notes and Domino applications, and also more details on how to add Midas functionality to XPage applications in more integrated ways.
The agent used for the export is shown below. This agent will only work in Midas V5.00 (to be released soon).

This extended sample requires Midas 5.00 or higher.

AGENT: Export to EPUB selected plus linked documents
Dim s As New NotesSession
Dim db As NotesDatabase
Dim coll As NotesDocumentCollection
Dim doc As NotesDocument

Dim gcoll As New GeniiCollection

Set db = s.Currentdatabase
Set coll = db.UnprocessedDocuments
Set doc = coll.GetFirstDocument
While Not (doc Is Nothing)
   If gcoll.AddDocBackend(doc.Handle) Then
      Print "Added "+doc.Subject(0)
   End If
   Set doc = coll.GetNextDocument(doc)
Wend
Call gcoll.ExportToEPub("c:\demo\MidasHelp.epub", "IncludeLinked='Yes' ")

Rough transcript (used for Closed Captions as well):
This is Ben Langhinrichs of Genii Software with a Mini-Lesson called Out of Notes Part 4. In this, I'm going to talk about Linked Collections.

If you look in our Midas Help database, you'll notice there are a lot of links which go to other topics. So, one of the things that Midas 5 allows you to do is create collections that include both the selected documents and documents which are linked from within it, and then export those.

In this case, we'll export to EPUB. We run the export plus selected links. When we switch over and look in that EPUB file, what we'll see is both the selected documents, which are those three up at the top. If we go in the links are there and we can follow the links. We'll shrink this down so we can see better.

When we click on them, we see the linked document. So you can have a collection plus all the things that it linked to.

Now, I linked at one level down, so just the directly linked documents, but you can do multiple levels down if you want to. They'll just show up here. If we look at the table of contents, it won't include the linked documents, but in an EPUB file it always does.

So here is the logic, and all we really did is the ExportToEPUB has IncludeLinked="Yes", or if you wanted multiple levels, you could use IncludeLinked=2 or 3.

There is the Table of Contents. So, that's the way in Midas you can make Linked Collections. Thank you very much, and watch for further segments.



MIDAS#10 Out of Notes Part 3: ePublish from XPages (Midas Rich Text LSX)


Out Of Notes, part 3: ePublish from XPages shows how we can easily add Midas functionality to an XPages application. In this case, it also show how we can ePublish to the most widely accepted eBook format, EPUB. An ePub file can be opened natively on an iPad or iPhone, B&N Nook, and many Android devices, without adding any software. There are also numerous ePub reading apps available for any smart device or PC. I should both a plugin for Firefox and a standalone ePub app for the PC.
Because the ePub format is a single file collection of documents with its own navigation, it falls into the same category of "capsule views" that I demonstrated in my last segment, Out of Notes, part 2: Capsule Views. In future segments, I will show both other ways to create ePub files from Notes and Domino applications, and also more details on how to add Midas functionality to XPage applications in more integrated ways.
The agent used for the export is shown below. This agent will only work in Midas V5.00 (to be released soon).

This extended sample requires Midas 5.00 or higher.

AGENT: ExporttoEPUB
Set doc = s.DocumentContext
pos = InStr(doc.Query_String(0), "&Terms=")
srchterms=Mid(doc.Query_String(0), pos+7, Len(doc.Query_String(0))-pos-6)

Set db = s.Currentdatabase
Set coll = db.Ftsearch(srchterms, 30)
Set doc = coll.GetFirstDocument
While Not (doc Is Nothing)
gcoll.AddDocBackend(doc.Handle)
Set doc = coll.GetNextDocument(doc)
Wend
If coll.Count > 0 Then
Call gcoll.ExportToEPub("c:\demo\xHelp.epub", "RenderWithForm='Yes' ")
Else
Print "No items matched the search term"
End If

Rough transcript (used for Closed Captions as well):
This is Ben Langhinrichs from Genii Software with Out Of Notes, part 3: ePublish from XPages. In this video, I show how Midas V5 allows you to create an EPUB file from an XPages application.

I used the XPages Help Application from OpenNTF. You could select a certain number of documents to export, but in this case I used the search function just the way we can right now type a term like "INTEC", click on it and find all the documents.

Let's try another one, "views". Click on the search and see the documents it finds. Now, if you click on the button I added next to it, ePublish (using Midas), it exports those documents to an ePub file. If we switch over to a browser, we can open the ePub file. EPUB is a format that's widely accepted for ePublishing on iPads, iPhones, Android devices, eReaders and elsewhere.

This is an ePubreader plugin for Firefox. You'll see as we step through, these are the same documents that you saw back in the XPages Help Application formatted the same way.

Let's try another. Search for "bookmarks", click on the ePublish button, and if we do the same thing and switch over to Firefox, we can open the same file that we used before, but it now has a different selection of documents.

This will work with almost any eReader on any devices. Here is the same file in another PC-based reader. Adobe Digital Editions. You can see it looks basically the same with a somewhat different UI. The logic is that it will work on any eReader.

If we go and look at the agent code using Midas V5, it's fairly simple. In this we're taking the Query String because we called this agent via a URL from the button. We extract the term, search for it and create the EPUB file.

Thank you very much. Stay tuned for more segments on Out of Notes.



MIDAS#9 Out of Notes Part 2: Capsule Views (Midas Rich Text LSX)


Out Of Notes, part 2: Capsule Views shows one of the ways Midas V5 extends the options for taking data out of Notes. Using the same sample database, Curb Appeal, which we used in Part 1, we select four documents and export them together to the Web Archive format (.mht). A small navigation bar allows us to jump from document to document, or we can simply scroll through them. This capsule view approach allows us to send a single file with all the images, formatting, etc. from the collection of documents included. Redundant data such as the agent image used multiple times are only included once, thus saving space.
The agent used for the export is shown below. This agent will only work in Midas V5.00 (to be released soon).

This extended sample requires Midas 5.00 or higher.

AGENT: Export selected documents to capsule Web Archive (.mht)
' *** Get the collection and cycle through each selected document
Set db = s.Currentdatabase
Set coll = db.UnprocessedDocuments
Set doc = coll.GetFirstDocument
While Not (doc Is Nothing)
If gcoll.AddDocBackend(doc.Handle) Then
Print "Added "+doc.StreetAddress(0)
End If
Set doc = coll.GetNextDocument(doc)
Wend
Call gcoll.ExportToMIME("c:\demo\CurbAppeal.mht", "", "", _
|MakeURLHotspots='Yes' charset="iso−8859‒1" AddNewlines='CRLF' RespectHiddenFormulas='Yes'|)

Rough transcript (used for Closed Captions as well):
This is Ben Langhinrichs of Genii Software with Out Of Notes, part 2: Capsule Views. In this, I show how Midas V5 extends the ability to create a snapshot of Notes data.

As I showed you in Part 1, the Curb Appeal database is here and there's a listing, and we can export a snapshot of a single document, and look at it as a single file form of one document showing all the data.

But what if we want to take a look at multiple documents at one time. So, let's say we want to take these four documents, step through them, and we want to send them to a customer but just as a single file.

For this, Midas introduces the idea of "capsule views". We'll export these as a capsule Web Archive, so also a .MHT file. And if we open that up, what you'll see looks very similar except with a navigation bar. If you click on the navigation bar, you'll simply step through the different documents all put together. This is still a single file so you can send it to a customer, and they can get a snapshot of a group of data, with generally not more than about 20 documents.

This is the code. As you can see, it's fairly simple. So again, this is one of the ways Midas 5 is extending the ability to create a snapshot of data and take it out of Notes. Thank you very much.



MIDAS#8 Out of Notes Part 1: The Challenge (Midas Rich Text LSX)


Out Of Notes, Part 1: The Challenge introduces a new sample database called Curb Appeal*, which has a number of real estate listings. Each listing has a complex set of data including numbers (how many bathrooms, how many car garage, etc.), text (architectural type, school distrtict, etc.) and multiple rich text fields (photo of house, bullet lists of highlights).
The challenge is to take this data and present a snapshot of a single listing (document) in Microsoft's Web Archive format, a MIME format which allows all the data including images inside a single file which you could mail to someone. It requires Internet Explorer to view, but that is an acceptable constraint in many corporate workplaces.
The agent used for the export is shown below. This agent will work in both Midas V4.32 (to be released today) and Midas V5 (to be released soon).

This sample requires Midas 4.32 or higher.

AGENT: Export whole document to Web Archive (*.mht)
' *** Get the collection and cycle through each selected document
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
If collection.Count = 0 Then Exit Sub

Call MakeDirectory(EXPORT_DIRECTORY)

' *** Create a temporary document that is never saved, just for rendering
Set tempdoc = New NotesDocument(db)
tempdoc.Form = "temp Form"

Set doc = collection.GetFirstDocument
While Not (doc Is Nothing)
Set notes_rtitem = New NotesRichTextItem(tempdoc, "TempBody")
If doc.RenderToRTItem(notes_rtitem) Then
Set rtitem = New GeniiRTItem
Call rtitem.ConnectBackend(tempdoc.Handle, "TempBody")
If rtitem.IsConnected Then
If Left(session.NotesVersion, 9) <> "Release 5" Then rtitem.Everything.ConvertBitmaps
filename = EXPORT_DIRECTORY & PREFIX & doc.NoteID & EXTENSION
Call rtitem.ExportToMime(filename, |Content-Type: text/html; charset="iso−8859‒1"|, |charset="iso−8859‒1"|, _
|CSSBorders='Yes' MakeURLHotspots='Yes' charset="iso−8859‒1" ForceFontFace='Yes' AddNewlines='CRLF' RespectHiddenFormulas='Yes'
PreserveTabs='8' EvalHandle=|+CStr(doc.Handle))
Print "Exported '" & doc.Subject(0) & "' to " & filename
End If
Delete rtitem
Call tempdoc.RemoveItem("TempBody")
End If
Set doc = collection.GetNextDocument(doc)
Wend

' *** Throw away the unsaved temporary document
Delete tempdoc
Set tempdoc = Nothing

Rough transcript (used for Closed Captions as well):
This is Ben Langhinrichs from Genii Software with Part 1 of "Out of Notes", a series I am doing on taking structured data like this out of Notes in various ways.

The Curb Appeal database will be a sample database I'll release shortly. In it there are a number of real listings for houses in my area, sold by various agents and with a lot of the structured data you might see in a Notes database, from rich text to numbers to text.

Here we have the fields that are shown, a rich text field for the photo, and again rich text fields with bullet items down below. There's a fair amount of complexity to get out.

This is the challenge we face, how to take this out, either as structured columns, or in this case we are just going to do a snapshot.

If we look at the Listing form, we can see there are among the other fields, you've got computed images, which in this case is the agent's photo. And so this kind of thing also needs to come out. It's data that's not directly on the form, but is computed from the form. So we need to handle that sort of thing, as well as hide-when formulas. And we need to pull in the image resources that are necessary.

We're going to go to the Web Archive format. In that format, all this stuff will show because all the images will show, but you'll need to have, for instance, both the photo of the house which in each one of these is a different one, but also the photos of the agents.

So, if we look over here to where we exported to MHT, which is the Web Archive Format, it has all the pieces of information that you would expect it to have. It's a MIME format, so it is all in one file, and that's our snapshot.

I'm just going to go back here, and see that the format looks very, very close. We've worked a lot on fidelity to make sure that when you have a snapshot view, you'll see all the things the way they were intended inside the Notes document.

Thanks for watching, and stay tuned as further parts of the Out of Notes series show going to different formats and in different collections.



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' ")




MIDAS#6 Action Hotspots (Midas Rich Text LSX)


The Action Hotspots sample database shows how to use the Midas Rich Text LSX to create buttons, and other hotspots with formula language, LotusScript or JavaScript behind them. This simple video shows the database in action to help guide those who may be interested in the ability to create hotspots automatically, whether on documents or pages or forms. The database was originally created in 2003 for Lotus Notes 6 using Midas V3, but has been updated and tested with all versions up to IBM Notes 9 and Midas V4.32 and the upcoming Midas V5.00. The section of agent code creating LotusScript hotspots is shown below:
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 Action Hotspots sample db, or take a look at our many other sample databases at the Midas LSX Samples page.

This sample requires Midas 4.x or higher.

Const LSCRIPT = |MessageBox ("LotusScript: This is just a test, but you could have called an agent or done something else altogether")|
Const LSCRIPT_BUTTON = |Sub Click(Source As Button)
MessageBox ("LotusScript: Just a test, but could have done much more")
End Sub|

' *** Connect to rich text item with Midas
Call rtitem.ConnectBackend(doc.Handle, "Body", True)
rtitem.ActionHotspotFont = "Blue underline"

' *** Define the initial chunk you want to use and add whatever processing is necessary.
Set rtchunk = rtitem.DefineChunk("Everything")

' *** Add the LotusScript versions
Call rtchunk.AppendText("LotusScript Hotspots" & Chr(0), SECTION_TITLE_FONT)
Call rtchunk.AppendText("You can make an action hotspot which is a ", EXPLANATION_FONT)
Call rtchunk.AppendHotspot("Action LotusScript", LSCRIPT, "", "text hotspot")
Call rtchunk.AppendText(" or a ", EXPLANATION_FONT)
Call rtchunk.AppendHotspot("LotusScript Button", LSCRIPT_BUTTON, |TextFont='Red Default Sans Serif 8pt'|, "button")
Call rtchunk.AppendText(" or even wrap it around a graphic ", EXPLANATION_FONT)
Call rtchunk.AppendHotspot("Action LotusScript", LSCRIPT, "", " ")
Set rtHotspot = rtitem.DefineChunk("Inside Hotspot 6; Text 1")
Call rtHotspot.InsertResource("Image", "actn008.gif", "GraphicWidth=21 GraphicHeight=21")
rtHotspot.Text = ""
Call rtchunk.AppendText(Chr(0) & Chr(0), EXPLANATION_FONT)



MIDAS#5 Redact credit card numbers with REGEX (Midas Rich Text LSX)


This demo shows how to use the REGEX (regular expression) search & replace functionality in the Midas Rich Text LSX to find and redact credit card numbers in Notes rich text.

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 Credit Card Redaction with REGEX sample db, or take a look at our many other sample databases at the Midas LSX Samples page.

This samples requires Midas 4.x or higher.

' Connect to item and define chunk as everything
Call rtitem.ConnectBackend(doc.Handle, "Body", True)
Set rtchunk = rtitem.DefineChunk("Everything")

' Call RegexReplace method to redact Visa and MC card numbers
' To only find numbers with whitespace before and/or after, use
' \s instead of \D at the beginning and/or end of the first expression
Call rtchunk.RegexReplace("(^|[\D*])(4\d|5[1‒5]{1})\d{2}[ \\-]?\d{4}[ \\-]?\d{4}[ \\-]?(\d{4})([\D*]|$)", "$1xxxx-xxxx-xxxx-$3$4")

' Change the subject just to show it has been altered
' You would not usually do this in a mail database, of course
doc.Subject = doc.Subject(0)+" - redacted"
rtitem.Save




MIDAS#4 First Test of Midas in Notes browser plugin recorded (IBM Notes 9, Midas Rich Text LSX)


After my successful test of the Midas Rich Text LSX in the Notes 9 client (see previous lesson), I decided to try it out in the new Notes 9 browser plugin. So, on the day after IBM Notes 9 was released, I recorded my first test with the Midas Rich Text LSX in the Notes browser plugin. Again, it worked beautifully, though we learned a bit more from this test. It was not obvious whether or not an LSX (LotusScript extension library) would work in the browser plugin, but it clearly did. A future lesson may be necessary on deploying an LSX with the browser plugin.



MIDAS#2 Instant Reports in rich text (IBM Lotus Notes, Midas Rich Text LSX)





MIDAS#3 First test of Midas in Notes 9 recorded (IBM Notes 9, Midas Rich Text LSX)


The day after IBM Notes 9 was released, I recorded my first test with the Midas Rich Text LSX to see what happened. Simple answer: it worked beautifully.



MIDAS#1 Sort tables in Notes rich text (IBM Lotus Notes, Midas Rich Text LSX)





Copyright © 2014 Genii Software Ltd. All Rights Reserved.