Hiding a LotusScript Library

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.

Warning

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.

Step 1.

Open the database in the Domino Designer client.

Step 2.

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

Step 3.

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

Step 4.

Confirm that the text file was created and that it contains the desired source code.

Step 5.

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.

Step 6.

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.

%Include "C:PATHFILENAME.LSS"

Step 7.

Select the Tools > Recompile All LotusScript menu options to compile the database and incorporate the source code back into the design.

Категории

© amp.flylib.com,