Using Live Text and Widgets to improve productivity of daily work
Fei Fu (firstname.lastname@example.org), Software Engineer, IBM
Ming Quan Rao (email@example.com), Software Engineer, IBM
Peng Yu (firstname.lastname@example.org), Staff Software Engineer, IBM
This article walks you through using Live Text and Widgets features to improve productivity of daily work without programming. The article requires that Notes 8.5 is installed into your computer because all steps and screenshots in the article derive from Notes 8.5.
There usually are many interested texts in an e-mail and other electronic documents, such as address, email, organization name and person name etc., we often need copy by hand these texts to other electronic documents or other applications in daily work, and the manual copying is prone to error and inefficient. Since Lotus Notes 8.0, these texts can be recognized as Live Text which is underlined and can be transferred to other interested applications such as search engine by one click. Notes 8.5 steps further, user can create a composite application to host related components, and wire these components up, and then Live Text in one component can be transferred to other interested components by one click. This article will introduce how to make full use of Live Text and Widgets in Notes 8.5 in order to improve productivity of daily work without programming.
Live Text and Widgets Introduction
Live Text feature enables Notes to recognize pre-defined text patterns, for example, address, from end user's point of view, he or she can see that the recognized text patterns are underlined that differentiates it from normal text. A pre-defined text pattern is called a content type, for example, address, email, URL, etc., Live Text is a recognized text segment that matches a certain content type, there are many built-in content types in Notes 8.5, and you are also capable of creating new content types, we will detail it in later paragraphs.
Widgets feature enables Notes to add useful actions on Live Text, for example, send address (provided Live Text is recognized as an address) to Google Map and find its location in map, from end user's point of view, he or she can see that additional actions are added into the context menu of Live Text so that end user can publish Live Text to external. A widget consists of one component and one or more actions, component could be a web page, a Notes document, a Google Gadget and so on, action is a kind of method to handle Live Text, one action could only handle one specified Live Text that matches specified content type. The next section will detail how to wire action to specified content type.
Live Text and Widgets features are not enabled by default in Notes 8.5, so we must enable it prior to use them. Let's start.
In Notes, click "File->Preferences…" to open the preference dialog, select "Live Text" preference page, and then check “Enable Live Text by default for all opened documents”, it will enable Live Text feature in Notes. See figure 1
Figure 1 – Enable Live Text
Next, select "Widgets" preference page, enable “Show Widget Toolbar and My widgets Sidebar panel”, it will enable Widgets feature in Notes. See figure 2.
Figure 2 – Enable Widgets feature
Now, you can see "My Widgets" panel in the sidebar of Notes, click its icon to expand it in sidebar, click its options menu, and check “Recognize All Content”, see figure 3, it allows all content types of Live Text to be recognized and underlined.
Figure 3 – Recognize All Content
One point should be noticed, Live Text can be recognized in a document only when the document is in read mode, that is, Live Text can not be recognized if document is in edit mode. The other point should be noticed is that not all texts in Notes document could be recognized. The following texts in a document could be recognized as Live Text:
- Text in the form design, such as labels.
- Computed text on the form.
- Contents of data fields in the document with a few exceptions (see the following list).
The contents of the following data fields will not be recognized:
- Hidden fields.
- Any native operating system style fields including the List box and fields in a layout region.
- Checkbox fields.
- Radio button fields.
- Names fields including Reader and Author fields
In the options menu of "My Widgets
" panel, see figure 3, if you click "Manage Actions, Content Types, and Recognizers
", a new tab "Widgets Management
" will be opened in Notes, click the child tab "Content Types
", it lists all built-in content types of Notes, see figure 4. Because we have done above configuration, these built-in content types take effect immediately. For these built-in content types, you can only enable or disable them in the child tab "Content Types
", you can't remove them. If you find these built-in content types do not meet your requirement, you can create customized content types and recognizers as well, a recognizer defines a string which consists of regular expression to recognize the specified text pattern as Live Text, and it also determines how the specified text pattern is recognized. The following paragraph introduces how to customize a new content type and recognizer.
Figure 4 – All built-in content types
In tab "Content Types", click button "New Content Type…", the dialog "Configure a Content Type" pops up, see figure 5, input the name of the new content type, and click button "OK", as a result, you can see the newly added content type in tab "Content Types".
Figure 5 – Add a new content type
Now, we get a new content type, we also have to create a new recognizer to recognize our new content type. Let's go to the tab "Recognizers", click button "New Recognizer…", the dialog "Configure a Recognizer" shows up, see figure 6, input the name as you want, in the immediate drop down list "Choose a Content types", choose our new content type, and in the text box "Enter a regular expression", input a string of regular regression as your business logic needs. In our case, to make our sample simpler and more understandable, we just input a literal string "Hello World", so the new recognizer wou ld recognize string "Hello World" in Notes documents as Live Text.
Figure 6 – Configure a recognizer
With the new content type and new recognizer created, we can see that “Hello World” in document will be underlined and recognized as Live Text, see figure 7.
Figure 7 – Customized Live Text is recognized in Notes document
Contribute actions to Live Text
With above section, you should know how to enable Live Text and recognize it in normal Notes document. Obviously, only recognizing Live Text is little useful for Lotus Notes users, they need know contribute some interested actions to Live Text, these actions should be able to make use of Live Text to process user task. This section is going to walk you through adding actions in the context menu of Live Text step by step, for better demonstration, this section assumes a scenario where user sends Live Text to Google search engine and search it by one click.
Ok, let's start, open "My Widgets" panel in the sidebar, click its options menu and then click "Configure a Component from…->A Web Page"，Lotus Notes opens a wizard which walks us through all configuration options, this wizard includes multiple pages. In the first page, select "Web page by URL" and input Google search web page URL in the text box, see figure 8, then click "Next" button.
Figure 8 – Configure Google as a component from URL
In the next page of this wizard, select "From a form on this web page", click "Next" button, the wizard goes into the third page, in this page, we can preview the Google search engine web page, all of the forms in the web page are listed by number in upper "Form" list, Google search web page has only one form, so we can see form "1" in the Form list, just select it, as a result, the input box in Google search engine web page is highlighted in green, see figure 9, then click "Next" button.
Figure 9 – Select a form in Google web page
In the next page, input "Component name" as "Google Search", in "Component Settings" section, select item "q", this item represents the input box in Google search web page where users input searching keyword, change its "Display name" as "keyword", in "What do you want to do with this component" section, select "Wire as an action", it allows us to further configure an action contributing to the context menu of recognized Live Text, otherwise, wizard will ends up with Google search added in sidebar or "My Widgets" panel, figure 10 displays the configuration options in this page, go ahead to next page.
Figure 10 – Configure Google search component
In the next page, change "Action name" as "Search with Google", select "Recognized content", it means using recognized Live Text as keyword to search with Google. In the imme diate following dropdown list, select a kind of content type of Live Text, we select "Organization" in this case. As a consequence, "Content property" dropdown list is filled with properties of content type "Organization", we select property "contents", it represents the whole of Live Text rather than one part. The "Component property" dropdown list defaults to property "keyword" which is set in previous page. In "Where do users see the result of this action" section, select "Tab", it means Lotus Notes will open a new tab to show the results after the action is invoked. See figure 11, then click "Finish" button.
Figure 11 – Wire Google search action to Live Text
Now, the configuration is over, a new component named "Google Search" is added to "My Widgets" panel. Click the options menu of "My Widgets" panel, and then click menu "Manage Actions, Content and Recognizers", it opens a new tab "Widget Management" in Lotus Notes, in the child tab "Contents and Actions", we will find the newly added component "Google Search" and action "Search with Google", see figure 12, we can edit both of them there if we like, of course, we can remove them there.
Figure 12 – Widget Management
We did so many configurations; it is time to see the effect. Create a new Notes document to include some organization name in the body, such as "IBM", "Google", etc., save the document and open it again, do not go into edit mode because Live Text can't be recognized when Notes document is in edit mode, then we will find these organization names are underlined, it indicates exactly they are recognized as Live Text. Hover your mouse on the recognized organization name, a small downward arrow appears in the right, click the small downward arrow, the special context menu of Live Text appears, we may find menu "Display content.org Properties", it indicates the underlined text is recognized as content type "Organization", what's important, in the top of context menu is the newly added action "Search with Google", see figure 13, just click it, consequently, a new tab appears in Lotus Notes, the new tab is just as same result page as we search the underlined text in Google.
Figure 13 - Live Text and its context menu
Live Text in composite application
Composite Application (henceforth referred to CA) can aggregate a set of components (or applications) into one application. The individual components and the interactions between these components can work together to implement complex business logic as defined by a business user. In this section, we assume you are familiar with composite application, if you aren't, you can get related links about composite application in below resources section,
This section introduces how to integrate Live Text in composite application, it is a new feature of Notes 8.5, and this feature is not available in Notes 8.0.1. As you may know, we can aggregate various existing applications together within a single application which is called composite application. The original applications are called components of the composite application. The layout and wires between each component can be designed during the aggregation time in composite application editor (henceforth referred to CAE). Each component can publish properties and provide actions to receive properties. Assembler can wire the properties and actions together. Once the properties are published from one component, the wired actions are triggered. In composite application, you can add a component contains Live Text and wire it with actions provided in other components, then additional actions will be contributed to context menu of Live Text, once you click the actions in the context menu of Live Text, the value of Live Text can be published to the wired actions. This way, user can trigger the wired actions via Live Text.
Let’s create a simple sample to see how to use Live Text in CA.
Create a new CA by selecting: “File->Application->New…”, select the template as “-Blank Composite Application-”, select “Actions->Edit Application” to edit the CA. CAE will be opened.
In CAE, drag the “Managed Browser” component and “Notes Mail View” Component into the CA, see figure 14.
Figure 14 - Drag CA components and set CA layout
You can see that we already have some mails in mail Inbox and in the preview panel, there are some text been recognized as Live Text. In this sample, we will use the text “http://www.ibm.com” which is recognized as “Web site” Live Text.
Managed browser happens to host many build-in actions. We can wire the Live Text with these built-in actions. Now, let’s do it.
In Page Navigator of CAE, right click the component “Managed browser”, select “Edit Component Properties”, the component property dialog pops up. In the “wiring” tab, all the actions which can be wired to Live Text will be shown in the child tab “Live Text Integrate”. They can be wired to all the Live Text which can be recognized. Let’s select “Set URL to browser and load” action, click “Map Content Type…”, map the “Web Site/Web Site” to this action. Now, we have wired the “Web Site” Live Text content type and the “Set URL to browser and Load” action together. See figure 15.
Figure 15 – Wire the Live Text to Managed Browser actions
Save the CA and close CAE. Let’s see how to trigger the action via Live Text.
In the CA page, move the mouse cursor over the text “http://www.ibm.com”. As it has been recognized as Live Text which content type is Web Site, there will be a small arrow appear in the right of the text, click it, a menu will pop up consequently. All the actions which were wired to the Live Text can be shown at the top of the menu. Select the action you want to trigger, and then the corresponding action will be triggered.
In this sample, click “Set URL to browser and load (Web Site/Web Site)”, the URL “http://www.ibm.com” will be sent to the managed browser which is in the right part of the CA and the URL will be loaded in managed browser. See figure 16 and 17.
Figure 16 – Select the action which is wired to the Live Text
Figure 17 – Action has been triggered by Live Text
Live Text and Widgets are helpful for us to improve productivity of our daily work with Notes 8.5, Integrating these feature in composite application further improves our productivity.
Get products and technologies
About the authors
Fei Fu is working on Lotus Expeditor testing team in IBM China Software Development Lab, he has 6+ years experience in software development and testing. He is familiar with Java, JEE and Eclipse development, and he is interested in Open Source Software, Rich Internet Application and Web 2.0 technology. He likes seeing movies at his leisure.
Ming Quan Rao is a software engineer from Lotus team at the IBM China Software Development Lab in Beijing. His working experience includes Workflow, Office Automation, OSGi/SMF, IBM Lotus Expeditor Client and Composite Applications.
Peng Yu joined the IBM Lotus branch of the China Software Development Lab in Bejing in 2004 as a software engineer. He focuses on software testing on the Eclipse platform and Java technologies. He is also interested in user-interface design, design pattern and algorithmic research. He received his master's degree in computer science from NanKai University.