Examples: Domino objects

These examples are on a page that contains one Java applet whose source code is:

import lotus.domino.*;
public class dummy extends AppletBase(){}
  1. This onClick event handler for a button uses the Domino objects to display the current platform. The code gets to the Domino objects through the first applet in the current document; this applet must use the Domino objects. The objects employed are AppletBase.openSession and Session.getPlatform.
    var session = window.document.applets[0].openSession()
    alert (session.getPlatform())
  2. This onClick event handler for a button uses the Domino Objects to get the context for the current document. This code works only on a Notes client.
    var s = window.document.applets[0].openSession()
    var x = window.document.applets[0].getContext(s)
    alert (x.getServer())
    alert (x.getDatabase())
    alert (x.getDocument())
  3. This onClick event handler for a button uses the Domino Objects to display the title of the current database and the value of each Subject item. The field thisDb is a computed field containing "@Subset(@DbName; -1)" as the value. For browsers, Generate HTML for all fields must be selected in the Form Properties box.
    var s = window.document.applets[0].openSession()
    var db = s.getDatabase("", window.document.forms[0].thisDb.value)
    var dc = db.getAllDocuments()
    var t = ""
    var doc = dc.getFirstDocument()
    while (doc != null) {
        t = t + doc.getItemValueString("Subject") + "\n"
        doc = dc.getNextDocument(doc)
    }
    alert (t)