Transforming a Rich Text field from a Lotus Notes form to Infopath

Transforming a simple text field from a Notes form to an InfoPath form is relatively easy. So how do I take a Notes Rich Text field and transform it into a InfoPath Rich Text field? Also, how do I ensure it will work on a web form? This is not so easy and it may not always work if the Notes Rich Text field contains embedded objects or file attachments. But let’s just look at the design for now.

The design of a rich text field in a Lotus Notes form appears as follows:

Rich Text Field Design

Rich Text Field Design

 

 

 

The design details of the same rich text field (with the label) appear in the DXL file as follows:

<par>
<run><font size=’12pt’ style=’bold’ name=’Segoe UI’ pitch=’variable’
 truetype=’true’ familyid=’20’/>Detailed description:</run>
</par>

<par>
<run><font size=’12pt’ name=’Segoe UI’ pitch=’variable’
 truetype=’true’ familyid=’20’/>
<field type=’richtext’ kind=’editable’ name=’Details’/></par>

 

A Rich Text field in the InfoPath Designer class appears as follows:

Rich Text Field in InfoPath Designer Client

Rich Text Field in InfoPath Designer Client

 

 

 

 

You can right-click on the field and select Properties to view the settings for the field. The Display tab indicates that “Only full rich text without embedded images is supported in browser-enabled form templates.” So this will be a problem for any rich text fields in Lotus Notes documents that have embedded images.

Rich Text Box Properties

Rich Text Box Properties

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

It is not as easy to define the Rich Text field in InfoPath. There are multiple files that must be updated:

view1.xsl: This defines how the field will be displayed in the form

<div align=”left”>
 <font style=”FONT-WEIGHT: bold” size=”3″>Detailed description:</font>
</div>
<div align=”left”>
 <font size=”3″></font>
 <span class=”xdRichTextBox” hideFocus=”1″ title=”Details” contentEditable=”true” xd:binding=”my:Details” tabIndex=”0″ xd:xctname=”RichText” xd:CtrlId=”CTRL12″ style=”OVERFLOW-X: visible; WIDTH: 100%; WHITE-SPACE: normal; HEIGHT: 50px”>
  <xsl:copy-of select=”my:Details/node()”/>
 </span>
</div>

myschema.xml: controls the schema reference

<xsd:element name=”myFields”>
 <xsd:complexType>
  <xsd:sequence>
   <xsd:element ref=”my:Details” minOccurs=”0″/>
  </xsd:sequence>
  <xsd:anyAttribute processContents=”lax” namespace=”http://www.w3.org/XML/1998/namespace”/>
 </xsd:complexType>
</xsd:element>
 <xsd:element name=”Details”>
  <xsd:complexType mixed=”true”>
   <xsd:sequence>
    <xsd:any minOccurs=”0″ maxOccurs=”unbounded” namespace=”http://www.w3.org/1999/xhtml” processContents=”lax”/>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
</xsd:element>

 sampledata.xml: specifies the default values that should be displayed to the user when first loading the InfoPath form

 <my:myFields xmlns:my=”http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-10-02T12:31:13” xmlns:xd=”http://schemas.microsoft.com/office/infopath/2003“>
 <my:Details/>
 <xd:SchemaInfo LocalName=”myFields” NamespaceURI=”http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-10-02T12:31:13“>
  <xd:Namespaces>
   <xd:Namespace LocalName=”myFields” NamespaceURI=”http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-10-02T12:31:13″/>
  </xd:Namespaces>
 </xd:SchemaInfo>
</my:myFields>

manifest.xsf: include a reference to the View file and special editing settings

 <xsf:views default=”View 1″>
  <xsf:view name=”View 1″ caption=”View 1″>
   <xsf:editing>
    <xsf:xmlToEdit name=”Details_1″ item=”/my:myFields/my:Details”>
     <xsf:editWith type=”rich” autoComplete=”no” component=”xField” proofing=”no”></xsf:editWith>
    </xsf:xmlToEdit>
   </xsf:editing>
   <xsf:mainpane transform=”view1.xsl”></xsf:mainpane>
  </xsf:view>
 </xsf:views>

See http://www.sharepointsecurity.com/content-201.html for more details on the architecture of the InfoPath Template (XSN).

I have not even given attention to adding columns to display the data yet. But you should get the impression that automating the transformation of a field is a bit complex; especially if you want it to display properly in a web form.