Today, you can select from many calendar products or calendar services, including Lotus Notes Calendar, Microsoft® Outlook Calendar, Google Calendar, and Yahoo! Calendar. You might own two or three calendar products and services at the same time. For example, you might use Lotus Notes Calendar to collaborate with your customers and colleagues, but you might use Google Calendar to track personal events such as an anniversary or a party.
In this case you have to switch, often inconveniently, among different calendar products and calendar services to track all calendar events. To solve this problem, in this article we demonstrate how to create a composite application in Lotus Notes 8 that integrates multiple calendars from distributed sources. This composite application provides an integrated view in which you can track all events easily among all distributed calendars.
In this article, we use Lotus Notes Calendar and Google Calendar as examples.
Lotus Notes Calendar is used to schedule and keep track of meetings, appointments, all-day events, anniversaries, reminders, and event announcements (which are collectively referred to as calendar entries), all in one place. It is part of the Lotus Notes mail application.
Google Calendar is an online shareable calendar service. Using Google Calendar, you can add events and invitations, share them with friends and family (or keep things to yourself), and search the Web for events that you might enjoy.
When you install Lotus Notes 8, be sure to install the Composite Application Editor as well. Create the Lotus Notes mail database from the Lotus Notes 8 mail template. We assume that you are already familiar with IBM Lotus Domino® databases, Atom/APP, and XSLT.
We use a composite application to integrate the Lotus Notes Calendar Navigator, Lotus Notes Calendar View, Google Calendar Navigator, and Managed Browser. As shown in figure 1, the four components communicate with each other using the property broker in the composite application. Google Calendar Navigator retrieves the Google Calendar Atom feed, adds the Extensible Stylesheet Language Transformation (XSLT) schema to the feed file, and notifies Managed Browser to render.
Figure 1. Overview of the calendar composite application

Create the composite application database
First, start the Lotus Notes 8 client and open a New Application window as shown in figure 2. In the New Application window, enter the following:
- In the Title field, enter composite.
- In the Template field, select Blank Composite Application. Click OK.
Figure 2. Create the composite application database

To start the Composite Application Editor, select Actions - Edit Application. Rename the new application by selecting Edit - Page - Rename and then entering composite as the title.
Integrate Lotus Notes Calendar Navigator and Lotus Notes Calendar View
There are some built-in components with properties and actions in the Lotus Notes 8 Composite Application Editor. If you are using mail8.ntf as your mail template, the personal information manager (PIM) component is available by default. In the Composite Application Editor, expand the Component Palette to display the PIM components that can be added to the application. In the Component Palette, select Lotus Notes Calendar Navigator. Drag the Lotus Notes Calendar Navigator to the leftmost point of the blank application page. In the Component Palette, select Lotus Notes Calendar View. Drag the Lotus Notes Calendar View to the rightmost point of the application page. The layout looks like the one shown in figure 3.
Figure 3. Integrate Lotus Notes Calendar Navigator and Lotus Notes Calendar View

Components within a composite application can be wired together so that a user-initiated action in one component triggers a programmed action in another component. In this application, when the selected date in the Lotus Notes Calendar Navigator or Lotus Notes Calendar View is changed, the other component reflects the date change.
To create the wire between the Lotus Notes Calendar Navigator and the Lotus Notes Calendar View, right-click Lotus Notes Calendar Navigator in the navigation pane and select Wiring. Select the Selected data changed property of the Lotus Notes Calendar Navigator, and drag it to the Set selected date action of the Lotus Notes Calendar View. Select Lotus Notes Calendar View as the wire source. Select the Selected data change property of the Lotus Notes Calendar View, and drag it to the Set selected date action of the Lotus Notes Calendar Navigator. See figure 4.
Figure 4. Create the wire

Now you can test the wire that you just created. Exit the wiring page. When you change the date in Lotus Notes Calendar Navigator, the selected date is changed to the same date in Lotus Notes Calendar View. Similarly, when you change the date in Lotus Notes Calendar View, the selected date is also changed in Lotus Notes Calendar Navigator.
Integrate Managed Browser and view the Google Calendar
In this article, we use Managed Browser to view Google calendar. Managed Browser is a built-in component in the Lotus Notes 8 Composite Application Editor. To add Managed Browser, right-click the Component Palette and select Add Components - Add Locally Installed Components. Select Managed Browser and click OK. See figure 5. Managed Browser is then added to the Component Palette.
Figure 5. Add Managed Browser

Drag Managed Browser to the lower part of the application page. Select Managed Browser from the navigation pane and right-click. As shown in figure 6, select Edit Component Properties - Advanced and add the following property:
initialURL=http://www.google.com/calendar
Figure 6. Configure the managed browser

Now test the composite application as shown in figure 7. When the composite application is open, Managed Browser can open the login page of Google Calendar by default.
Figure 7. Test Managed Browser

At this point, the Lotus Notes Calendar and Google Calendar cannot communicate with each other. In the following sections, the composite application uses RSS and the Atom application programming interface (API) to read Google Calendar data and uses XSLT to render the Google Calendar data. After that, when the selected date is changed in the Lotus Notes Calendar, the date also changes in Google Calendar.
Get calendar data from Google Calendar to your personal Web navigator
In this section, you work with the Google Calendar Atom feed, XSLT, WSDL, and more to create and test your composite application.
As an online free shareable calendar service, Google Calendar provides abundant APIs and widgets to access its service. Your client application can use the Google Calendar data API to create new events, edit or delete existing events, and query for events in the form of Google data API (GData) feeds. GData uses either of two standard XML-based syndication formats: Atom or RSS. It also has a feed-publishing system that consists of the Atom publishing protocol plus some extensions (using Atomâs standard extension model) for handling queries.
The Atom publishing protocol uses HTTP to edit and author Web resources. The Atom publishing protocol uses the following HTTP methods:
- GET is used to retrieve a representation of a resource or to perform a query.
- POST is used to create a new, dynamically named resource.
- PUT is used to update a known resource.
- DELETE is used to remove a resource.
In this article, we retrieve events in a specified duration through the Google Calendar Atom API.
You can send an HTTP request such as the following one to a calendar service:
- URL:http://www.google.com/calendar/feeds/UserGoogleAccount/public/full?start-min=2007-09-11T00:00:00&start-max=2007-09-11T23:59:59
- HTTP Method: Get
Use XSLT to render Google Calendar data
We use the XSLT schema to render the Google Calendar Atom feed data. Add the following line to the feed file. The XSLT file is attached in the sample ZIP file.
<?xml-stylesheet type="text/xsl" href="gcal.xsl"?>
We saw the rendering shown in figure 8 when we opened the feed in the browser.
Figure 8. Render Google Calendar data by using XSLT

Get the Google Calendar feed in the navigator database
We use a Lotus Notes database to retrieve and cache the Google Calendar Atom feed data. Open Lotus Domino Designer 8, and select Create a new application. Enter Google Calendar Navigator as the title and gcalnav.nsf as the file name. Select Show advanced templates, and use perweb50.ntf as the template. See figure 9.
Figure 9. Create the navigator database

Create an action to get the Google Calendar Atom feed. Open the all page view, and select Create - Action - Action. Enter Reload Gcal as the Action name. Clear the Include action in Action bar and Include action in Action menu options. The code for the action is shown in listing 1. After the code is run, the action retrieves the feed file, full.xml, from the Google Calendar Atom feed. Itâs the whole dayâs calendar data of September 1, 2007. The XSLT schema line is also added to the feed file.
Listing 1. Action code
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
gcalurl$ =
"http://www.google.com/calendar/feeds/UserGoogleAccount/public/full?start-min=
2007-09-01T00:00:00&start-max=2007-09-01T23:59:59"
Dim xmlDoc As NotesDocument
Set xmlDoc = db.GetDocumentByURL(gcalurl$,1)
Dim xmlAttach As NotesEmbeddedObject
Set xmlAttach = xmlDoc.GetAttachment("full")
xmlAttach.ExtractFile("data/full.xml")
Dim fileNum As Integer
fileNum% = Freefile()
Open "data/full.xml" For Input As fileNum%
Input #fileNum%,xmlStr$
Close #fileNum%
Open "data/full.xml" For Output As fileNum%
xmlStr$ = Left$(xmlStr$, 38) + "<?xml-stylesheet type=""text/xsl""
href=""gcal.xsl""?>" + Right$(xmlStr$, Len(xmlStr$) - 38)
Print #fileNum%, xmlStr$
Close #fileNum%
End Sub
|
Create WSDL and expose the property and the action
From the navigation pane of Lotus Domino Designer 8, select Composite Applications - Wiring Properties - New Wiring Properties and enter gcalnav as the name. Select Open File to open the Property Broker Editor.
- In the Types tab, add a new namespace as shown in figure 10.
- In the Prefix field, enter
pfx. - In the Namespace field, enter
http://www.ibm.com/wps/eb.
- In the Prefix field, enter
- In the Types area, select NewType and enter the following:
- In the Name field, enter
InURLType. - In the Type field, enter
String. - In the Namespace field, enter
http://www.ibm.com/wps/eb.
Figure 10. Edit the WSDL file in the navigator database
- In the Name field, enter
- Select the Properties tab, and add the following two properties as shown in figure 11:
- LoadURLChanged property
- In the Name field, enter
LoadURLChanged. - In the Type field, enter
InURLType. - In the Title field, enter
LoadURLChanged. - In the Description field, enter
Load URL when Changed.
- In the Name field, enter
- SelectedDateChanged property
- In the Name field, enter
SelectedDateChanged. - In the Type field, enter
Date/Time. - In the Title field, enter
SelectedDateChanged. - In the Description field, enter
Selected Date Changed.
- In the Name field, enter
Figure 11. Add properties
- LoadURLChanged property
- Next, select the Actions tab and enter the following information:
- In the Name field, enter
Reloadonedaycal. - In the Title field, enter
Reloadonedaycal. - In the Description field, enter
Reload one day calendar. - In the Action Input Parameter-Property field, enter
SelectedDateChanged. - In the Action Output Parameter field, enter
LoadURLChanged.
Figure 12. Add actions
- In the Name field, enter
Save the WSDL file, and close the Property Broker Editor. Select Refresh, and select the WSDL file that you just edited. Open the property of the action Reload Gcal. Select the Advanced tab, and select Reloadonedaycal as the Action Name in the Composite Settings field. See figure 13.
Figure 13. Associate action

Add the Property Broker code to the action code.
The content of Reload Gcal is similar to the code shown in listing 2.
Listing 2. Reload Gcal code
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 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 NameSpace = pbInputProperty.NameSpace ânamespace of NotesProperty object Dim pbValue As Variant pbValue = pb.getPropertyValue(InputPropertyName) âarray of values of NotesProperty Dim cDT As NotesDateTime Set cDT = pbValue(0) âfirst value from array NotesProperty object gcalurl$ = âhttp://www.google.com/calendar/feeds/xinrangw%40hotmail.com/ public/full?start-min=â + cDT.DateOnly + âT00:00:00&start-max=â + cDT.DateOnly + âT23:59:59â â¦â¦Get Google Calendar feed and add XSLT schema lineâ¦â¦ Call pb.setPropertyValue(âLoadURLChangedâ,âc:\notes\data\full.xmlâ) Call pb.Publish() End Sub |
Add the Google Calendar Navigator to the composite application and wire with others
Now, return to the Composite Application Editor. Add the Google Calendar Navigator to the composite application. In the component panel, select Add Components - Add NSF Component. Enter the following:
- In the Component Name field, enter
Google Calendar Navigator. - In the Component Description field, enter
Google Calendar Navigator.
Select Browse following the Lotus Notes URL. Enter the following:
- In the Kind of object field, enter
Database. - In the Application field, enter
Google Calendar Navigator.
See figures 14 and 15.
Figure 14. Add component (1)

Figure 15. Add component (2)

Click OK twice. The Google Calendar Navigator then is added to the Component Palette. Drag the Google Calendar Navigator component to the lower portion of the application page.
Now you can create the wires to the Google Calendar Navigator component. In the navigation pane, right-click Notes Calendar Navigator, and then select Wiring. Select the Selected date changed option in the Notes Calendar Navigator, and then drop it on the Reloadonedaycal action in the Google Calendar Navigator. See figure 16.
Figure 16. Create wire from the Lotus Notes Calendar Navigator to the Google Calendar Navigator

Right-click Google Calendar Navigator, and select the Select as wire source option. Drag a wire from LoadURLChanged in Google Calendar Navigator to the Set URL to browser option and load in Managed Browser. See figure 17.
Figure 17. Create the wire from the Google Calendar Navigator to the Lotus Notes Calendar Navigator

You can test the composite application now. Change the date in Lotus Notes Calendar Navigator, and you see the same date in Google Calendar.
In this article, you learned how to develop a composite application in Lotus Notes 8.0 that lets you integrate Google Calendar and Lotus Notes Calendar based on the Atom API and XSLT technology.
| Description | Name | Size | Download method |
|---|---|---|---|
| Sample code | samplecode.zip | 1470KB | HTTP |
Information about download methods
Learn
-
Get started with IBM Lotus Notes and Domino V8 technical content.
-
Read the introductory article in this series, "The Lead Manager application in IBM Lotus Notes V8: An overview."
-
Read the developerWorks® article, "Designing composite applications: Component design."
-
Read the developerWorks article, "Designing composite applications: Design patterns."
-
Read the developerWorks article, "Designing composite applications: Unit testing."
-
Read the developerWorks article, "Designing composite applications: Writing an Eclipse component for IBM Lotus Notes."
-
Read the developerWorks article, "What's new in IBM Lotus Notes and Domino V8."
-
Read the developerWorks article, "Extending the IBM Lotus Notes V8 mail with Eclipse."
-
Read the developerWorks article, "Integrating IBM Lotus Notes data into the Lotus Notes V8 sidebar and toolbar."
-
Read the developerWorks article, "Extending the IBM Lotus Notes V8 sidebar and toolbar."
-
Read the developerWorks article, "Leveraging user context in the IBM 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."
-
Read the article, "What are the Google Calendar APIs and Tools?."
-
Learn more about the Atom Publishing Protocol.
Get products and technologies
-
Download a trial of IBM Lotus Domino.
-
Download a trial of IBM Lotus Notes, Domino Designer, and Domino Administrator clients.
Discuss
Ming Chen is a Staff Software Engineer working in the Beijing, China Software Development Lab. Ming has been the team lead of Lotus Connections System Testing Team in Beijing since December 2006. He joined IBM in 2005, and he as worked on system testing of IBM Lotus Workplace Business Controls & Reporting and IBM Lotus Active Insight. You can reach Ming at mingchen@cn.ibm.com.





