Eighteen minutes to a searchable Designer Help
Tue 29 Oct 2013, 09:25 PMTweet
by Ben Langhinrichs
We released Midas LSX Version 5.00a with a few bugs fixes, and with the Import from Zip functionality turned on. To test it, I looked at the Eclipse help packages where all the Designer help has gone. These are packages in zip files, with an XML table of contents. The code I used looks like this after I traverse the XML files with the standard classes, then for each .html file in the Zip file, it creates a blank document, sets the form and such, then imports it. Update: You can get a copy, just see this post.
Call rtitem.CreateBackend(doc.Handle, "Body", True)
Call rtitem.Everything.AppendHTML("File", srcfile, "Package='"+zipfilename+"' StoreMetaData='Yes' BasePtSize=11 TitleField='Subject' ")
The srcfile is something like LSAZ_WORKING_WITH_EXTERNAL_C_LANGUAGE_FUNCTIONS.html which comes from a toc.xml such as the one below, except with thousands of entries:
The HTML file is never unzipped to disk, but simply read from the zip file along with any images, the CSS stylesheets and so forth that are also part of the zipped package. The StoreMetaData='Yes' parameter simply stores a field for each meta tag in the HTML file, such as:
<meta name="DC.Title" content="Calling external C language functions" />
which will then create a field called DC.Title with the value "Calling external C language functions", thus allowing you to script based on the title, keywords, etc. The BasePtSize=11 says that all relative point sizes and default point sizes should be 11pt, so when the CSS says that the body should be 0.8em, that is 8.8, which rounds to 9pt, the standard for the Help database. The TitleField='Subject' says that the HTML title tag should be saved in the Subject field.
All that and a bit of script to update the fields from the meta data, and in 18 minutes my Domino Designer has 11997 nicely formatted and linked together documents instead of 297.
But you could play with all that if you had an evaluation license.
Copyright © 2013 Genii Software Ltd.
What has been said: