This section illustrates how to hide a LotusScript library from a database design. This is sometimes done to protect proprietary or sensitive code. When implemented, the library is no longer visible or accessible in the database design. All code is stored externally to the database in an ASCII text file that is referenced at compile time. Code that is managed in this fashion cannot be viewed in the Designer client or traced from the Lotus Notes client.
Its important to note that because the code is stored and managed externally to the Designer client, this means that the syntax checking, colors for LotusScript keywords, and the "type-ahead" features incorporated into the Designer client will not be available. Using this approach, the source code will be managed in a text editor such as Microsoft Notepad.
Be sure to back up and store the LotusScript source code in a secure place when exporting it from the database design. If it becomes lost or corrupt, you will have to rewrite it from scratch. Depending on the complexity of the source code, this could prove to be a virtually impossible task and may also prevent future support for the database design.
To implement this technique, complete the following steps.
Open the database in the Domino Designer client.
Locate and open the LotusScript library. Select the File > Export menu options. When prompted, provide the file name and include the .lss extensionsuch as LotusScriptWebLibrary.lss (see Figure 19.19). Click Export to continue with the process.
Figure 19.19. Export LotusScript library dialog
Select the scope of the exportsuch as All objectsand click OK to export the source code to an ASCII text file (see Figure 19.20).
Figure 19.20. LotusScript Export Options dialog
Confirm that the text file was created and that it contains the desired source code.
After you have confirmed that the library was exported and that the text file contains all source code, remove all LotusScript from the library, but do not delete it from the database design. Remove all functions, subroutines, and associated code from the Initialize, Declare, and other events. Although the code has been removed from the Designer client, you must retain the library for those design elements (forms, views, etc.) that reference the library through the Use Library directive.
Add the following statement to the Declare event in the LotusScript library. This should be the only statement in the section where PATH represents the directory location and FILENAME represents the name of the LotusScript export file from Step 2.
Select the Tools > Recompile All LotusScript menu options to compile the database and incorporate the source code back into the design.
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
Professional Struts Applications: Building Web Sites with Struts ObjectRelational Bridge, Lucene, and Velocity (Experts Voice)