Domino Designer Features for J2EE Development

     

Domino Designer is the development tool component of the Lotus Notes/Domino product suite. For many developers, Designer is and has been the primary tool for application development in their enterprise. It provides the necessary ease of use features for rapid application development (RAD) around the Notes database model, and allows for the addition of sophisticated programming control to provide almost any degree of automation required. Developers can program Notes database function using the Lotus Formula language, a set of parameterized functions; LotusScript, a Visual Basic-like script language with object-oriented features; or Java and JavaScript.

Designer is a mature product, having its origins with the first Notes client/server offerings from Lotus and growing with the Domino family under the IBM/Lotus unbrella to its current version with Domino R6. This growth, from a tool to code Notes @Formula language, to Lotus Script, to HTML, to Java, and now with support for XML and JSP tags, follows the path of application evolution, from Notes client-centric, to Web accessible, to J2EE and Web service-oriented.

A Brief Look at Domino Designer

To get a feel for what Designer offers Web application building, let's take a brief look at how it is used. Needless to say, an exhaustive presentation of Designer function and features is beyond the scope of our book, and there are many references you can go to for this level of detail. (One in particular is the IBM Redbook, "Domino Designer 6: A Developer's Handbook," SG246854, available at http://www.redbooks.ibm.com/redbooks/SG246854.html.)

Looking at a typical Designer layout in Figure 8-5, we find the following features:

  • A Bookmarks View pane (the left-most frame) shows the Domino databases recently opened in Designer. The active database expands to a Navigator view, which shows the the Domino design elements within the database. For example, under the Forms branch in the MusicLib.nsf database, the Library Item form is shown.

  • The Editor pane (the blue shaded pane containing the form contents) displays the contents of the design element being edited.

  • The Programmer's pane (the two frames below the editor pane) allows the entry and editing of code associated with the design element. The left side of this pane shows the objects or events and reference information available for the language being used. The right side is where code is entered and edited. The code can be Lotus @Formula language, LotusScript, JavaScript, or Java (depending on the type of event or where the element is intended to run ”for example, in the Notes client or in a Web browser).

Figure 8-5. Domino Designer R6.
graphics/08fig05.jpg

Using these views and the actions and tools available in Designer, a developer builds a Domino application by constructing one or more databases with the appropriate forms, views, agents, resources, and so on ”and possibly code associated with the elements and their events. Some of the Domino design elements may be familiar to a Web developer, such as Framesets, Pages, Applets, and Style Sheets, whereas others will be more familiar to a Domino developer such as Forms, Views, Agents , and so on.

Features for J2EE Development in Designer

What can we find in Domino Designer that will help us build applications in the J2EE environment? Among the recently added features to the Domino R6 version of Designer, there are three that provide such aid: XML support for Domino database elements, JavaScript tag libraries for Domino elements and, although not an explicit Designer feature, the ability to implement Web service providers and consumers.

As XML is used as the basic data format syntax for many Web enabled applications and especially for Web services, it is important that the Domino application development environment provides the means to work with Domino elements in terms of XML. Beginning with Domino R5 and continuing with Domino R6, Lotus has provided XML support in the following ways:

  • Lotus has specified a Document Type Definition (DTD) for Domino database elements such as views, forms, and documents. The XML described by this DTD is referred to as "Domino XML" or DXL.

  • Domino Designer provides tools (via the menu bar) to export design elements as DXL to files, view the DXL, or apply XSL transforms to DXL.

  • The Domino Java class library includes support for generating DXL for parsing and transforming Domino objects such as documents.

  • Domino includes the XML4J parser and the LotusXSL transform processor, which enable agent code to parse and transfrom XML (and DXL). (The XML4J and LotusXSL code were contributed by IBM/Lotus to the Apache open source Xerces parser and Xalan XSL transformer projects.)

  • Domino Designer provides LotusScript classes, which allow generating, parsing, and transforming XML and DXL.

Let's examine the Designer XML related features a bit more closely. We'll look at how Designer enables XML to be manipulated in Java and in LotusScript. For Java, which is primarily used for agent and applet code, Designer only provides explicit support for those XML related classes defined as part of the lotus.domino package and a small subset of the XML4J and XSLT classes (see Figure 8-7). By "explicit" we mean that the classes are listed in Designer's reference pane and help viewer. This largely reflects Designer's focus on the Domino model and is more a lack of convenience than a restriction of function since any class made available via the Domino classpath can be used within Domino Java code. Figure 8-6 shows some of the XML related classes in the lotus.domino package.

Figure 8-7. Designer XML-related classes.

graphics/08fig07.gif


Figure 8-6. Lotus.domino XML classes.
graphics/08fig06.jpg

The lotus.domino.Document.generateXML() methods shown in Figure 8-6 can be used to generate an XML (DXL) stream from a Document object either as a String, as input to a Writer object, or as the result of an XSLT transform (the generateXML(Object, XSLTResultTarget) signature ). The agent code shown is an example of how the generateXML method is used to generate the DXL for all documents in a database to a file.

NOTE

You might be wondering if this same function can be accomplished via the DXL utility menu items mentioned here. The answer is no; the Tools>DXL Utilities menu functions apply only to Designer (design) documents ”you must write an agent like the one shown to generate or transform XML for regular documents in a Domino database.


Figure 8-7 shows the subset of XML classes from the org.w3c.dom and org.xml.sax packages, which are provided explicitly by Designer. The org.w3c.dom classes can be used to traverse an XML DOM tree generated by a parse of a Domino document element (such as an attachment, rich text field, or item text). The three org.xml.sax classes are provided to enable input to the XSL transform function and to handle exceptions from the XML transformer (which uses a SAX parser for the XSL stylesheet). Note that these packages appear under the Third-Party Java drop-down item.



IBM WebSphere and Lotus Implementing Collaborative Solutions
IBM(R) WebSphere(R) and Lotus: Implementing Collaborative Solutions
ISBN: 0131443305
EAN: 2147483647
Year: 2003
Pages: 169

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net