All about Lotus Domino Development (AaLDD)

Application support - Which tool do you use?

Posted in Applications, Sandbox, lotus notes by quintessens on March 11th, 2008

My (new) boss has great faith in me so he has made me responsible (yippie) for one of our key LN applications for communicating withing the organisation (an application for publishing documents on our intranet).

Since I am new & fresh & (still) eager in the organisation I am looking for an application that can support me in this task. Mainly the application should be able to store communication (emails), documentation (with or without attachments) and maybe a FAQ section.

No fancy stuff, please just an application for the Notes client.

My search on OpenNTF did not give me an answer in my quest. Therefor my question to you:

“which tool do you use for giving support on LN applications?”

Pagination - Examples and good practices

Posted in Applications, lotus Domino by quintessens on November 19th, 2007

Structure and hierarchy reduce complexity and improve readability. The more organized your articles or web-sites are, the easier it is for users to follow your arguments and get the message you are trying to deliver. On the Web this can be done in a variety of ways.In body copy headlines and enumerations are usually used to present the information as logically separated data chunks. An alternative solution is pagination, a mechanism which provides users with additional navigation options for browsing through single parts of the given article. Parts of the article are usually referred to by numbers, hints, arrows as well as “previous” and “next”-buttons.

Search engines almost always use pagination; newspapers tend to make use of it for navigation through the parts of rather large articles. And there are situations when pagination is also necessary for weblogs. Additional navigation can simplify the access to some site pages — e.g. make it easier for users to browse through the archives of the site.

In most cases pagination is better than traditional “previous - next” navigation as it offers visitors a more quick and convenient navigation through the site. It’s not a must, but a useful nice-to-have-feature.

The above article on Smashing Magazine shows that in my working example there are enough points for improvement:

example

for example:

example

example 2

Update: ‘Warning before…’ - Demo

Posted in Applications, JavaScript, Prototype, Show N Tell Thursday, lotus Domino, sntt by quintessens on October 20th, 2007

I have uploaded a demo application, yuk Notes 8 vocabulary, here for download. The default frameset contains a form. Fill in some data in the fields and try to leave the form. A following warning will show up:

demo screen

Enjoy!

Ps this database was saved with the Notes 8 Designer. Can anyone tell me where the ‘Save’ smarticon went? I could not find it while working on the form. Using the File-Menu-Save really is annoying?

While kicking Notes 8: what the hell must that ‘Preview in Web browser’ icon look like? Notes 8 smart icons: BAD!!!

Export to Excel wizard

Posted in @Formula, Applications, LotusScript, Show N Tell Thursday, lotus notes, sntt by quintessens on September 27th, 2007

I was asked to take a look at an existing application, and come up with suggestions to improve performance.

In a first look I found that most of the views, especially the default to be opened view, were set to refresh the index automatically… you can imagine how much the users love to start working with this application which has readers fields on all documents (NOT!).

When I asked were all the views were needed for, I got as reply: to have it in a format we want to make graphics in Excel.

Okej, why not delete these ‘views to be exported for Excel’ and replace them with an export functionality?

export start button

So what where the needs?

  1. a set of fields for different types of forms that should be manageble by the application manager
  2. an export-mechanism to Excel which should be easy to understand for end-users and give them the opportunity to create customizable exports.

1) Export profiles

In order to create so-called Export profiles for different Notes forms I needed an additional form (ExcelFormExport) where the administrator can:

  • select the desired form for export (FieldA)
  • select the form-fields that should be available for export (FieldB)

This last field is being calculated when FieldA is being exited:

Sub Exiting(Source As Field)
 Dim workspace As New NotesUIWorkspace
 Dim uidoc As NotesUIDocument
 Set uidoc = workspace.CurrentDocument 
 fieldvalue = Lcase(uidoc.FieldGetText(”Tx_FormSelected”))
 Dim doc As NotesDocument
 Set doc = uidoc.document
 If fieldvalue <> “” Then
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Set db = session.CurrentDatabase  
  Forall form In db.Forms
   If Lcase(form.Name) = fieldvalue Then
    If Isempty(form.Fields) Then
     Messagebox form.Name & ” has no fields…”
    Else
     ’collecting the form fields
     Dim arrFieldNames() As String
     Dim iCount As Integer
     iCount = 0     
     Redim arrFieldNames(0)
     Forall field In form.Fields      
      Redim Preserve arrFieldNames(iCount)
      arrFieldNames(iCount) = field
      iCount = iCount + 1
     End Forall     
     Call doc.ReplaceItemValue(”Tx_FormFields”, BubbleSort(arrFieldNames))     
     Call uidoc.Refresh()     
    End If
    Exit Sub
   End If
  End Forall
  Messagebox “The form “”" & formNameIn & “”" does not exist”
 End If
End Sub

Bubblesort is a function which sorts the array with fieldnames:

Function BubbleSort(vtList As Variant) As Variant
 Dim tmpValue As Variant
 Dim x As Integer, y As Integer 
 If Ubound(vtList) = 1 Then
  BubbleSort = vtList
  Exit Function
 End If 
 For x = 0 To Ubound(vtList)
  For y = (x + 1) To Ubound(vtList)
   On Error Resume Next
   If vtList(x) > vtList(y) Then
    tmpValue = vtList(x)
    vtList(x) = vtList(y)
    vtList(y) = tmpValue
   End If
  Next
 Next 
 BubbleSort = vtList 
End Function

Luckily I could make use of a solution from my colleague Tomas Ekström (his so-called ‘tablewalker’) which made the selection of fields and giving them for the end-user understandable ‘labels’ in the wizard:

export profile form

The next step was creating a dialog between the available ‘Export profiles’ and the Export to Excel solution written by Ken Pespisa.

 dialog for selection source

In order to display the ‘Export profiles’ in the dialoglist I had to re-write Ken’s solution a bit. I advice you to use Ken’s standard solution in stead.

Well, the rest of this export wizard is just following Ken’s work.

 select fields for export dialog

What I tried to achieve with this solution is:

  • having an easy way for an administrator to define ‘Export profiles’ based upon information on Notes forms.
  • presenting an understandable interface for the end-user that enables to create customizable exports to Excel
  • get rid of a large set of nasty Notes views!

A demo you can download here.

Printing documents from a view (web)

Posted in AJAX, Applications, JavaScript, Show N Tell Thursday, lotus Domino, sntt by quintessens on July 12th, 2007

I almost have my summer-break so in order not to forget what I have been doing lately here a summary of my activities on development: 

Recently I have been working on some projects which all had one thing in common: ‘printing documents from a web browser’.  In this article I describe you my solution how provide a funtion to print (multiple) documents from a web view, with maintaining the often used previous-next navigation in Domino views.

The function is based upon the idea of a cookie. In the cookie you write the document unique ID of the document you want to add to your print selection, and at the end, the point that the user want to actually print the selection, all documents will be collected via an AJAX request and added on a new window.

I have no idea what the performance impact are and have not tested the application well in IE, I assume there might be some considerations using different browser types and versions.

print expl 01

In the view for each document the user has the option to ‘add’ this document to his ’selection’. The selected document will be presented in a DIV below the view. Also the icon will change from blue to a more inactive ‘purple’:

print expl 02

In the example above the user has selected 2 documents, which can be deleted in 2 ways from the selection:

- document one by one

- all documents at once

print expl 3

Att the bottom the print icon uses a JavaScript function that makes an AJAX request for each document UNID in the cookie and writes the result (HTML) to a new window:

print expl 4

Since the whole idea is based upon a normal default Domino view and it support the option to use the previous-next navigation I think this approach should be easy to implement in most applications.

A sample of the application can be found here. Since this was only one of my approaches to enable printing Notes documents from a webbrowser there is more to come soon.

Now I can really start backpacking at ease :-)

Demo integration Lotus Notes and CardScan

Posted in Applications, CardScan, lotus notes by quintessens on June 14th, 2007

This action was already for a long long time on my desk but now I found some spare time finally.

In a previous posting I wrote how I created an Notes application that is able to import information collected via a CardScan device into a Lotus Notes aplication.

Well I have prepared a demo and is available for download.

The application is tested on a local machine and I do not inted to give support on questions, but for improvement suggestions I am always open.

How to get started?

  • download and unzip the demo to your Notes data directory
  • if possible sign all design elements
  • install the CardScan software and run through the installation process (including calibaration)
    • 1 Note: depending on which version you are using but in the latest version (I believe they call it version 8) you have to disable the option that it the software should detect cards automatically.
  • after the installation open the designated frameset for web-access in your browser and start testing!

 disable this setting

I have updated the interface to a more modern look, inspired by the first screenshots that where available for Quickr (I believe). Mostly the application is being used on shows so a fancy design was very appreciated.

Yes even the database icon got some attention:

database icon

When opening the frameset you will be presented this screen:

screen number 1

In this screen you have 2 options, collect visitor information with or without use of the CardScan device. The logic behind it is that you can open 2 similar form, one has the webqueryopen event that initiates an agent that synchronize the fields CardScan has found on the business-card and the fields on the form.

This synchronisation can be done on the database profile document in the application. Here you can select which fields should be mapped:

field mapping

Let’s continue with the process. After selecting an input device you will be presented a form, and if you selected to use the CardScan device the mapped fields will be filled in with information found on the business-card:

visitor input form

If a problem occured it will be presented to the screen as displayed in the example in red. There is a button available to scan the business-card again, in case there where problems with the first attempt.

We have noticed that the ‘hard light’ on some shows give problem with the scanning devices…

After filling in the information form a confirmation screen will be presented with a link to return to the startscreen:

confirmation message

So basically that’s it!

Some remarks after experience working with this solution:

  • The hard light at some shows is really a problem, I do not know how to solve it. The only solution I have is not to place the scanner in the most lightest spot.
  • According to CardScan support it is not possible to get the information into a different Notes application rather than the names.nsf file but you will see that it is possible.
  • The code that is being used to make the call to the CardScan device is actually REALLY old. It dates from the period that CardScan was officially called Corex I believe. Allthough the versions (presentation?) for the scanning devices have changed the last period of years, the code is still working solid. Read the developerkit that is available (but cost money).
  • Newer languages as Java probably have much better capabilities to talk with the CardScan device, but I am not a Java developer.
  • The icons used are coming from free icons libraries.

Please let me know if you have found any technical improvement!

One final remark:

I have ‘collected’ some CardScan devices during the years of support, if you would be interested in one I figure we can come to a ‘nice price’.

Demo integration Lotus Notes and activePDF

Posted in Applications, activePDF, lotus Domino, lotus notes by quintessens on April 27th, 2007

I received some questions on a previous article on integrating Lotus Notes / Domino with activePDF.

A quick wrapup: yes via LotusScript you can make a connection with activePDF’s server products (in this case I use activePDF server and activePDF Toolkit professional which you can download for evaluation here). With activePDF you can create, stitch, write on PDF’s. Lotus Notes / Domino we use as web-engine, configurator & database to store created PDF’s for furture handling.

In the demo itself I only demonstrate how to write a text-line to a PDF but in the original article you find more examples how to add text area’s, pictures & drawings to a PDF.

How to get it running?

  • Copy the database to your data directory and open the database in Notes.
  • In the ‘Edit DB Settings’ menu-link (which you see if you apply ‘Enforce consistant ACL on all replicas’) you enter a correct path where you want to extract files to.
    • in this path we extract the template PDF we use with already added a nice background
    • this path we also create new PDF’s in which we later delete when we embed them in a Notes document
  • In the DB Settings profile document we also specify which fonts are available we can use in the card profile document. The card profile documents are a more or less the card templates the user can create a PDF from.
    • In the database there is already a card profile document created so you can use that in the demo.
  • Open the database in a browser and ‘F-CardRequest?OpenForm’ in the URL after the database filename.

This is what you will be presented:

card request form

After filling in the requested fields a PDF will be created and presented to you. The result might look like this: (card sample PDF).

I have uploaded the database somewhere and if everything goes you right you should be able to download it here. Please let me know if you have any difficulties opening the location.

So what are possible business solutions?

Solutions I have worked on are:

  • a business cards application
  • a poster / leaflet application where dealers can create personalized marketing material based upon defined corporate standards
  • an application to print out certificates after a workshop
  • ‘new baby born’ cards

Well basically let your creative imagination run free :-)

The nice part of Lotus Notes is that you can distribute the (Notes) documents containing the PDF or add an ordering form to it.

The downpart is that if I understood it correctly activePDF uses a ‘bottom up’ approach so it locates a x-y location from the left bottom of the PDF and writes the information to it. It does not count if the content of this information oversizes the bottom of the PDF file. So it will just keep on writing one one single PDF file.

Integrating CardScan into your Domino applications

Posted in Applications, CardScan by quintessens on November 6th, 2006

product example 

CardScan is very handy scan-device for managing your business-cards on your computer. In order to let Windows recognize the product the software delivered with the product installs a driver and a program to manage your scanned cards.

Via the Intellisync software you can replicate your contacts to your local address book. The support site says that you can ONLY replicate to the names.nsf file. Other database filenames it will not accept.

But what if you want to use the scan-device in your Domino application, for example a database that collects first contact details for your CRM application?

Okej, you COULD rename your real names.nsf database and name your CRM application names.nsf and give the form that collects the user details the name Contact. But you DON’T want this because this would screw up your initial Notes setup.

cssdk32.dll

So what are your other options? The CardScan software did install a DLL file, right? Why not use the same DLL that the CardScan program uses in your Domino application?

CardScan Software Developers Kit

The CardScan Software Developers Kit (SDK) is a product for software developers. It provides programmatic access to CardScan’s business card recognition capabilities. Using the SDK you can control the Corex scanner, acquire card images, process them one at a time or in batch, and retrieve the results sorted into fields like Name, Title, Company, Street Address, City, State, and Zip Code.

Example initialization in LotusScript

Const Cardscan_SUCCESS = 1          

‘ 1 = Operation succeeded

‘ Initialize the dynamic link library and register the client application:

Declare Function Cardscan_Init Lib “cssdk32.dll” ( RTKaddress As Long)  As Long

‘ RTKaddress = address to receive RTK handle

Dim intReturn As Integer

intReturn = Cardscan_Init(RTKaddress)

If intReturn <> Cardscan_SUCCESS Then

  Exit Sub

End If

Integration Domino and activePDF

Posted in Applications, activePDF by quintessens on October 22nd, 2006

This document will describe briefly the usage of activePDF within a Lotus Domino application. The purpose of this document is to give you an introduction about integrating both software products and give you an impression about the possibilities.

For more information about both products visit the official websites for IBM Lotus software and activePDF.

Where to start?

Domino is a great rapid development- and (web) server softwareproduct to capture and display text and rich text information from and to users.

Rich text (images, pdf’s) in Domino should be made ready for display. There is no dynamic composition.

activePDF is a great tool for creating printable files and is based on single line commands. You can add texts and images, drawing boxes and stitching pdf files.

Especially the activePDF Toolkit is the Swiss Army Knife for PDF - virtually any PDF manipulation task can be automated through Toolkit’s robust API. With activePDF Toolkit you can: 

  • Apply watermarks and stamp images and text into PDF files.
  • Merge multiple PDF documents into a single PDF file, adding bookmarks for easy navigation.
  • Dynamic PDF form-filling - populate PDF forms with database data and generate form fields on the fly.
  • Detect PDF tampering through Toolkit’s fingerprint technology.
  • Generate over 20 standard barcode types without requiring third-party utilities or individual barcode fonts.
  • Add dynamic headers, footers and page numbering to PDF documents.
  • Convert to PDF from over 40 image types on the fly and embed Flash® files within PDFs.
  • Digitally sign PDF files and secure documents through PDF encryption.

Would combining these two worlds result in a best of both worlds: dynamically created digital files ready for printing?

The idea

The idea is to use Domino as the tool that manages the integration of both products.  Via notes documents that describe all the links and commands to activePDF the configuration is defined.

Domino is also the engine that captures the user preferences (which template, selections) and user information entries (text lines)  which will be presented in the final result: a user customized PDF.

Everything will be presented within a web site, which is also based upon Domino.

The case

In this case I created a Domino application that enables the users to create highly modifyable leaflets and send their creation as a PDF file with high resolution to a printorder database. From that database the orders could be easily transferred to a que on a professional digital printer. 

The setup - activePDF

I installed the activePDF software on the same machine that also operates the Domino server. If you have business critical tasks running on that machine I would advice you to look for alternatives, you never know. But since you probably start working on a test-server…

The setup - Database profile document

I have one database profile document to configure the application within the Domino environment. The document stores information like:

  • an extract folder where to extract the initial template PDF’s
  • a preview folder where to store the PDF’s that are generate for display (low resolution)
  • a final folder where to store the high resolution PDF’s that will be embedded in a new notes document (a printorder document)
  • location of a batch program that cleans up all the folders scheduled
  • location of the database of the printorders database
  • ectetera

Note 1: activePDF works with picking and storing files on a (window) directory structure. Therefor we need to declare where these files can may be created or can be found.

Note 2: the aim for this project is to generate more printorders. The result of a visit is preferably a generated PDF file that the user wants to place for a printorder. This printorder we place in a different Notes  application. Describing the process of placing the order into a second database is out of the scope of this document.

Note 3: everything is presented to the user via a webinterface. How the website is set up and how the website elements are implemented within the Notes application will also not be described in this document.

The setup - Leaflet profile

Since the application is a corporate application and users are mostly not aware of the corporate guidelines I created a set  of predefined leafets. This also saved the users time, because mostly the part they want to have personalised where the textboxes and the graphical images. All the predefined templates where Notes documents.

Elements on a template:

  • a heading
  • a single-line subheading
  • a multi-lines subheading
  • a main image
  • thumbnail images
  • company logo
  • multi-lines text boxes
  • drawings (boxes, lines, etcetera) with activePDF Toolkit

Based upon a template one or more of the elements described above appeared.

Basic user navigation

When a user entered the site they have the following options:

  • directly create a new PDF file
  • view some prefined leaflets based upon the various templates
  • view predefined leaflets created by others (with the option to re-order the PDF)
  • login and visit the uses history (hoping this will result in some additional re-ordering of previous work)

Creating a new PDF file

Since this is the most exciting part of the process  I will only describe this part of the order process. When a user opens a new ‘createPDF’ form he can select from which template he wants to create a personalized PDF.

After selecting a template all the possible elements on the template are being displayed and for each element (a subform) the user has the option to edit it via text-boxes or selecting graphical material (images). When desired the user can uplaod his own graphical material.

When the user thinks he is done he can push a ‘preview’ button and a PDF file in low-resolution (for saving bandwidth) is presented. If the user is not satisfied with the result he can return the ‘createPDF’ form and improve his entries. When he is finaly satisfied the user can select an ‘order’ button and the user is asked to register for the order process or to login to work with saved user information. What a charm!

Into the technique

Important things you need to know about activePDF:

  • activePDF works with single command lines. Via lotusscript we can direct activePDF to perform certain actions.
  • Because the application runs in a website the steering of activePDF is being done via agents that run on webquerysave or webqueryopen events. Via loops or conditional statements we can make the command lines repetitive as much as we like.
  • activePDF works on X and Y coordinates which are from bottom left to upper right. This is important in order to place the design elements such as text and images correcly.
  • activePDF is not capable to calculate the distances between elements. For example: it cannot read the end position (y coordinate) of a multi-line textbox. Therefore if we would like to append an image on the bottom of a multi-line textbox dynamically this is not possible.

Example opening an ActivePDF session

In order to be able to work with activePDF via Domino we need to create a session and define activePDF as a new object: 

Set varPDF = CreateObject( “aptoolkit.object” ) 
varPDF.OutputPageHeight = intPaperHeightRec
varPDF.OutputPageWidth = intPaperWidthRec 
Call varPDF.OpenOutputFile( strPDFName )

  • first we start a session
  • declare the width and height of the output PDF (settings defined in a leaflet template document)
  • the variable strPDFName contains the windows directory reference and a filename with .pdf extension.

Example inserting an image

Call varPDF.PrintImage( strImageToAttach, intX, intY, intHeight, intWidth, 1)

  • via the PrintImage statement an image will be attached.
  • StrImageToAttach is a variable that can be a reference to an image from the image-bank that is within the application or an image that the user has uploaded.
  • IntX and IntY are the x and y start-coordinates of the image
  • IntHeight and IntWidth define the width and height of the image

Example inserting a text

Call varPDF.SetTextColor(strColorRed,strColorGreen,strColorBlue,strColorGrey) 
Call varPDF.SetFont( strFontName, intFontSize)
Call varPDF.PrintText( intX, intY, strPrintText )

  • via the SetTextColor statement we set the color of a text, this is done in RGB values. We can also add a gray-scale value.
  • via the SetFont we set a font type. The type of the font must be installed on the machine
  • via PrintText we actually add the text, in the variable strPrintText we have the user’s input

Example inserting a multi-line text

Inserting a multi-line text is pretty similar to inserting a single text line. You declare the font color, type and size. Only the second line differs:

Call varPDF.PrintMultilineText ( strFontName, intFontSize, intX, intY, boxWidth, boxHeight, strPrintText, 0)

For the multi-line textbox you extra declare the width and height of the textbox.

Some conclusions

Indeed activePDF and Domino can work together! Still there is surely something missing like a 100% free editor function for users like I have seen in several Flash applications. This would allow the users to add text and images, as much as they want, and where they want.

Nevertheless you can facilitate for your users the possibility to create high-end, print-ready files according to the guidelines and procedures within your organization.

The fact that activePDF cannot interact on the appearance of elements as result from user data entries (for example an image on the bottom of a multi-line textbox) makes it not a flexible tool.

Also the fact that data must be send back and forward from the user to the server and vice versa makes it not preferred solution for applications with many users.

Nevertheless with the buildup experience of the two software products it is possible to create in a short period of development-time a fully web-based, user-friendly, attractive, adjustable, maintainable solution (thanks to Domino) for dynamically creating high-quality, printable image files (thanks to activePDF) according to rules that are setup on behalf of corporate guidelines!

Demo

Unfortunately this website is not a Domino based weblog. Unfortunately this weblog is being served on a public server. This makes the demonstration of some solutions not possible.

However if you are interested in more information, screenshots or an example application please contact me at info@quintessens.com.

Applications I have worked on are:

  • a generator for business cards
  • a website to create leaflets / posters

If you have experience with working with the two worlds I am very interested to share our experiences!

Thank you for reading. 

KR // Patrick