Export (0) Print
Expand All

Step 6: Localize the Layout XML File

SharePoint 2010

The layout XML file defines the controls that appear in the Microsoft Outlook item task pane, the external content types to populate the controls with, and any other custom properties that the control exposes. In this step, you will learn to localize the layout XML file.

Last modified: July 12, 2010

Applies to: SharePoint Server 2010

In the AdventureWorks2008 Declarative Outlook Solution Sample, RelatedOrderHeader.xml is one of the layout files. In this file, you will localize some attributes of the external data part (OBPart) element and the display names of the ColumnsXml custom property (<CustomProperty Name="ColumnsXml" … />). The ColumnsXml custom property defines the columns of the external data part that appear in the Outlook task pane, which in the declarative sample consist of the Order Date column and Total Due column. Localize only the column display name attributes for this custom property.

The following example shows the external data part (OBPart) element from the layout XML file and has placeholders for the text to localize, which appear as "yourLocalizedString" string constants.

<OBPart PartType="List" DataSourceName="PrimaryEntityNameInContext" Text="yourLocalizedString"
             Description="yourLocalizedString" >
      <CustomProperties >
        <CustomProperty Name="DataSourceMode" Value="AssociationList" />
        <CustomProperty Name="DataMemberName" Value="GetOrdersForCustomer" />
        <CustomProperty Name="MaximumVisibleRowCount" Value="12" />
        <CustomProperty Name="DefaultActionName" Value="Edit" />
        <CustomProperty Name="DefaultActionSource" Value="TargetContext" />
        <CustomProperty Name="ConsumerPartName" Value="IPOBP" />
        <CustomProperty Name="ColumnsXml" Value="&lt;Columns&gt;&lt;Column DisplayName=&quot; &quot; 
                        Name=&quot;$SyncState$&quot; /&gt;&lt;Column FormatString=&quot;d&quot; 
                        DisplayName=&quot; yourLocalizedString
                        &quot; Name=&quot;OrderDate&quot;/&gt;&lt;Column FormatString=&quot;#.00&quot; 
                        DisplayName=&quot; yourLocalizedString&quot; 
                        Name=&quot;TotalDue&quot; /&gt;&lt;/Columns&gt;" />  
      </CustomProperties>
      <ActionNames>
      </ActionNames>
 </OBPart>

After localizing the layout XML file, you can adjust the height for the InfoPath form template. You do this by adding a CustomProperty element to the InfoPath OBPart element to indicate the height information, as shown in the following example.

<OBPart PartType="InfoPath">
      <CustomProperties>
        <CustomProperty Name="Name" Value="IPOBP" />
        <CustomProperty Name="FormLocation" Value="OrderHeaderTemplate.xsn" />
        <CustomProperty Name="IsReadOnly" Value="True" />
        <CustomProperty Name="Height" Value="1000" />
        <CustomProperty Name="ViewName" Value="taskpaneview" />
      </CustomProperties>
</OBPart>
Show:
© 2014 Microsoft