Introduction to the Notes Document Container 
|
|
ShowTable of Contents
The Notes Document container let you quickly add a Notes document such as a memo form or an appointment form to your composite application, and wire to elements of the Notes document. The container allows you to completely define the inputs and outputs directly within the Composite Application Editor - you do not have to create WSDL or use Designer to define your component. This tutorial will introduce the various concepts related to the Notes Document container and will describe how to use it in a composite application. Before getting started the following sections will define the various container concepts in the context of the Notes Document container, for a more general description of these concepts please refer to the InfoCenter
Supported landmark identifiers
The landmark identifier is used to generate a string that represents the current state of the Notes Document container. This string is compared to the landmark expression associated with the different landmarks in the container configuration. The following landmark identifiers are supported:
- $FORM – the current document’s form. This is the default landmark identifier.
- $URL – the current document’s URL (Notes://…)
- Any of the field expressions described below.
Supported actions
- Publish - this action is used to publish the value of a field to property broker.
- Receive - this action is used to set the value of a field to the value received from property broker. This action will work only if the document is being edited.
Supported field expressions
- ‘field:’ – this references the field in the Notes document.
- ‘formula:’ – this field expression can only be used with the Publish action. The result of executing the will be published. Note that the formula is evaluated against the backend document. Refer to the InfoCenter
for a list of available formulae.
Supported events
- contentComplete - this event is fired when the current document changes.
- dataChange – this event is fired when a field in the document is changed or if a property managed by the broker is changed. Publish actions defined in this event will be executed only for changes made to the associated field in the user interface. The Publish action will not be executed if the field is changed from code or script.
Understanding the Component Settings panel
The Component Settings panel can be opened by right-clicking the component in the Page Navigator and selecting 'Edit Component Properties'.
- Notes URL - this preference specifies the URL of the document to be loaded initially. The 'Browse' button can be clicked to launch a Notes database picker, this will return the URL for the database selected; the document section of the URL must be manually appended to the database URL.
- Close policy - this preference controls the way the view closes itself if the 'Esc' key is pressed or if the form closes itself (for example clicking 'Send' in the Memo form). The supported values are:
- ‘Close View’ - just closes the view. It can be reopened from the View menu -

- ‘Close Perspective’ - closes the entire perspective/page.
- ‘Reset View’ – closes and reopens the view. This is the default behavior.
- Remember last URL - this preference determines which URL to use when the container is reset or reopened, the URL of the last document displayed or the initial URL.
Configuring the container using the toolbar
When the Notes Document container is added to an application in the Composite Application Editor (CAE) a toolbar is displayed that simplifies tasks like adding an action to the current landmark, changing the current document, adding multiple Publish/Receive actions.
The quick configuration tool
The quick configuration tool allows the user to populate the standard events with Publish and/or Receive actions. It displays a selectable list of fields available in the current document, A property is automatically generated when a field is selected. The user can edit the generated property name or select one from the list of available properties. Note that the tool does not reflect the existing configuration for the current landmark and that using the tool will erase that configuration.
 Scenarios
Scenario 1Wiring a Notes View container to a Notes Document container
- Step 1: Create a new composite application
Open the 'File' menu and select 'Application' -> 'New' to open the new application dialog. Give the application a 'Title' and select 'Blank Composite Application' as the 'Template'. Click the 'OK' button and the application will be created and opened in the Notes client.
- Step 2: Add the components
Open the 'Actions' menu and select 'Edit Application'. The application will be opened in the Composite Application Editor (CAE). Drag a Notes View (Contact/Calendar/Mail) and drop it on the canvas. Then drag a Notes Document Container and drop it on the canvas. For this example, add a Notes Calendar View and hide the preview.
- Step 3: Wire the components
Right click the view component in the Page Navigator on the left and select 'Wiring' to launch the wiring perspective. Create a wire from the 'Notes url changed' property to the 'Set Notes Document URL' action. Click the 'Apply' button and switch back to the 'Blank Page' tab. The document selected in the Notes view component will be displayed in the Notes Document container.

Scenario 2Creating actions
- Step 1: Create a new composite application
Repeat the steps described in Scenario 1.
- Step 2: Create actions using the quick configuration tool.
The quick configuration tool can be used to create actions for multiple fields. Launch the quick configuration tool from the toolbar and select the actions and fields. The property name is automatically generated but can be edited. Click the Apply button, and then click the Refresh button on the toolbar to reload the application and activate the actions.

- Step 3: Create actions using the toolbar.
The toolbar can be used to easily create actions for a single field. Clicking on a field in the document will automatically populate the toolbar's field textbox. In some cases the contents of the field textbox change the moment the mouse button is released, in such cases the field should be selected using a drag gesture. Once the field has been selected, choose the appropriate events, action and property. Click the Add Action button, and then click the Refresh button to reload the application and activate the actions.

- Step 4: Create an action to publish the result of a formula.
Use the toolbar to add a Publish action. Use 'Body' for the property name and 'formula:@Count(RequiredAttendees)+@Count(OptionalAttendees)' for the field expression. This will return the total number of participants.

- Step 5: Review the landmark configuration.
Right click the Notes Document container component in the Page Navigator on the left and select 'Edit Component Properties', then navigate to the 'Landmarks' tab.

- Step 6: Test the actions against a second Notes Document container.
Add another Notes Document container to the application, by default it should show a blank memo. The actions will be tested against this Notes document. Use the quick configuration tool to add 'Receive on Data Change' actions for the 'Body', 'EnterCopyTo', 'EnterSendTo' and 'Subject' fields. Right click the first Notes Document container component in the Page Navigator on the left and select 'Wiring' to launch the wiring perspective. Create the following wires from the first Notes Document container to the second Notes Document container - 'Body' to 'Set Body', 'CC' to 'Set EnterCopyTo', 'To' to 'SetEnterSendTo', 'Topic' to 'SetSubject'. Finally click Apply.

Select a document in the Calendar view. It should display in the first Notes Document container and the memo in the second Notes Document container should be populated with information from the document in the first container.
Scenario 3 Adding a second landmark
- Step 1: Create a new composite application
Repeat the steps described in Scenarios 1 and 2.
- Step 2: Add a second view component.
For this example, add a Notes Contacts View to the application and wire it to the first Notes Document container (see Step 3 of Scenario 1).
- Step 3: Add the second landmark.
The second landmark can either be added manually from the 'Landmarks' tab in the 'Component Properties' dialog or using the steps described in Scenario 2. Publish 'field:InternetAddress' to the 'To' property and 'formula:"Hi "+FirstName+","'.
- Step 4: Review the landmark configuration.
Right click the Notes Document container component in the Page Navigator on the left and select 'Edit Component Properties', then navigate to the 'Landmarks' tab.

- Step 5: Test the application
Clicking on documents in the different views should change the document displayed in the first Notes Document container which in turn updates the Memo in the second Notes Document container.

|
|
|
|
| Version 11 |
October 29, 2009 |
3:35:09 PM |
by Robert F Harwood  |
|
|