Advanced Java view features in IBM Lotus Notes 8.5

Java™ views were introduced in the IBM® Lotus® Notes® client in release 8.0. Many new features were implemented through the Java views to modernize the Lotus Notes interface. After you have converted your application to use the Java view, you can follow the steps outlined in this article to take advantage of the new view features offered, such as threads, narrow mode, business cards, split action buttons, and custom context menus. This article presumes that you have an installed version of Lotus Notes 8.5, IBM Lotus Domino Designer 8.5, and the Lotus Notes 8.5 composite application editor. You should also be familiar with working in Lotus Domino® Designer.

Steve Castledine, Advisory Software Engineer, IBM

Steve Castledine is an Advisory Software Engineer with IBM. He is part of the Software Group, and currently responsible for growing the open source effort on OpenNTF.Org and demonstrating the value of Lotus Domino XPages. Previously Steve worked on projects to deliver Blog, Wiki, Notebook/Personal Journal and other PIM applications. You can reach Steve at steve.castledine@uk.ibm.com.



Margo Ezekiel, User Interface Designer, IBM

Margo Ezekiel is a User Interface Designer, working on the IBM Lotus Notes and iNotes Mail clients. She designed the Lotus Notes 8.0 Mail Client, using the Java view features outlined in this document. She worked with Steve Castledine to update the Personal Journal (aka Notebook) application in Lotus Notes 8.5.



29 June 2009 (First published 17 February 2009)

Also available in Chinese Russian Japanese Portuguese

Editor's note: Know a lot about this topic? Want to share your expertise? Participate in the IBM Lotus software wiki program today.

Introduction

This article presumes that you have read the companion developerWorks® article, "Basics Steps: Converting an IBM Lotus Notes application to use Lotus Notes 8 Java components," and and that you have performed the steps listed there.


Add the side preview option

Now that the modifications are complete, you can go back to Lotus Domino Designer to make further modifications.

You can add a Show drop-down action to the right side of your action bar to allow users to show a preview on the bottom or on the side.

Follow these steps:

  1. Select File - Exit from the Lotus Notes client.
  2. Open the notes.ini file (in the directory where Lotus Notes is installed) in an editor, such as Notepad.
  3. Add the following setting to the file: Designer_ShowPropForJavaViewsUI=1.
  4. Save your changes and close the file.
  5. Open Lotus Domino Designer and open your new application.
  6. Select View in the Navigator.
  7. Double-click to open one of the views.
  8. Select File - Properties and switch to View.
  9. Select the Show Vertical/Horizontal switcher option to add this option to your application.
  10. Complete the action described in the previous step for each view in which you want to select this option. See figure 1.
Figure 1. Lotus Domino Designer: Select Show Horizontal/Vertical switcher
Lotus Domino Designer: Select Show Horizontal/Vertical switcher

Dynamically size one column

In Lotus Notes 8, in the mail views, you marked the Subject column to be dynamically sizeable, so that as the user resized the list view (by making the sidebar wider or narrower) the Subject column would grow or shrink, allowing all the other columns to be the same width. This step enabled fluid resizing without introducing a horizontal scroll bar.

As the user shrinks the view, this column continues to shrink until it reaches its minimum width. Then, the software switches the view to narrow mode.

To set this dynamically sized column, follow these steps:

  1. Open Properties for the column that you want to be dynamically sized.
  2. Select the option Extend to use available window width.

Create narrow views

In addition to being able to see a preview on the side, Lotus Notes 8 introduced narrow views in the mail views. The narrow views allow users to see their mail without the traditional column headers and with more information stacked.

For each narrow view, you need to specify:

  • Where to put the column – that is, to keep it on the top row, wrap it to the second row, or hide it all together. This positioning is done using the setting If view is narrow in the column properties (tab 6). The options are Keep on top, Hide this column, and Wrap to second row.
  • If this field stays on the top row, whether the second row should be vertically justified to start directly beneath it. Again, this option is set under the column properties, tab 6, setting: Justify second row under this column as shown in figure 2.

    Figure 2. Second row alignment
    Second row alignment
  • The order of operations – that is, which column is handled first, which column is handled second, and so on. For example, you can set the view up so that one column wraps first, and then as the view narrows, a second column hides, and when it narrows further, a third column wraps, and so on. You can use the sequence control to label the columns as the first, second, or third, as shown in figure 3.

    Figure 3. Defining the order of operations
    Defining the order of operations

Add actions to the Show drop-down window

In Lotus Notes, we’ve added more actions to the Show drop-down window, which allow users to control their views. "Unread Only" is an example of an additional action. See figure 4.

Figure 4. Show drop-down on action bar
Show drop-down on action bar

To add an action to the Show drop-down window, open the Shared Action properties box. Then, select the property Right align action control as shown in figure 5.

Figure 5. Showing an action in the Show drop-down
Showing an action in the Show drop-down

Modify columns

You can also set some new attributes for your columns. You can see these attributes used in the Mail 8 template. These settings display in the Attrs: field for the Column properties.

There are five new choices as shown in table 1.

Table 1. New column attributes available for Java views
SettingDescriptionExample
$ThinColumn=true Makes a thin column$ThinColumn=true example
$MaskSelectionColor=true Makes a row highlight bar not visible on this column$MaskSelectionColor=true example
$TypeHeaderIcon=index:colicon1:129Puts an icon in a column header$TypeHeaderIcon=index:colicon1:129 example
$ShowGradientColor=true Adds gray background to a column$ShowGradientColor=true example
$ShowThreadTwistie=true Displays a twistie icon in the column$ShowThreadTwistie=true example

To make these changes, select the column that you want to change and then follow these steps:

  1. Select File - Properties, and then select Column.
  2. In the Attributes area (labelled Attrs:, tab 6), you can insert any of the attributes shown in table 1. If you want to use multiple attributes, separate them with a semicolon.
  3. Notice that there are also settings for adjusting the view when it is in narrow mode.
  4. Save your changes by closing the view.

Create a business card view

Lotus Notes 8 introduced a business card view in the Contacts area. You can also create business card views for your applications.

The viewer that defines how the view is displayed can be set in the View properties window in the Viewers field as shown in figure 6. The applicable viewers to list here are Table, Tiled, or Calendar. If no viewer is specified, then Table is used as the default (a standard view). You can also combine them by separating the entries with a semicolon; the viewers then display on the Show menu as options.

Figure 6. Controls to show business card view
Controls to show business card view

For each column in the view, you need to specify where to display the field (top, bottom, or hidden) and on what line as shown in figure 7.

Figure 7. Formatting the column and field in the tiled (business card) view
Formatting the column and field in the tiled (business card) view

Create tabbed or alpha views

The Lotus Notes 8 contacts view has alpha tabs that display to the left of the view (see figure 8). Clicking a letter in the alpha tab filters the view to that letter.

You can also have alpha tabs in your views by selecting Show Tab Navigator in the View properties. See figure 9.

Figure 8. Alpha tab
Alpha tab
Figure 9. Tabbed navigator views
Tabbed navigator views

Turn on threads in a view

In Lotus Notes 8, we introduced threaded views, integrated into the inbox as shown in figure 10.

Figure 10. Threaded view in the inbox
Threaded view in the inbox

You can use these threaded views in your application but with restricted use because the current design is targeted only for the mail template. For example, the text "messages in this conversation" is currently fixed.

Start by selecting the Support Response Thread History option for your application. You can make this selection in the Database properties window, as shown in figure 11.

Figure 11. Selecting the Support Response Thread History option
Selecting the Support Response Thread History option

Selecting this option creates an internal cache or index for the threaded views. By default, this cache goes back only seven days. You can change the default setting by adding the ini MAX_DAYS_FOR_THREAD_CONVERSATIONS=365 (or different high value to specify the number of days) to Notes.ini.

Assuming that you have already created an application that surfaces the Java views by following the steps in this and the previous article, you need to add two views to your application. One view controls how the threaded view looks, and the other view acts as the response hierarchy index.

Create a new view in your template (using the default design) and call it ($ThreadsEmbed); make it hidden by surrounding it with brackets. Select the properties Show response documents in a hierarchy and Show partial response hierarchies as shown in figure 12.

Figure 12. Settings for the new $ThreadsEmbed view
Settings for the new $ThreadEmbed view

For the column that is your subject or topic, go to the properties and enter $ThreadSubject=true in the Attrs field. See figure 13.

Figure 13. Setting the $ThreadSubject attribute
Setting the $ThreadSubject attribute

Create a second view (again using the default design) and call it (Threads); select the Evaluate actions for every document save and Show response documents in a hierarchy options for this view, too.

You then need to add a property to your composite application XML file. Follow these steps:

  1. Select Actions - Edit Application.
  2. Select the view component and right-click Edit Component Properties.
  3. From the Advanced tab, add the property com.ibm.rcp.csiviews.viewpart.threadurl with a value of notes:///0000000000000000/Threads?OpenView. See figure 14.
  4. Select File - Save & Close.
Figure 14. Adding the XML property threadurl
Adding the XML property threadurl

Next you need to configure the visible view that you want the threaded view to work with. In the View properties window, do the following as shown in figure 15:

  1. Clear the Show response documents in a hierarchy option.
  2. Select the Show Vertical/Horizontal switcher option.
  3. Select ($ThreadsEmbed) in the Thread View field.
  4. Select the Allow conversation mode option.
Figure 15. Specify the view to show on twistie expansion
Specify the view to show on twisty expand

You also need to add a column where you want the twistie to display to allow the user to select the threaded view. To do this task, follow these steps:

  1. Add a column with a value of "" (nothing).
  2. Make the column a size of 1.
  3. In the Attrs field, enter $ShowThreadTwistie=true. See figure 16.

    Figure 16. Setting the twistie attribute
    Setting the twistie attribute

Then you might want to use the Conversation v Messages options that are visible in the mail client in the Show menu. Conversations show only the latest response for each e-mail conversation. Messages show everything. These are standard actions with the property Right Align action control selected. They set the environment variable $VIEW_CONVERSATION_MODE to 1 for Individual Messages and 2 for conversation mode.


Add separator lines to the navigator

In the navigator for your application, you can add separator lines between entries as shown in figure 17.

Figure 17. Separator lines in the navigator
Separator lines in the navigator

To do this, open Lotus Domino Designer and follow these steps:

  1. Click Shared Code.
  2. Click Notes Mail Outline.
  3. In the Outline Entry, select the Display separator above this entry option to add a separator line in your navigator.

Create right-click context menus in views

By default, right-click context menus include the default items such as document properties. You can turn these defaults off and select your own menu items, with images and submenus.

First, you need to turn off the default items:

  1. Open Lotus Domino Designer.
  2. Open Action Bar Properties.
  3. Clear the Show default items in right-mouse menu option.

Then you turn on individual actions to display in the context menu using the setting Include in right mouse button menu. This setting can be found in the action properties box.

You can create icons and submenus as you would for any Lotus Notes action bar menus. For complex menus it might be easier to create separate right-click entries in the action bar so that you can use specific icons and separation.

You can also right-align text for keyboard shortcut information by including @Char(9) between your Label and your shortcut as shown in the Label field in the Action properties window in figure 18. Figure 19 shows the final content menu.

Figure 18. Right-aligning a shortcut in the content menu
Right-aligning a shortcut in the content menu
Figure 19. Final right-click context menu
Final right-click context menu

Conclusion

This article has outlined individual steps that allow you to customize and modernize your applications. You should now have many of the tools available to make your custom applications look like the Lotus Notes 8 native PIM applications (Mail, Calendar, Contacts, To Dos, and Notebook).

Resources

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, Java technology
ArticleID=370050
ArticleTitle=Advanced Java view features in IBM Lotus Notes 8.5
publish-date=06292009