Building composite applications for IBM Lotus Notes V8

Before you start

The process of building composite applications can involve multiple procedures. This tutorial organizes the procedures into multiple lessons that you can perform in the order presented.

About this tutorial

This tutorial contains the following steps you need to create an NSF-based composite application that includes both NSF and Eclipse components:

  • Overview and setup
  • Lesson 1: Create a WSDL file to support intercomponent communication
  • Lesson 2: Define IBM Lotus Notes view columns that publish properties
  • Lesson 3: Define IBM Lotus Notes actions for intercomponent communication
  • Lesson 4: Assemble an NSF-based composite application
  • Lesson 5: Add NSF components to the composite application
  • Lesson 6: Wire components in the composite application
  • Lesson 7: Publish properties using LotusScript APIs
  • Lesson 8: Add Eclipse components to the composite application
  • Lesson 9: Wire Eclipse and NSF components in a composite application
  • Lesson 10: Additional actions and wiring

Overview and setup

This tutorial includes procedures to guide you in creating an NSF-based composite application. The final composite application contains two NSF components from two IBM Lotus Notes applications and one Eclipse component. These components have loosely coupled event/action relationships across application and system boundaries, and they change their display based on user action in a single component.

In this tutorial, you are a developer using IBM Lotus Domino Designer V8 to modify the Lotus Notes application design elements to support intercomponent communication. You also use the Composite Application Editor (CAE), an optional feature of the Lotus Notes V8 client to assemble the components and to wire the components into event/action relationships. Developers and line-of-business users with proper access to a composite application can use the drag-and-drop capabilities of the CAE feature.

Figure 1 shows the composite application, which uses intercomponent communication. The user of the composite application can select a name in the Lotus Notes Contacts component displayed at the top left of the screen. The user name is published by that component, and the two other components execute their predefined logic to display information relevant to the selected user.

The user can also select a topic in the Tag Cloud component displayed in the upper right; the NDForum component, displayed at the bottom, executes its logic to list documents related to the previously selected user.

Figure 1. The Customer Interests composite application in Lotus Notes V8
The Customer Interests composite application in Lotus Notes V8

Applications for this tutorial

For our composite application, we include the following Lotus Notesapplications:

  • Lukas Geiger 8.0 Contacts, LGContacts.NSF
    This Lotus Notes application contains contact information for fictitious users. The design of this application is the design of the Lotus Notes Contacts, formerly known as the Personal Name and Address Book. You use one view as an NSF component and survey how the supplied properties and actions can be used.
  • Lotus Notes/Domino V6 and V7 Forum, NDForum.NSF
    This Lotus Notes application is a forum of questions and answers about Lotus Notes and Domino-related topics. Authors include the same fictitious users listed in LGContacts.NSF. This content and design are a subset of the Lotus Notes and Domino forum accessible from IBM developerWorks.

    You use one Lotus Notes view as an NSF component and modify it to support intercomponent communication.
  • Customer Interests Update Site, Tag Cloud Eclipse component
    As defined in wikipedia, a tag cloud (or weighted list in visual design) can be used as a visual depiction of content tags used on a Web site. Often, more frequently used tags are depicted in a larger font or otherwise emphasized, while the displayed order is generally alphabetical. Thus, finding a tag by alphabet and by popularity are both possible. Selecting a single tag within a tag cloud generally leads to a collection of items that are associated with that tag.

    The Tag Cloud component was built by another developer using the Eclipse IDE. Because the Lotus Notes V8 client supports components of different technologies, you include this component in your composite application. The Tag Cloud component is available from an update site stored in TC_US_8.NSF.

Setup procedure

Follow these steps to complete your setup for starting the tutorial lessons:

  1. Extract the contents of the ZIP file to a new folder of your naming.
  2. Copy the three Lotus Notes applications to the data directory of your Lotus Notes V8 client:
    • NDForum.NSF
    • LGContacts.NSF
    • TC_US_8.NSF

The following two text files contain LotusScript code that you can paste into Lotus Notes actions through your Lotus Domino Designer V8 client as noted in Lessons 3 and 10:

  • SelectPerson_Action_for_NDForum.txt
  • SelectSubCategory_Action_for_NDForum.txt

System requirements

To complete all lessons in this tutorial, you must install and setup the following:

  • IBM Lotus Notes V8 client software with the optional Composite Application Editor feature
  • IBM Lotus Domino Designer V8 client software

Lesson 1: Create a WSDL file to support intercomponent communication

This lesson includes one procedure to create a WSDL file for use by the two NSF components from the NDForum application. The Lotus Notes Contacts application and the supplied Tag Cloud Eclipse applications each have a WSDL file that was previously defined. A composite application component can participate in intercomponent communication if it has properties and actions that can be wired to other components. The WSDL file lists the possible properties and actions that a component may expose, plus the namespace and other attributes. When a property and an action have the same namespace and datatype, they can be wired to form an event/action relationship.

Creating a new WSDL file to support properties and actions in NDForum.nsf

Complete the following steps to create a WSDL file to support properties and actions:

  1. In Lotus Domino Designer, choose File - Application - Open, and select NDForum.nsf from the list of Notes applications. The title of this application is Notes/Domino 6 and 7 Forum.
  2. Expand Composite Applications in the design pane on the left, and then select Wiring Properties. The work pane appears as shown in figure 2.
    Figure 2. The Wiring Properties work pane of Lotus Domino Designer V8
    The Wiring Properties work pane of Lotus Domino Designer V8
  3. Click the New Wiring Properties button at the top of the work pane. A dialog box appears as shown in figure 3.
    Figure 3. The dialog box to name and create a new Wiring Properties file
    The dialog box to name and create a new Wiring Properties file
  4. Type NDForum, and click OK. The new WSDL file, NDForum.wsdl, is listed in the work pane as shown in figure 4.
    Figure 4. A Wiring Properties file listed in the work pane of Lotus Domino Designer V8
    A Wiring Properties file listed in the work pane of Lotus Domino Designer V8
  5. Select the file, and click the button labeled Open File. The Property Broker Editor appears.
  6. If you are not already working in the Properties section, select the Properties tab located in the middle of the Property Broker Editor feature.
  7. Click the Add button.
  8. In the Property Details section displayed in the upper right, do the following:
    • Type UserDisplayNamePart in the Name field.
    • Select String for the Type field.
    • Type User in the Title field.
    • Type Display user name in the Description field.
    • Deselect the Allow publishing option.

    Your Properties tab should be identical to figure 5.
    Figure 5. The Property Broker Editor feature of Lotus Domino Designer V8 when creating the first property
    The Property Broker Editor feature of Lotus Domino Designer V8 when creating the first property
  9. If needed, select the Properties tab located in the middle of the Property Broker Editor feature.
  10. Click the Add button.
  11. In the Property Details section displayed in the upper right, do the following:
    • Type TopicDisplayNamePart in the Name field.
    • Select String for the Type field.
    • Type Topic in the Title field.
    • Type Display topics (subcategory) in the Description field.
    • Deselect the Allow programmatic publishing option.

    Your Properties tab should be identical to figure 6.
    Figure 6. The Property Broker Editor feature of Lotus Domino Designer V8 when creating a second property
    The Property Broker Editor feature of Lotus Domino Designer V8 when creating a second property
  12. If needed, select the Properties tab located in the middle of the Property Broker Editor feature.
  13. Click the Add button.
  14. In the Property Details section displayed in the upper right, do the following:
    • Type propTopicList in the Name field.
    • Select String for the Type field.
    • Type Publish Topics in the Title field.
    • Type "Publish topics for selected user" in the Description field.
    • Leave the Allow publishing option selected.

    Your Properties tab should be identical to figure 7.
    Figure 7. The Property Broker Editor feature of Lotus Domino Designer V8 when creating a third property
    The Property Broker Editor feature of Lotus Domino Designer V8 when creating a third property
  15. Select the Actions tab located in the middle of the Property Broker Editor feature.
  16. Click the Add button. This action is used to change the selection in the Lotus Notes view to the subcategory for the previously selected user.
  17. In the Action Details section in the middle area, do the following:
    • Type actSelectTopic in the Name field.
    • Type "Select Topic for User" in the Title field.
    • Type "Select subcategory topic for selected user" in the Description field.
    • Leave the "Default action if multiple actions match the property" option deselected.
  18. In the Action Input Parameter section, select "TopicDisplayNamePart" from the Property list. Your Actions tab should be identical to figure 8.
    Figure 8. The Property Broker Editor feature of Lotus Domino Designer V8 when creating a new action
    The Property Broker Editor feature of Lotus Domino Designer V8 when creating a new action
  19. If you are not already working in the Actions section, select the Actions tab located in the middle of the Property Broker Editor feature.
  20. Click the Add button. This action is used to change the selection in the Lotus Notes view to the category that matches the name of the selected user.
  21. In the Action Details section in the middle of the pane, do the following:
    • Type actSelectUser in the Name field.
    • Type "Select User By Name" in the Title field.
    • Type "Select user by name in Notes view" in the Description field.
    • Leave the "Default action if multiple actions match the property" option deselected.
  22. In the Action Input Parameter section, select UserDisplayNamePart from the Property list. Your Actions tab should be identical to figure 9.
    Figure 9. The Property Broker Editor feature of Lotus Domino Designer V8 when creating a new action
    The Property Broker Editor feature of Lotus Domino Designer V8 when creating a new action
  23. Choose File - Save from the Property Broker Editor menu.
  24. Choose File - Exit from the Property Broker Editor menu. The Property Broker Editor closes, and you return to your Lotus Domino Designer V8 client.
  25. In the Wiring Properties work pane, click the Refresh button. The Open dialog box appears as shown in figure 10.
    Figure 10. The Open dialog box presented after clicking the Refresh button in the work pane
    The Open dialog box presented after clicking the Refresh button in the work pane
  26. Select the WSDL file you updated in the Property Broker Editor, ~NDForum.wsdl, and click Open. Your updated WSDL is stored in the Lotus Notes application design element.

    NOTE: The file name may increment whenever you use the Property Broker Editor feature.

By completing this procedure, you enabled NSF components from the NDForum application to include properties to be published and actions to be executed. In later lessons, you use Lotus Domino Designer V8 to associate the properties and actions listed in this WSDL with Lotus Notes design elements and to specify what information is published as a property and what logic is executed as actions.

If you want to examine the WSDL content in XML format, use the Open With button in the work pane, and then select a text editor.


Lesson 2: Define Lotus Notes view columns that publish properties

In this lesson, you examine the Contacts application to observe how you can use Lotus Domino Designer V8 to publish a property from a Lotus Notes view column when the user selects a new row in the view.

Defining Lotus Notes view columns that publish properties

Complete the following steps to observe how a Lotus Notes view column can publish a component property:

  1. In Lotus Domino Designer V8, choose File - Application - Open, and select LGContacts.nsf from the dialog box. The title of the Lotus Notes application is Lukas Geiger 8.0 Contacts.
  2. Click Views in the design pane to display the view list in the work pane.
  3. Select My Contacts from the work pane, and click Enter to open the view in design mode. Click OK in the warning dialog box.
  4. In the view, click the second column, labeled Name, to select it.
  5. Choose Design - Column Properties to open the properties box for the selected column.
  6. Select the last tab of the properties box, and note that SelectedNameChanged is selected in the Composite Settings Property list as shown in figure 11. This option specifies that the column value is published as a property from the user-selected row.
    Figure 11. The advanced tab of the Column properties box
    The advanced tab of the Column properties box
  7. Close the properties box.
  8. Choose File - Close to close the view. Do not save any changes you may have inadvertently made.

You have observed how a property can be published from a Lotus Notes view. Any one property defined in the WSDL for the Lotus Notes application can be selected from this property box option. The Lotus Notes Contacts design template (pernames.ntf) includes this property and others. In a later lesson, you use this view as an NSF component and wire it in an event/action relationship to an NSF component in the NDForum application.


Lesson 3: Define Lotus Notes actions for intercomponent communication

A component action is the predefined logic to be executed when the property to which the action is wired is published. You use Lotus Domino Designer V8 to define actions on Lotus Notes design elements to be used as NSF components.

Defining actions on a Lotus Notes form

Complete the following steps to define the logic associated with an NSF component:

  1. In Lotus Domino Designer V8, open NDForum.nsf.
  2. If needed, switch to the Views list by selecting Views in the designer pane.
  3. Select the "2. Author\Threaded view," and press Enter to open it in design mode. If you click the Refresh button, your screen appears as shown in figure 12.
    Figure 12. The view named 2. Author\Threaded after refresh in Lotus Domino Designer V8
    The view named 2. Author\Threaded after refresh in Lotus Domino Designer V8
  4. Choose Create - Action - Action to add a new action to this view. The action pane opens, and the properties box appears for the new action as shown in figure 13.
    Figure 13. The basics tab of the action properties box
    The basics tab of the action properties box
  5. On the first tab of the properties box, type SelectPerson in the Name field.
  6. Deselect the options "Include action in Action bar" and "Include action in Action menu."
  7. On the last tab of the properties box, select actSelectUser in the Composite Settings Action Name list as shown in figure 14. This list of actions is from the WSDL file you created earlier with the Property Broker Editor feature.
    Figure 14. The advanced tab of the Action properties box
    Figure 14. The advanced tab of the Action properties box
  8. Close the properties box.
  9. Click the newly created action SelectPerson in the Action pane on the top right.

    NOTE: If the Action pane is not open in the form window, choose View - Action Pane to open it, and then select the newly created action.
  10. In the Lotus Domino Designer Programmers pane, select the Client and LotusScript options for this action as shown in figure 15. The Client option may already be selected.
    Figure 15. The Click subroutine of the action named SelectPerson
    The Click subroutine of the action named SelectPerson
  11. Input the LotusScript code displayed in listing 1 in the Click subroutine. The source code has been provided in the file SelectPerson_Action_for_NDForum.txt. You can copy the code from the provided file and paste it into the Click subroutine.

    NOTE: The action script creates an object of the new NotesPropertyBroker class and uses the property published by another component to change the view selection to the category that matches the published value.
Listing 1. Click subroutine code for SelectPerson action
Sub Click(Source As Button)
Dim s As New NotesSession, ws As New NotesUIWorkspace
Dim uidb As NotesUIDatabase, db As NotesDatabase, doc As NotesDocument
Set uidb = ws.CurrentDatabase 
Set db = s.CurrentDatabase
'Handle error 4719, when script is run without a property broker context
On Error 4719 Goto err4719	
'NotesPropertyBroker code   
Dim pb As NotesPropertyBroker  'create new NotesPropertyBroker object
Set pb = s.GetPropertyBroker
Dim pbInputProperty As NotesProperty, pbContext As Variant
pbContext = pb.InputPropertyContext   'array of NotesProperty objects
Set pbInputProperty = pbContext(0)    'handle to first NotesProperty object
Dim InputPropertyName As String, NameSpace As String  
InputPropertyName = pbInputProperty.Name   'name of NotesProperty object
Dim pbValue As Variant
pbValue = pb.getPropertyValue(InputPropertyName) 'array of values of NotesProperty
cName$ = pbValue(0)  'first value from array NotesProperty object
SkipPropertyBroker:
If cName$ = "" Then Exit Sub
Set doc = db.GetProfileDocument("SelectedAuthor", s.UserName)
Call doc.ReplaceItemValue("SelectedAuthor",  cName$)
Call uidb.OpenView("2. Author\Threaded", cName$ , False, False)	
Exit Sub	
err4719:
Print "Error " & Str(Err) & ": " & Error$
Resume skipPropertyBrokerEnd Sub
  1. Save your changes and close.

You have added an action to the Lotus Notes view and completed this lesson. When you later use this Lotus Notes view as an NSF component in a composite application, the component can consume a published property that it is wired to, and then perform the action you defined in your LotusScript code.


Lesson 4: Assemble an NSF-based composite application

The Lotus Notes V8 client can access NSF-based composite applications, where the definition is stored in an NSF. The NSF may be local on the Lotus Notes V8 client or on the Lotus Domino server. The Lotus Notes V8 client can also access composite applications hosted on IBM WebSphere Portal.

Creating an NSF-based composite application

Complete the following steps to add the action to create a new NSF-based composite application:

  1. In Lotus Notes V8, open the Workspace through the Open list. Choose Open - Applications - Workspace, so that you can later access the application properties from the workspace of Lotus Notes.
  2. From the menu, choose File - Application - New. The New Application dialog box appears.
  3. Leave the Server field value set to Local.
  4. Type Customer Interests in the Title field.
  5. Type CustomerInterests.nsf in the File Name field.
  6. Select -Blank Composite Application- in the Template field. The dialog box should resemble figure 16.
    Figure 16. The New Application dialog box
    The New Application dialog box
  7. Click OK to close the dialog box and create the new database. The new Lotus Notes application is created, and a grey blank window appears as shown in figure 17.
    Figure 17. The NSF-based composite application before editing
    The NSF-based composite application before editing
    NOTE: The newly created NSF-based composite application uses a new database launch property. The first option shown in this dialog box, "When opened in the Notes client," is set to "Launch as Composite Application" for any NSF created with this template as shown in figure 18. This option can be seen by opening the Lotus Notes workspace, and then accessing the application properties. To access the Lotus Notes workspace, use the Open list, choose Applications, and then choose Workspace.
    Figure 18. The Launch tab of the Database properties box
    The Launch tab of the Database properties box

You have completed this lesson and created an NSF-based composite application that stores the XML in a Lotus Notes application design element. The Lotus Notes V8 client uses the launch properties and the XML to present the composite application to the user. The NSF-based application can be hosted on a Lotus Domino server and can be replicated locally.

In the following lessons, you use the Composite Application Editor (CAE) feature to specify the XML and to aggregate NSF components and Eclipse components as a composite application. You also use CAE to loosely couple the components in event/action relationships by wiring the properties and actions for intercomponent communication.


Lesson 5: Add NSF components to the composite application

The Composite Application Editor (CAE) feature is a Lotus Notes V8 client feature that allows developers and authorized line-of-business users to define the components in a composite application and to wire those components together into event/action relationships. CAE is an installation option for the Lotus Notes V8 client and can be used to modify NSF-based composite applications that run locally or from a Lotus Domino server. CAE can also be used to modify composite applications and composite application templates that are hosted on IBM WebSphere Portal.

Using the Composite Application Editor to assemble a composite application

Complete the following steps to open the Composite Application Editor:

  1. In Lotus Notes V8 choose File - Open - Lotus Notes Application to open the Customer Interests composite application you created in the previous lesson.
  2. From the menu, choose Actions - Edit Application. The Composite Application Editor appears in a new window as shown in figure 19.
    Figure 19. The Composite Application Editor feature of Lotus Notes V8 for a newly created NSF-based composite application
    The Composite Application Editor feature of Lotus Notes V8 for a newly created NSF-based composite application
  3. In the Navigator pane, right-click the page labeled Blank Page and choose Rename from the right-click menu.
  4. Change the name to Customer Interests, and then press Enter to accept the new page name.

    NOTE: This new string appears as the page name in the Composite Application Editor. This string is also the window tab title when the composite application is open in the Lotus Notes V8 client.

Adding components to the Composite Application Editor component palette

Complete the following steps to add components to the component palette of the Composite Application Editor feature:

  1. Expand the Component Palette on the right.
  2. Select the control to the right of the Component Palette label.
  3. Select the option Set Palette Pin to pin open the palette.
  4. Place your mouse below the General folder, then right-click and choose Add Components - Add NSF Component. The New NSF Component dialog box appears as shown in figure 20.
    Figure 20. The New NSF Component dialog box of the Composite Application Editor feature
    The New NSF Component dialog box of the Composite Application Editor feature
  5. In the New NSF Component dialog box, type the following values:
    • Type "NDForum - Author Threaded View" in the Component Name field.
    • Type "NDForum - Author Threaded View" in the Component Description field.
  6. In the dialog box, click the Browse button, then select the view "2. Author \Threaded" from the application titled Notes/Domino 6 and 7 Forum. The filename is NDForum.nsf. The result should resemble figure 21.
    Figure 21. The Locate Object dialog box
    The Locate Object dialog box
  7. Click OK to confirm these settings.

    NOTE: These selections populate the Notes URL field in the New NSF Component dialog box.
  8. Append &HideNavigator to the Lotus Notes URL. This option prevents the display of the Lotus Notes navigator pane for the component and allots the entire component display area to the Lotus Notes view pane. Your result should match figure 22. Notice that the Replica ID is used.
    Figure 22. The New NSF Component dialog box after user input and selection
    The New NSF Component dialog after user input and selection
  9. Click OK to add this NSF component to the component palette. The component appears in the component palette as shown in figure 23.
    Figure 23. The newly added component appears in the component palette
    The newly added component appears in the component paletteNOTE: Your newly added component is listed in the General category of the component palette. You may want to create new categories in your component palette to organize your components.

    TIP: You can change the properties of the listed component by selecting the component from the palette, and then right-clicking and choosing Advanced Component Properties. For example, if you did not append &HideNavigator to the Notes URL, you can follow these steps to update the component.

Defining visual placement of components using drag and drop

Complete the following steps to add components to your composite application:

  1. Select Notes Contacts View in the PIM category of the component palette on the right as shown in figure 24. The PIM components allow component assemblers to include the Lotus Notes Mail, Calendar, To do, and Contacts applications for the current Lotus Notes V8 user.
    Figure 24. Selecting the Notes Contacts View component in the component palette
    Selecting the Notes Contacts View component in the component palette
  2. Drag the component from the component palette to the Blank Application area in the center. The PIM component appears in the composite application and displays the contents of your Lotus Notes Contacts application, formerly known as Personal Name and Address Book, similar to that shown in figure 25.
    Figure 25. The Lotus Notes Contacts application content displayed in the Composite Application Editor feature
    The Lotus Notes Contacts application content displayed in the Composite Application Editor feature

Because this application uses the Lukas Geiger 8.0 Contacts application, LGContacts.NSF, not the Lotus Notes Contacts application for the current user, take the following steps to change the properties of the added component.

  1. Select the added component Notes Contact view from the navigator in the Composite Application Editor.
  2. Right-click, and then choose Edit Component Properties.
  3. In the Edit Component Properties dialog box, shown in figure 26, click the Advanced button.
    Figure 26. The Edit Component Properties dialog box
    The Edit Component Properties dialog box
  4. In the Advanced Component Properties dialog box, shown in figure 27, select the row that displays the Lotus Notes URL, and then click the Edit button.
    Figure 27. Selecting the component property in the Advanced Component Properties dialog box
    Selecting the component property in the Advanced Component Properties dialog box
  5. Replace the special value 0000000000000E01 with the replica ID of the Lukas Geiger 8.0 Contacts application, LGContact.NSF 8025730C005D48AF.
  6. Press the Tab key, or click elsewhere in the dialog box to complete your edit.
  7. Click OK to close the Advanced Component Properties dialog box.
  8. Click OK to close the Edit Component Properties dialog box.
  9. Drag the ND Forum - Author Threaded View component from the component palette and place it in the lower half of the center area. Watch for your cursor to change to an arrow as shown in figure 28.
    Figure 28. The cursor indicates component placement in the composite application
    The cursor indicates component placement in the composite application
    The Composite Application Editor shows the added components as in figure 29.
    Figure 29. The updated composite application after adding a second component
    The updated composite application after adding a second component
  10. Choose File - Finished Editing to close the Composite Application Editor and save your changes.
  11. When prompted, click Yes to save your changes in the Composite Application Editor dialog box. The Composite Application Editor closes, and the composite application appears in the Lotus Notes V8 client as seen in figure 30. At this time, there is no intercomponent communication in your composite application, but you add this functionality in the next lesson.
    Figure 30. The updated composite application in Lotus Notes V8
    The updated composite application in Lotus Notes V8

You have completed the lesson and assembled an NSF-based composite application using the Composite Application Editor feature of the Lotus Notes V8 client. In this lesson, you added NSF components. In later lessons, you add an Eclipse component and observe how composite applications in the Lotus Notes V8 client can include components built in different technologies. In the next lesson, you wire the two NSF components together in an event/action relationship.


Lesson 6: Wire components in the composite application

Components can be loosely coupled by wiring properties to actions in one-to-one or one-to-many relationships. As the assembler, you define the wiring for a composite application through the Composite Application Editor (CAE) feature. The property broker functionality of the Lotus Notes V8 client is the runtime environment for the wiring and intercomponent communication.

Wiring components in an event/action relationship

Complete the following steps to form event/action relationships between your components:

  1. In Lotus Notes V8, choose File - Open - Lotus Notes Application to open the Customer Interests composite application you modified earlier. The composite application appears and displays the two components you added earlier.
  2. From the menu, choose Actions - Edit Application to start the Composite Application Editor feature.
  3. Select Notes Contacts View from the navigator on the left, and then right-click and choose Wiring. This opens the wiring panel and makes Notes Contacts View the source component allowing you to wire its properties to actions of other components. The Composite Application Editor wiring interface appears, as shown in figure 31.
    Figure 31. The wiring interface displays the components located on the current composite application page
    The wiring interface displays the components located on the current composite application page
    The wiring interface displays the properties for the component labeled source and the actions for any other components placed on the same page. When any one property in the source component is selected, actions that have matching namespace and datatype values display a visual that indicates wiring is possible as seen in figure 31.
  4. Select the Common name changed property in the Notes Contacts View component, which is the component labeled Source.
  5. Drag-and-drop the "Select User By Name" action listed in the "NDForum – Author Threaded View" component.

    NOTE: As seen in figure 32, a blue arrow appears as you drag from the selected property.
    Figure 32. Wiring a property to an action
    Wiring a property to an action
    As seen in figure 33, a dotted line indicates wiring between the property and action.
    Figure 33. The wiring interface displays the property and its wired actions
    The wiring interface displays the property and its wired actions
  6. Click OK to save your wiring changes and close the wiring interface.


    NOTE: The Lotus Notes ECL feature causes the Execution Security Alert dialog box to appear, prompting you that an application signed by Lukas Geiger/ZetaBank is attempting an operation. This is a feature of the Lotus Notes client. You can select the option "Start trusting the signer" to dismiss this warning. You are also prompted to create a cross certificate to the organization /ZetaBank. You may need to close and reopen the application.
  7. Choose File - Finished Editing, and click select Yes to leave the Composite Application Editor feature. This closes the Composite Application Editor and displays the updated composite application in the Lotus Notes V8 client.

    TIP: Choose Show - Preview on Side to change the placement of the preview pane in the Lotus Notes Contact component to resemble figure 34.
    Figure 34. The composite application in Lotus Notes V8 with the vertical preview pane for the Lotus Notes Contacts View
    The composite application in Lotus Notes V8 with the vertical preview pane for the Lotus Notes Contacts View
    To observe the result of your wiring, select a row in the Lotus Notes Contacts View component. The NSF component from the NDForum application reacts and changes the row selection to the matching user name. The property is published from the Lotus Notes Contacts View component with each row selection you perform. The action you wired to this property executes and performs your defined logic, moving the row selection to the matching common name.

You have completed this lesson and used the Composite Application Editor feature to wire two NSF components into an event/action relationship by connecting a property to one or more actions. Earlier, you used Lotus Domino Designer V8 to specify the properties that would be published and actions that would be executed for the NSF components.


Lesson 7: Publish properties using LotusScript APIs

Earlier, you observed how the Column properties box can be used to publish a property using the column value of the selected row. You can also make use of the new Onselect view event handler to publish more complex properties by using LotusScript APIs. For this lesson, we review this more complex code that is already in the NDForum application.

Defining additional actions on an NSF component

Complete the following steps to define the action code for an NSF component:

  1. In Lotus Domino Designer V8, open NDForum.nsf. The title of the Lotus Notes application is Notes/Domino 6 and 7 Forum.
  2. If needed, switch to the Views list by clicking Views in the designer pane.
  3. Select the "2. Author\Threaded view," and press Enter to open it in design mode. Your screen should resemble figure 35.
    Figure 35. The view named "2. Author\Threaded" after refresh in Lotus Domino Designer V8
    The view named '2. Author\Threaded' after refresh in Lotus Domino Designer V8
  4. Select the Objects tab.
  5. Locate and expand "2. Author\Threaded (View)."
  6. Select the Onselect event.
  7. Remove the %REM statement at the start of the Onselect subroutine and the %END REM statement at the end of the OnSelect subroutine. Your Onselect subroutine should be identical to the one shown in figure 36.
    Figure 36. The Onselect view subroutine after removing the %REM and %END REM statements
    The Onselect view subroutine after removing the %REM and %END REM statements
    The LotusScript statements and subroutines in the Onselect and Globals event handlers determine the sub-categories for the currently selected user and tally the number of documents per subcategory. This information is published as a property that can be wired to other components.

    TIP: The last statement of the Onselect event handler uses the name of the property you defined earlier. If you used a different property name when you created the WSDL file for NDForum.nsf, change the property name in the script to match.
  8. Save and close.

You have completed this lesson, and the property is published when a top-level category is selected in the view. Next, you add an Eclipse Tag Cloud component to your NSF-based composite application. The Tag Cloud component has actions and properties already defined so you can easily specify event/action relationships between it and other components.


Lesson 8: Add Eclipse components to the composite application

Composite applications in the Lotus Notes V8 client can include any combination of NSF components and Eclipse components. The components can also be embedded Web browsers or JSR168 or WSRP portlets. In this lesson, you add an Eclipse component to your composite application that already contains NSF components from Lotus Notes Contacts and NDForum.

Adding an Eclipse component to a composite application

Complete the following steps to add an Eclipse component to the component palette:

  1. In Lotus Notes V8, open the NSF-based composite application Customer Interests that you created earlier.
  2. Choose Actions - Edit Application to open the Composite Application Editor.
  3. If needed, expand the component palette of the Composite Application Editor.
  4. Right-click in the component palette, and then choose Add Components - "Add Components from Update Site."
  5. In the resulting dialog box, select Remote Update Site and type nrpc://localhost/8025731000495E97/site.xml in the URL field as shown in figure 37.
    Figure 37. The Update Site Details dialog box after URL input
    The Update Site Details dialog box after URL input
    This is the replica ID of TC_US_8.NSF, which is based on the Domino V8 update site template.

    TIP: You can also open TC_US_8.NSF in your Lotus Notes V8 client, and then choose Actions - Show URL. Click the button "Copy in the resulting dialog box" to copy the URL to the clipboard. You can paste this URL into the Update Site Details dialog box.
  6. Click OK. As seen in figure 38, the "Select Components from an Update Site" dialog box appears.
    Figure 38. The "Select Components from an Update Site" dialog box
    The 'Select Components from an Update Site' dialog box
  7. Select the Tag Cloud component, and then click OK. As seen in figure 39, the Tag Cloud component is listed in the component palette.
    Figure 39. The component palette includes the newly added Tag Cloud component
    The component palette includes the newly added Tag Cloud component
  8. Select the Tag Cloud component from the component palette, and drag it into the upper right of the composite application. The plug-in installation dialog box appears as shown in figure 40.
    Figure 40. The plug-in installation dialog box
    The plug-in installation dialog box
  9. Choose the option Install this plug-in, and then click OK. A progress dialog box displays indicating that the feature is being provisioned. When the provisioning is complete, the Restart dialog box appears.
  10. Click Yes when you are prompted to restart.
  11. After restarting the Lotus Notes V8 client, open the Customer Interests composite application. Your composite application, as seen in figure 41, includes the Eclipse-based Tag Cloud component that was developed in the Eclipse IDE.
    Figure 41. The composite application in Lotus Notes V8 with the newly added Tag Cloud component
    The composite application in Lotus Notes V8 with the newly added Tag Cloud component

You have completed this lesson and added an Eclipse-based component to your NSF-based composite application through the Composite Application Editor feature of the Lotus Notes V8 client.


Lesson 9: Wire Eclipse and NSF components in a composite application

In earlier lessons, you saw how components can be loosely coupled in event/action relationships specific to a composite application. The wiring capabilities of the Composite Application Editor feature can wire components of heterogeneous technologies. The property broker functionality of the Lotus Notes V8 client is the runtime environment. In this lesson, you wire the Tag Cloud Eclipse component to an NSF component from the NDForum application.

Wiring components in the composite application

Complete the following steps to form an event/action relationship between NSF and Eclipse components in your composite application:

  1. In the Composite Application Editor, select the "NDForum - Author Threaded View" component in the Navigation page, and then right-click and choose Wiring. As shown in figure 42, the Wiring Pane appears with NDForum as the source component that lists its single property. The Lotus Notes Contacts View component has no actions, and the Tag Cloud has six actions with the same namespace and datatype as the single property of the NDForum component.
    Figure 42. The Wiring Interface displays the components located on the current composite application page
    The Wiring Interface displays the components located on the current composite application page
  2. Wire the Publish Topics property of the "ND Forum – Author Threaded View" component to the Primary Data action of the Tag Cloud component as shown in figure 43.
    Figure 43. Wiring a property to an action
    Wiring a property to an action
    The wire between the Publish Topics property and the Primary Data action is displayed as seen in figure 44.
    Figure 44. The wiring interface displays the property and its wired actions
    The wiring interface displays the property and its wired actions
  3. Click OK to confirm the wiring updates and close the pane.
  4. Choose File - Finish Editing to confirm the changes to your composite application.
  5. A confirmation dialog box appears. Click Yes. After closing the Composite Application Editor, your updated composite application displays as shown in figure 45.
    Figure 45. The composite application, with additional wiring updates, in Lotus Notes V8
    The composite application, with additional wiring updates, in Lotus Notes V8TIP: You can resize the components within the composite application to your liking.

    To see the new event/action relationships created through your wiring changes, select a document in the Lotus Notes Contacts View component. The property is published from this component, and the selection in the NDForum component changes. The NDForum component also publishes a property triggered by the row selection change where the newly selected row is a top-level category in the Lotus Notes view. You wired this property to the Tag Cloud, and its action displays a list of subcategories for the selected user based on the content of the NDForum component.

You have completed this lesson and added a wire between the NSF component in the NDForum application and the Eclipse component in the Tag Cloud application through the Composite Application Editor feature of the Lotus Notes V8 client. This is in addition to the wire you defined earlier between the NSF component in the Profiles application and the NSF component in the NDForum application.


Lesson 10: Additional actions and wiring

The Tag Cloud component can also publish information as it has properties defined. The application user can select a displayed topic from the Tag Cloud that can be published as a property. The NSF component from the NDForum application can change the view selection to show the subcategory that matches the selected topic for the previously selected user. In this lesson, you add an additional action to the NSF component to change the view selection based on the tag selected in the Tag Cloud component.

Defining actions on a Lotus Notes view

Complete the following steps to define the logic for an NSF component action:

  1. In Lotus Domino Designer V8, open NDForum.nsf. The title for this Notes application is Notes/Domino 6 and 7 Forum.
  2. If needed, switch to the Views list by clicking Views in the designer pane.
  3. Select the view "2. Author\Threaded view," and press Enter to open it in design mode. If you select the refresh icon, your screen will resemble figure 46.
    Figure 46. The view named "2. Author\Threaded" in Lotus Domino Designer V8
    The view named '2. Author\Threaded' in Lotus Domino Designer V8
  4. Choose Create - Action - Action to add a new action to this view. The action pane opens, and the properties box appears for the new action as shown in figure 47.
  5. On the first tab of the properties box, type SelectSubCategory in the Name field.
    Figure 47. The basics tab of the Action properties box
    The basics tab of the Action properties box
  6. Deselect the "Include action in Action bar" and "Include action in Action menu" options.
  7. On the last tab of the properties box, select actSelectTopic in the Composite Settings Action Name field list at the bottom as seen in figure 48.
    Figure 48. The advanced tab of the Action properties box
    The advanced tab of the Action properties box
  8. Close the properties box.
  9. Click the newly created action SelectSubCategory in the action pane on the top right.
  10. In the Lotus Domino Designer programmers pane, select Client and LotusScript for this action. The Client option may already be selected. Your programmers pane should resemble the one shown in figure 49.
    Figure 49. The Click subroutine of the action named SelectPerson
    The Click subroutine of the action named SelectPerson
  11. Input the LotusScript code shown in listing 2 in the Click subroutine. The source code has been provided in the file SelectSubCategory_Action_for_NDForum.txt. You can paste this code into the Click subroutine.

    NOTE: The action script creates an object of the new NotesPropertyBroker class and uses the property published by the other component to change the view selection to the subcategory for the selected user.
Listing 2. Click subroutine code for SelectSubCategory action
Sub Click(Source As Button)
Dim ws As New notesuiworkspace, s As New notessession
Dim db As notesdatabase, uidb As NotesUIDatabase
Dim author As String, category As String
Set db = s.currentdatabase
Set uidb = ws.CurrentDatabase 	
Set doc = db.GetProfileDocument("SelectedAuthor", s.UserName)
author = doc.GetItemValue("SelectedAuthor")(0)	
'Handle error 4719, when the script is run without a property broker context
On Error 4719 Goto err4719
Dim pb As NotesPropertyBroker 'New PropertyBroker code   
Set pb = s.GetPropertyBroker
Dim pbInputProperty As NotesProperty, pbContext As Variant
pbContext = pb.InputPropertyContext   'array of NotesProperty objects
Set pbInputProperty = pbContext(0)    'handle to first NotesProperty object
Dim InputPropertyName As String, NameSpace As String  
InputPropertyName = pbInputProperty.Name   'name of NotesProperty object
Dim pbValue As Variant
pbValue = pb.getPropertyValue(InputPropertyName) 'array values of NotesProperty
category = pbValue(0)  'first value from array NotesProperty object
SkipPropertyBroker:
If category = "" Then Exit Sub
Call uidb.OpenView("2. Author\Threaded", author + "\" + category, False, False)	
Exit Sub	
err4719:
Print "Error " & Str(Err) & ": " &Error$
Resume skipPropertyBroker
End Sub
  1. Choose File - Save to save your view changes.
  2. Choose File - Close to exit design mode.

Wiring the properties and actions

Complete the following steps to create an event/action relationship between the Tag Cloud and NDForum components:

  1. In Lotus Notes V8 choose File - Open - Lotus Notes Application to open your Customer Interests composite application.
  2. Choose Actions - Edit Application to open the CAE feature.
  3. Select the Tag Cloud component from the navigator pane, right-click it, and choose Wiring. As seen in figure 50, the wiring interface appears with the Tag Cloud component selected as the source component.
    Figure 50. The wiring interface displays the components located on the current composite application page
    The wiring interface displays the components located on the current composite application page
  4. Create a wire from the Focused Entity property of the Tag Cloud Eclipse component to the "Select Topic for User action" of the NDForum.nsf component as shown in figure 51.
    Figure 51. Wiring a property to an action
    Wiring a property to an action
  5. Click OK to confirm your wiring changes. The wiring pane closes.
  6. Choose File - Finish Editing to confirm the changes to your composite application.
  7. Answer Yes to the confirmation dialog. After closing the Composite Application Editor, your updated composite application, as seen in figure 52, displays.
    Figure 52. The completed composite application in Lotus Notes V8
    The completed composite application in Lotus Notes V8
    To see the result of your updated wiring, first select a row from the Lotus Notes Contacts component, then select a topic from the Tag Cloud component. The NSF component from the NDForum application performs its defined logic and the row selection moves to the subcategory that matches the topic selected for the previously selected user.

You have completed this lesson and added an additional action to the Lotus Notes view that is used as an NSF component. You also wired this action to a property published by the Eclipse component for intercomponent communication.


Conclusion

You have completed all lessons in this tutorial and seen how composite applications and intercomponent communication works across application and system boundaries to provide a single context of collaboration to improve user and organizational effectiveness.

You have used the Composite Application Editor feature of the Lotus Notes V8 client with an NSF-based composite application that contains reusable NSF components and Eclipse components that are loosely coupled in an event/action relationship through wiring. You have also used Lotus Domino Designer V8 to extend existing NSF design elements to provide properties and actions that support intercomponent communication.


Download

DescriptionNameSize
sample applicationsample.zip5.46 MB

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into IBM collaboration and social software on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Lotus
ArticleID=262948
ArticleTitle=Building composite applications for IBM Lotus Notes V8
publish-date=10232007