Misc. Resources

Specified Mini-Lesson

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.

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)
Set doc = coll.GetNextDocument(doc)
If coll.Count > 0 Then
Call gcoll.ExportToEPub("c:\demo\xHelp.epub", "RenderWithForm='Yes' ")
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.

Copyright © 2014 Genii Software Ltd. All Rights Reserved.