Using Script Libraries

About this task

Script libraries can contain LotusScript, Java, or JavaScript. A script library allows you to store classes, functions, and variables for common use within an application. A script library is either a Client Library or a Server Library.

The scope of a script library is the current application. All scripts in a database can avail themselves of the LotusScript, JavaScript, or Java in a library in that database. However, the library is lost to scripts outside the database. For example, if a button in a document uses a script library and you mail the document to or paste it into another database that does not have the same script library, the script fails. If a script attempts to use a library not in the current database, the error message, "Error loading USE or USELSX module" displays.

Note: In release 8.0, Domino web services were made available to applications through web service enabled script libraries. With release 8.5, web service consumers are a separate element from script libraries.

To create a script library from the Applications Navigator

Procedure

  1. In the Applications Navigator, expand an application name.
  2. Double-click Code > Script Libraries.
  3. Click one of the following buttons depending on the type of library you wish to create: New LotusScript Library, New JavaScript Library, or New Server JavaScript Library.
  4. Do the following in the New LotusScript Library, New JavaScript Library, or New Server JavaScript Library dialog box:
    • Type a name for the library. The name must be unique and must conform to the naming rules for the operating system.
    • Select the desired application from the Application drop-down list.
  5. Click OK.

To create a script library from the menu

Procedure

  1. Choose File - New - <type> Script Library. Choose one of the following types:
    • LotusScript Library
    • Javascript Library
    • Java Library

    The Programmer's pane displays the empty script in the Work pane.

  2. Do the following in the New LotusScript Library, New JavaScript Library, or New Server JavaScript Library dialog box:
    • Type a name for the library. The name must be unique and must conform to the naming rules for the operating system.
    • Select the desired application from the Application drop-down list.
  3. Click OK.

Results

Note: For more complete information on using script libraries in Domino Designer, refer to the Domino XPages User Guide help plugin that ships with this plugin. To access this information, select Help-Help Contents from the Domino Designer menu to launch the Eclipse Help System. Plugins are accessed from the left-hand Contents panel.

See the following topics for instructions on incorporating a library:

To access an existing script library

Procedure

  1. From the Applications Navigator, expand Code-Script Libraries.

    A list of script libraries displays in the design element list.

  2. Select the script library you want to view.

    The script library appears in the Programmer's pane.