This topic describes how to use live text in composite applications.
Composite applications give components the capability to exchange information or properties with one another through pre-configured wires. Components within an application can then react to a user’s actions in a common way. With composite application Click to Action and the new Live Text feature, users can invoke any action that takes a String input on any piece of text. This article will discuss how to use Live Text in your composite applications.
Live Text is a new feature available in Lotus Notes 8.0.1. This feature recognizes patterns in text and enables the user to perform actions on them. A sample use of this is the mapping of Live Text to a Widget. Widgets are tools that can be added to the Notes sidebar and be configured to act on Live Text. For example, you may add a Google Maps widget to your client. When Live Text is enabled and a document contains an address you can click on this address and have it open in Google Maps. Live Text and Widget integration can also allow you to click on a name and look it up in a directory or click on a shipment number to track a package.
Lotus Notes has a set of built-in recognizers that identify names, phone numbers, addresses, email addresses and websites and enables them as Live Text. Users can add new Live Text content types by adding their own recognizers to identify a particular text pattern.
You can see in the image below what a document with recognized live text might look like.
In order to use Live Text in a composite application or at all, you must first ensure that it is enabled. This can be done through the Notes preferences. For more information on Live Text and Widgets see the Notes documentation.
Let’s walk through the creation of a composite application with Live Text integration. This feature is only available on Notes 8.0.1 or later.
First, create a new blank composite application.
To add components to your blank application select Actions -> Edit Application. This will open the application in the Composite Application Editor (CAE).
CAE allows you to edit your application, add components, and modify properties. Components can be dragged from the Component Palette on the right hand side of the CAE window and dropped onto the component in the center view. For this sample we will add three components. The first component, seen at the top of the application, is the Wire In Form Browser Container sample. This is essentially a web application that was defined declaratively in a plugin.xml file. It contains a web form with a set of wireable fields. Please see the Lotus Expeditor documentation for more information on the Browser Container.
The second component, on the bottom left, is the Notes Mail View PIM component. We will use an email in this component to demonstrate Live Text.
Finally, the third component is a managed browser.
Once all of the components have been placed on the application, we want to edit the component properties of the Wire In Form. Right click on the Wire In Form component in the CAE Navigator area on the left side of the CAE window. Select ‘Edit Component Properties’ to display the component properties dialog shown below.
On the Advanced tab we can select, from all defined actions, which actions we want the ability to wire. We will select name, comments and email, etc. Once you have selected your desired actions click on the Wiring tab.
This wiring tab is where you can map Live Text content types to the actions you just enabled and really beginning using the Live Text feature. From the wiring tab select ‘Set Email’ and click on the Map Content Type… button. The ‘Map Content Types to an Action’ dialog allows you to choose what type of live text should be used to call your action. In this case, the selected action is ‘Set Email’ so it makes sense to select the recognized type of Email Address. Click ok. This will map the E-mail Address type recognized by Live Text to the Set Email action of the Web In Form component.
Repeat these steps to map the Name, Phone Number and Text Selection content types to the appropriate actions. After mapping all desired types press OK followed by File -> Save and Close. CAE will exit and the application will be displayed in Notes.
The screen shot above shows the open application. Notice how Live Text is indicated in the email on the bottom left. If you hover over the blue button next to the e-mail address highlighted as live text some tool tip text appears. When selected, a context menu appears, as seen below, that has a series of operations in it. The very top action is ‘Set Email’. This has been added to the menu because of the mapping we created in CAE. The composite application infrastructure contributes the appropriate actions to this menu when a mapping from a Live Text content type to an action is made. All of the other menu items you see are base Live Text functions.
We can select the actions from the Live Text context menu and they will be invoked as expected. If you click on t he name, phone number and email address in the Notes document the associated Wire In Form fields are populated as shown in screen shot below.
Another aspect of Live Text is the text se lection content type. Text selection refers to any block of text in a document. You can highlight a piece of text in a document, right mouse click and select any availa ble actions from the menu. If you map an action to a text selection type th at action will appear in the right click menu. For our sample we mapped text selection to the ‘Set Comments’ action of Wire In Form as well as the ‘Set HTMLText’ action of the Managed Browser. After selecting the ‘Set HTML Text’ action, the selected text appears in the Managed Browser view.
Click to action (C2A) capabilities in composite applications can be very powerful and useful. It allows users to perform actions when they want and invoke whatever actions they choose from those available. The composite application infrastructure and CAE have taken this to another level by adding a layer on top of the Notes Live Text feature that allows assemblers to put click to action capabilities on live text in their applications. The capability now exists for essentially any piece of text in any document to invoke actions in application components.