One of the great benefits of composite applications is that the components comprising them can be reused from application to application. Developing good, reusable components can result in a greater return on investment in your technical resources, and IBM® has used this practice for composite applications. The components described in this article have been used at IBM in composite applications developed for internal use. Many of them are not IBM specific, and periodically they are released as part of an as-is, unsupported library distributed on OpenNTF.org.
The second release of this library has recently been posted and contains many new components, including some side-shelf components and some plug-in features. Source code is also provided for customers who want to further modify those components for their own use. This article discusses some of the new components in version 2 of the library and shows how they can be used to add value to your composite applications.
What is distributed
In the first release of the library, the Eclipse update site, IBM® Lotus® Notes® components, and documentation were all included in one NSF file. The latest library contains many more components, and this approach did not scale. Version 2 has several more NSF files that fall into these three sets:
- Update site. This file (cl_us_2.nsf) contains the Eclipse components and the code for the Lotus Notes components. It is the only part of the library that is mandatory for deployment and use of the components in your enterprise.
- Documentation. This file (cl_doc_2.nsf) contains a simple database containing the documentation for each component. The source code for the Eclipse components is also found here, in an attachment in the Information category.
- Unit tests/examples. Components in the library are grouped into features. Each feature has a corresponding composite application containing unit tests for the components (cl_basic_2.nsf, cl_misc_2.nsf, cl_nav_2.nsf, cl_notes_2.nsf, cl_util_2.nsf, cl_view_2.nsf, cl_w32_2.nsf). These tests can be used to debug an installation and ensure that the components are set up and deployed correctly.
These sets also serve as an example of how each component can be used. Through the testing interface, you can exercise the APIs of the components to learn about their behavior. You can also open up the unit tests in the composite application editor to see how they were assembled.
The components provided in the library are grouped into features for deployment purposes. There is no technical reason why certain components are grouped together, but we've tried to keep them in commonly grouped themes. Because the source code is available to you, feel free to repackage the components into whatever feature groupings you need.
These components provide basic controls. They are useful in creating quick situational applications for rapid deployment or for prototyping. If your later needs exceed the abilities that these components expose, then you can create specialized components that subsume the functionality in these.
- Checker. This component presents a check box with configurable text to the user. An advanced component property can be set to define how many actions that this component consumes and the number of fields that it broadcasts. By default, there are four, called Field1, Field2, Field3, and Field4. When the Field1 action is set and the check box is selected, the Field1 property is fired with the same value. This components acts as a sort of pass-through gateway.
Additionally, you can override the defaults values of the properties to be a combination of the input values. For example, setting the advanced component property field1Mask to F1 1:%FIELD1% 2:%FIELD2% broadcasts the field1 property with some hard-coded text, to which the values set into the field1 and 2 actions are added. In a similar way, you can set the text displayed next to the check box setting buttonMask with similar substitution parameters.
- Chooser. This component presents a button to the user with a configurable combo box and, like the Checker, supports a variable number of actions and properties. It also supports the field1mask values to change how the property values are broadcast. Similar to buttonMask in Checker, it has a displayMask advanced component property, which controls how the text of each line in the drop-down window is displayed.
The value passed to the actions should be comma-delimited lists of values. The first value in this list is used when the first value in the drop-down window is selected, the second for the second value, and so on. When a setting is chosen, all the properties are calculated based on the indexed value of the list. This calculation can be used to present one set of text to the user and a different one to the action.
For example, suppose that you want to create a color-picker Chooser. You want the user to pick the color based on its name, but you need to use the hex RGB value for the out. You might then decide that you need two fields, the first for the list of color names and the second for the list of hex values. In the advanced component properties, you would set numFields=2, to get the two fields, and then set displayMask=%FIELD1%, to use the color name to display (see figure 1). You would set field1Mask =%FIELD2% so that the hex value from the second list is broadcast as the value of the field1 property when an item is selected.
Figure 1. Setting the advanced component properties on the Chooser component
Figure 2 shows the Chooser component wired to the Tester component with the above settings. You can see how the color names are used for the combo choice, but when one is selected, the hex value is broadcast.
Figure 2. Using the Chooser component to select a color value by name
- Clicker. This component presents a button to the user with configurable text. It is similar to the Checker in that you can set the number of properties and actions and you can change the broadcast property values and button text. The properties are all fired when the button is clicked.
- Constants. This component broadcasts constant values. The number of properties to broadcast can be set as an advanced component property. The values of those properties are set as additional advanced component properties. This component is handy when you want to provide a static value to an action on another component. For example, if the choices you want to present in the Chooser component are always the same, you might create a Constants component with those values and wire it to the Chooser. Watch the demonstration on YouTube.
- Database open. This component is a button to let you select a Lotus Notes database. It is similar to the File - Open - Lotus Notes Application window, but when you select a database, it broadcasts the Lotus Notes URL of the database as a property.
- File open. This component is a button to let you select a file. It is similar to the File - Open - File window, but when you select the file, it broadcasts the File URL of the database as a property. Additional advanced component properties let you set up a list of acceptable file extensions and names.
These components bring additional information into your composite application, depending on context. You can wire them to other source components to give the user a dashboard view of what is going on in their application.
- Contextual bookmark. This component tracks references to Lotus Notes documents, views, databases, and Web pages. It can display them scoped to the page, the application, or globally. Documents dragged to an application scope, for example, display listed in each instance of this component on any page of this application. They do not, however, display listed in instances of this component in other applications.
- Personal information. This component displays information on a list of users from a Lotus Notes document or from a property. If given a Lotus Notes document, it searches all the fields in the document for names, populating the drop-down window at the top of the component with the names it finds. If given a list in a property, it uses that. The selected name is broadcast as another property. Programmatically, this component uses the same code as the Lotus Sametime® business card component (see figure 3) and can be shown tabbed or extended with your own contributions.
Figure 3. Drop a personal information component into your mail file
- Productivity editor. This component uses the productivity editor to display a document in read-only mode. An advanced component property and action are available to direct it to load from a file, a URL, or a Lotus Notes attachment. If you load a spreadsheet, any named range is automatically promoted to a property and action. This editor is great for adding a spreadsheet to your application and prepopulating it with data for report generation or business logic (see figure 4).
Figure 4. Named ranges in spreadsheet automatically published as properties and actions
- Lotus Sametime buddy list. This component presents a list of Lotus Sametime-enabled people. The list that you provide the component might have an additional information field that is also displayed. Optionally, a Group Chat button might be made visible to chat with all the selected people from the chat. A nifty use is to populate this component with just the names of the people involved in the item on which your application is focused. It yields great context and utility.
- Lotus Sametime business card. At the base level, this component displays business card information from Lotus Sametime. Through Eclipse extension points, however, you can contribute your own additions to the display for company- or domain-specific information. These additional areas can be shown in tabs or stacked vertically.
The default navigator that comes with a composite application cannot be resized or repositioned. Navigation components not only provide equivalent navigation features but also display the page data in a variety of ways and can be positioned anywhere on the layout surface. For a consistent user interface, though, you must add this navigator to each page in your composite application. Drag-and-drop action across pages by dragging and hovering over the navigator is not supported by these components.
- Button bar. This component is a page navigator that renders as a series of buttons created horizontally. The buttons are named with the name of the page and tagged with the page image, if one is present. When clicked, the page is navigated to. This navigator does not support child pages.
- Drop-down navigator. This component is a page navigator that renders as a combo box (see figure 5). Each page name is displayed in the drop-down window with the initial focus on the current page. When an item is selected, the named page is navigated to. This navigator supports child pages by indenting their names.
Figure 5. Drop-down navigator
- Tab. This component is a page navigator that renders as tabs (see figure 6). Each top-level page gets its own tab, and when a tab is selected, the named paged is navigated to. This navigator does not support child pages.
Figure 6. Tab navigator
- Tool bar. This component is a page navigator that renders as a button-based toolbar. Pages with children are displayed as simple buttons and have an additional drop arrow next to them. This navigator supports only top-level pages and the first generation of child pages.
- Tree. This component is a page navigator that renders as a tree. The entire page hierarchy is represented and can be selected from this control.
Lotus Notes components
These Lotus Notes-based components bring several features that are available only from LotusScript® into the composite environment.
- Calendar entry creator. This component creates a calendar entry based on an iCalendar record. This component is handy for adding the familiar "click here to add to calendar" capability to Eclipse-based components. Watch the demonstration on YouTube.
- Document viewer. This component accepts a Lotus Notes URL and displays it. This component can be used in a preview capacity or to bring in a Lotus Notes element dynamically, depending on the context.
- Execute script. This component executes LotusScript by using an action. The entire LotusScript program is passed as the action value, allowing for the ultimate in parameterization of complex logic.
These components provide general utility functions. They are most often used as bridges between other components to glue together an application.
- Converter. This component converts any of the standard types to a generic string type and a generic string type to a standard type. Although largely superseded by the ability in Lotus Notes 8.0.2 to ignore strong type checking, it can be handy if you need to support earlier versions of Lotus Notes.
- Eclipse selection. This component converts the currently selected Eclipse object into a string. A component is just an Eclipse ViewPart. You can quickly deploy existing Eclipse ViewParts as components for use in a composite application, but additional work is needed before they are able to exchange information with other components.
Many Eclipse ViewParts are already set to the Eclipse selection state, so this component can act as a bridge between those pure Eclipse ViewParts and other components.
The component monitors the current Eclipse selection state and, when it changes, the string value of that selection is broadcast as a property. This property can then be linked to actions on other components. Through this method, your existing Eclipse ViewParts can be deployed as components and gain some interactivity with other components in a composite application.
- Lotus Notes name. This component does a Lotus Notes name lookup and pulls out the name, distinguished name, Internet address, and as many as four other fields from the name entry in the name and address book. This component is great for, say, driving a telephony component or adding specific context to an application from your directory.
- Lotus Notes URL processor. This component consumes a Lotus Notes URL (and can be set up to respond to the currently selected document). You can then set up any number of fields with @formulas to compute values based on the given URL. Most simply, this component can be used to extract fields from a document and broadcast them to other components. It's extremely useful when you don't have designer rights to the database from which you are getting the document.
- Page namer. This component is a utility for renaming the page name dynamically. It is handy to show specific context.
- Regular expression processor. This component consumes a chunk of text in an action. You can set up several advanced component properties with regular expressions in them to drive the output of several properties with the matched text. This component is good to use in tandem with the Lotus Notes URL processor to parse the contents of fields extracted from a Lotus Notes document.
- View utility. This component is a utility that controls the visibility of views. There are many times when you want to make components on the screen visible or invisible, maximized or minimized. You can do this programmatically from Eclipse, but that approach must be designed into the components and is not accessible from LotusScript. This component lets you do it at assembly time.
- Web launcher. This component takes a URL and launches a Web browser either in the environment or external to it. Often, you have access to a URL, but it doesn't make sense to load the page each time the context changes as it adds overhead that might not be warranted. Most Web pages are designed to be shown full screen. You could use the Web clipper component (described below) to display a portion of the page in-line, but if the URLs are from varying sites, that isn't a good alternative.
This component lets you load a Web page either external to Lotus Notes or in another tab in the Lotus Notes environment. You can use it in series with a clicker component to add "Click here to show Web page" capability to a composite application.
These components are used for visualizing a range of data in a variety of ways.
- Chart. This component is a basic pie-chart component in which data is consumed as a weighted list of values. The weight determines the width of the pie wedge. When a wedge is selected, the value associated with it is broadcast. It uses the same data format as the tag cloud component, so it can be driven by the Lotus Notes to tag cloud calculator, for example, to show a pie chart of the number of articles in each category in a discussion database.
- Mockup. This visual-only component is used for mocking up and prototyping a user interface (see figure 7). It can take the appearance of a variety of other control types and is handy when you need to quickly show what a composite application might look like. You can also use it to draw labels on a page.
Figure 7. Prototype a composite application with the mockup component
- Lotus Notes join - table. This component displays a table of values computed from several Lotus Notes sources. You can specify each source database or each view as a Lotus Notes URL in the advanced component properties. For each source you can optionally add an @formula that's evaluated on each document to determine if it is to be included in the table. Then, for each source, you supply additional @formulas to calculate the value to be used for each column.
The results are shown merged together in a table. This component produces a lot of load on the Lotus Notes client and the servers from which the information is coming. It is best used on small data sets.
- Lotus Notes join - tree. This component displays a tree view of values computed in the same way that the Lotus Notes join - table component does.
- Lotus Notes to tag cloud. This component calculates tag cloud information from a Lotus Notes view or database. Advanced component properties let you specify the information source and the fields to use to compute keywords and weightings. If another advanced component property is filled to specify the field in which the user is stored, then two buttons display, to select between All Documents and the current user's documents. The string of weighted values broadcast as a property can be used with the tag cloud, chart, or other compatible component.
- Lotus Notes view to tag cloud. This component is a combination control bringing together the Lotus Notes to tag cloud, constants, and tag cloud components (see figure 8). It works with any categorized Lotus Notes view defined in an advanced component property and displays the categories weighted by the number of articles in each category.
Figure 8. Add a tag cloud to any database
- Table. This component displays a table of values set by an action. Focus and selection state are broadcast through a property. This component is great for quickly displaying arbitrary data.
- Tag cloud. This component displays a range of keywords weighted by given values. Selection and focus state can be returned, and a slider control is provided to throttle how many tags are shown.
- Web clipper. This component displays a Web page and extracts values. Web applications often have a lot of value to add to a composite application; however, most Web pages are designed to fill the entire screen. The web clipper component lets you prune a Web page by specifying regular expressions that match the contained HTML and selectively show only certain portions. Thus, you can create components of Web applications without any changes to them. Watch the demonstration on YouTube.
These components are Microsoft® Windows® dependent, exposing features that are available only on the Windows operating systems.
- Flash player. This component plays Flash files, which can be read from your disk, from the Web, or from a Lotus Notes attachment. This component is a great way to integrate multimedia into your application. Watch the demonstration on YouTube.
- OLE/ActiveX container. This component surfaces ActiveX documents or controls, many of which are already designed to be used as components and work well in composite applications. For a tighter integration, the source code for this component can be used to create a wrapper for specific OLE components that expose more deeply integrated properties and actions.
- Reparent. This component can reparent a Win32 application as a component. As written, it brings the application on-the-glass into the composite application, providing context but no integration. The source code, however, is provided and can be used as a basis for creating a wrapper for a specific application and for building those integration bridges. Watch the demonstration on YouTube.
- Windows spy. This component shows all the windows in the Microsoft Windows desktop. This component is mostly handy for working out the class names for Windows applications to use with the reparent component.
This set isn't a feature grouping but just a general collection of the other components.
- WSDL editor. This component lets you do editing of WSDL files. It can't do everything that the property broker editor can do, but it can do most of what you need most of the time.
- CA XML viewer. This component lets you view composite application (CA) XML files in a graphical user interface. Although read-only in this form, it could be used as the starting point for creating an administration tool for migrating composite applications.
- Tester. This component aids in unit testing components with standard values. You can visually enter values and send them to actions on your tested component; similarly, you can see any property value broadcast by the component being tested. Almost every component in the library has a unit test with this component. It is great for isolating problems and exploring component functionality.
- Bookmark side shelf. This component is the bookmarking utility deployed as a side-shelf component.
Lotus Notes 8 supports several types of additions beyond components. This section discusses some features that contribute additional menus to Lotus Notes.
- Export a Lotus Notes document to IBM Lotus Symphony™. This wizard lets you export a selected Lotus Notes document into a Lotus Symphony document, spreadsheet, or presentation. Before using this component, you must create a template Lotus Symphony document, spreadsheet, or presentation and enter input makers in the form of $(name) into the text of the document. Then you select your document, invoke the menu function, and seelct your template.
You can then map the fields in the Lotus Notes document to the input markers in the Lotus Symphony document. When you are done, the Lotus Symphony document is displayed in Lotus Notes for any additional editing. See figure 9.
This is a great way to create stock material from Lotus Notes documents. Watch the demonstration on YouTube.
Figure 9. Export Lotus Notes document as a Lotus Symphony document
- Lotus Notes view to Lotus Symphony spreadsheet. This wizard walks you through creating a spreadsheet based on a view. The columns in the view are presented, you can select from them, and a Lotus Symphony spreadsheet is then displayed in the Lotus Notes client containing the data for those columns. You can then create charts, data pivot tables, and so forth with the new spreadsheet. Watch the demonstration on YouTube.
- Situational application wizard. This component walks you through creating an ad hoc composite application based on the current bookmark selection. For each bookmark in the selected folder, a page is created in the composite application. You can choose to add selected components to each page or to individual pages. When it is complete, you can use the resulting composite application as-is or edit it for further customization. This wizard is an excellent way to produce a quick situational or personal productivity application to solve an immediate need, which can be enhanced later.
Composite applications have improved how applications are created. When a component library of reusable components is added to these improvements, making it quicker and easier to develop solutions by sharing components, you can benefit even more. You can realize these benefits by developing your own component library for your personal use, by developing components for others, or by using components developed by others.
The interest in component reuse is real, as evidenced by the download statistics on the OpenNTF.org site. The components described in this article are being used in composite applications developed both inside and outside IBM. Boost your application development environment with reusable components.
- Get started with IBM Lotus Notes and Domino V8 technical content.
- Read the developerWorks® article, "Designing composite applications: Component design."
- Read the developerWorks article, "Designing composite applications: IBM Lotus Notes components."
- Read the developerWorks article, "What's new in IBM Lotus Notes and Domino V8."
- Read the developerWorks article, "Integrating IBM Lotus Notes data into the Lotus Notes V8 sidebar and toolbar."
- Get started with IBM Lotus Domino Designer 8 Help.
- Refer to the developerWorks Lotus composite applications page.
- Read the "Lotus Notes and Domino 8 Reviewer's Guide."
Get products and technologies
- downoad a trial version of IBM Lotus Domino.
- downoad a trial version of IBM Lotus Notes, Domino Designer, and Domino Administrator clients.