With the multistage development environment in place and design templates established, its time to discuss deployment of the database. This is typically a process whereby the database is announced and users begin to use the database. There are several key steps to consider when deploying a database application. This section outlines the general process. It also includes instructions for creating an "install" button and a "connection document" button. These buttons can be created in an email and included in an announcement message. Lets start by reviewing the process and then proceed to the instructions for creating the two buttons.
Ensure that the correct database design has been tested and applied to the production database environment. Consider using rudimentary checks to verify that all of the required configuration files are in place and that the production database generally appears to be working as intended.
Import data into the database (if applicable). Be sure to test this process and verify that the data imports correctly in the Sandbox prior to importing data into the production database. See Chapter 18, "Data Management," for additional information pertaining to data imports.
Enable access to the database through the ACL. Ensure that all the appropriate users have been included in the access groups and give the correct permissions in the ACL.
Create and distribute the "application install" and "server connection document" buttons (as described next). Announce the new application and include both buttons to enable quick and easy access to the application.
This routine illustrates how to create a button that adds the database icon to the users workspace and launches the application. The button can then be added to an email and sent to anyone who is authorized to access the database. This method provides a user-friendly alternative to a database link.
If you manage or distribute a large number of database applications, consider storing a copy of each database install button in a document or saving them in a "stationary note" in your Lotus Notes mail database. This will enable you to copy and paste the buttons into an email for quick distribution as needed or requested.
To implement this solution, complete the following steps.
Create the button. Using your Lotus Notes client, create a new memo. Place the cursor in the body of the memo and select the Create > Hotspot > Button menu options.
Configure the button. Give the button an informative title (e.g., Install My Database). Next, add the following formula in the Programmers pane. Be sure to replace SERVER, PATH, and DATABASE with valid values that reference the database to be announced. Be sure to separate the path and database with double backslashes because the initial backslash is treated as an escape character.
server := "SERVER"; dbpath := "PATH\DATABASE.nsf"; @If (@Command([FileOpenDatabase]; server : dbpath; ""; ""; "1"); @Success; @Prompt([Ok];"Warning.";"An error was encountered. Please contact the administrator."));
There are two primary error messages that can be produced when using this routine. The most common message is the "Unable to find path to server" message (see Figure 20.11). This usually occurs when the Lotus Notes client is unable to locate the destination server.
This message is most likely not related to the formula provided in this section and can also occur when a user clicks on a database link. In most cases, creating a server connection document will correct the problem. Well talk more about the server connection document in the next section.
The second error message covers all other error messages and is produced by a routine (see Figure 20.12). The message provides an opportunity to deliver a customized error message to the user when an error is encountered. If you have a help desk phone number or email, you may want to include it in the message.
The install button is now complete. Consider including a Connection Document button (as described in the next section) before sending the announcement. Otherwise, the button is ready to be sent.
Connection documents are used to store connection information for Domino servers on the network. Creating a connection document will often resolve the "Unable to find path to server" error message. To help users connect to or locate Lotus databases, you can create a button that automatically adds a connection document to the users Personal Address Book.
When the user clicks the button, the code first opens the users local address book and searches for the server name in the Connections view. If the document is found, the user is asked whether he or she would like to continue with the update. If the user selects no, the transaction terminates. Otherwise, the existing document is updated. If no existing document is located, then a new document is established and saved.
To implement this solution, perform the following steps.
Create the action button. From your Lotus Notes client, select the Create > Hotspot > Button menu options to add a button to a memo.
Configure the button. Give the button an informative title (e.g., Connect to Server). Next, change the Language Selector from Simple action(s) to LotusScript and insert the following in the Click event. Be sure to replace SERVER with the Domino server name and IPADDR with the Internet Protocol address (or fully qualified domain name) assigned to the Domino server.
Sub Click(Source As Button) Dim w As New NotesUIWorkspace Dim s As New NotesSession Dim db As NotesDatabase Dim doc As NotesDocument Dim continue As Boolean Dim server As String Dim address As String Dim view As NotesView ---------------------------- Specify the server name and IP address ---------------------------- server = "SERVER" Domino server name e.g. NOTES123 address = "IPADDR" IP address e.g. 22.214.171.124 ---------------------------- Set object values to connect to the PAB ---------------------------- Set s = New NotesSession Set db = s.GetDatabase( "", "names.nsf" ) Set view = db.GetView("Connections") Set doc = view.GetDocumentByKey( server, True ) ---------------------------- Determine action if existing doc is found ---------------------------- Continue = True If Not(doc Is Nothing) Then If Msgbox ("Update existing connection?", 4, "Continue?")= 7 Then continue = False Msgbox "Transaction cancelled" End If Else Set doc = New NotesDocument( db ) End If ---------------------------- Create the connection document ---------------------------- If continue Then doc.Form = "Local" doc.Type = "Connection" doc.ConnectionType = "0" doc.ConnectionLocation = "*" doc.Source = "*" doc.LanPortName = "TCPIP" doc.PortName = "TCPIP" doc.Destination = server doc.OptionalNetworkAddress = address doc.PhoneNumber = address doc.Save True, True Msgbox "Connection doc created for " + server, ,"Success" End If End Sub
An Introduction to the Lotus Domino Tool Suite
Getting Started with Designer
Navigating the Domino Designer Workspace
Domino Design Elements
An Introduction to Formula Language
An Introduction to LotusScript
Fundamentals of a Notes Application
Reference Library Applications
Design Enhancements Using LotusScript
Design Enhancements Using Formula Language
Miscellaneous Enhancements and Tips for Domino Databases
Application Deployment and Maintenance
Appendix A. Online Project Files and Sample Applications
Appendix B. IBM® Lotus® Notes® and Domino®Whats Next?
Lotus Notes Developers Toolbox: Tips for Rapid and Successful Deployment
Authors: Mark Elliott
Similar book on Amazon
XPages Portable Command Guide: A Compact Resource to XPages Application Development and the XSP Language