Portalizing Domino Applications for Websphere Portal

 < Day Day Up > 


5.5 Domino Rich Text

Domino Rich Text fields can contain formatted text, collapsible sections, embedded objects, file attachments, and pictures. Rich text is widely used in Domino applications, so it is important to be able to display it in a Portlet.

In Chapter 1, "Introduction to portalizing Domino applications" we introduced the concept of Portlet patterns. We outlined that in a Portal environment there are two main ways to display content:

In this section we discuss both optionswith respect to Domino rich text display.

Using the Portlet Display pattern

Following the Display pattern and opening content in a new browser window has the following requirements for the Domino application:

You also need to consider that:

Using iFrames

An alternative to opening a new browser window is the use of an iFrame Portlet. This approach still follows the Display pattern, but has a more seamless integration with the Portal. But you need to be aware of the following limitations of iFrame Portlets:

Embedding content into a Portlet

In this section we discuss integration methods that follow the Integrated pattern.

What options do we have to embed rich text inside of a Portlet?

One option is to display rich text as plain text only. This is useful, for example, for displaying abstracts. To accomplish this we can use:

Note 

The Domino 6 Tag library has a <Domino:richtext> tag to display rich text, but formatting is displayed only if the rich text was created using the RichText Java applet or the Microsoft rich text control.

In this case the rich text is saved as MIME (Multipurpose Internet Mail Extensions) inside of a Rich Text field. Programmatically you can access these items as Item, RichTextItem, or MIMEEntity objects.

Using the richtext tag to display rich text that was created with a Notes client will show plain text only. That means all formatting, images, sections, and URLs are lost.

To keep all the formatting and features of Domino Rich Text we have to take a different approach. Domino Rich Text is a very complex structure that can be programmatically accessed by using the Domino backend classes for Java.

Nevertheless the only way to convert Rich Text into HTML is to use the Domino HTTP task.

Displaying rich text using HTTP

The following steps outline how you can get the HTML representation of the Domino Rich Text. This approach has to be implemented in Java. Figure 5-12 illustrates the process.

Figure 5-12: Embedding Domino rich text inside of a Portlet

  1. Open a URL connection to retrieve the HTML for an entire Domino document.

  2. Parse the HTML for the rich text field that you want to display.

    To find the HTML that corresponds to the rich text field, it is best practice to indicate the start and end of the field by adding an HTML comment around the field on the Domino form.

  3. Pass the resulting HTML to the JSP page for display.

After you have implemented this solution you will find that the formatting of the text is now displayed correctly, but that all Images are broken. The reason for this is that the HTML you retrieved from the Domino HTTP included relative URL references only. Since you are now displaying the captured HTML relative to the Portal server's HTTP task, the URLs can't be resolved.

You can solve this problem in either of the following ways:

Either of these techniques will solve the image URL problem and display the images correctly.

URL rewriting

The second option (URL rewriting) has the disadvantage that the user's browser will need to be able to communicate with the Portal server HTTP and the Domino server HTTP as well. This communication pattern might be prevented by firewall rules, as illustrated in Figure 5-13.

Figure 5-13: Potential firewall issues

Since the image reference is referring back to the Domino server's HTTP task, the browser needs to be able to access the Domino HTTP server to display the image.

This also implies that the user needs to have access rights to the Domino server and database in which the image resides.

The URL challenge

But we still have an even bigger challenge ahead of us. Specifically, all the URLs in the HTML produced by Domino HTTP server are not Portal compliant. That means that if a user clicks on a link inside of the Rich Text, the called URL will take over the entire browser URL. As a result, the Portal interface is lost.

The workaround for this problem is illustrated in Figure 5-14.

Figure 5-14: Rich Text display with reverse proxy and URL re-writing

The discussion shows that Domino rich text integration into Portlets is a complex and potentially challenging procedure.

IBM is currently working on a solution that will allow easy Domino rich text integration. Third party vendors like CONET have also implemented solutions for seamless rich text embedding in their products.


 < Day Day Up > 

Категории