上次修改时间: 2010年4月16日
适用范围: SharePoint Server 2010
下面是一个模板的布局示例。布局定义如何排列一个或多个外部数据部件以向用户显示信息。在定义布局后,可在 Microsoft Outlook 2010 的任务窗格和 InfoPath 表单中承载这些布局。解决方案清单 (OIR.config) 文件中已对此进行了说明。一个解决方案可包含多个布局文件。有两个本机外部数据部件:富列表部件,用于显示简单列表中的外部项;InfoPath,用于显示自定义 InfoPath 表单。除了使用列表外部数据部件和 InfoPath 外部数据部件之外,还可使用开发人员在布局中创建的自定义外部数据部件。
此模板演示如何在布局中指定三类外部数据部件。可在解决方案中添加新类型或删除不需要的类型。
<?xml version="1.0" encoding="utf-8" ?>
<Container ContainerType="EnterStackorInfoPath" xmlns="https://schemas.microsoft.com/office/2009/05/BusinessApplications/Layout" xmlns:loc="https://schemas.microsoft.com/office/2009/05/BusinessApplications/Localization">
<CustomProperties>
</CustomProperties>
<!-- Enter ContainerType as Stack if you want to display the layout in a task pane. If you want it displayed in a separate InfoPath form, enter 'InfoPath'. -->
<Children>
<!-- DataSourceName is the view name of the Association source entity in the Solution Manifest (Oir.config).-->
<!-- The Rich List Data Part that shows associated entity instances. For example, orders of a customer. -->
<OBPart PartType="List" DataSourceName="EnterViewNameFromSolutionManifest" Text="EnterDisplayTitleForExternalDataPart" Description="EnterDescription" >
<CustomProperties >
<CustomProperty Name="DataSourceMode" Value="AssociationList" />
<CustomProperty Name="DataMemberName" Value="EnterAssociationMethodInstanceNameFromModel" />
<CustomProperty Name="MaximumVisibleRowCount" Value="12" />
<CustomProperty Name="ConsumerPartName" Value="IPOBP" />
</CustomProperties>
<ActionNames>
</ActionNames>
</OBPart>
<!-- InfoPath form view External Data Part. Requires an InfoPath form in the solution artifacts folder. -->
<!-- This part is a standalone part, and is not associated with other parts like Rich List Part. -->
<OBPart PartType="InfoPath">
<CustomProperties>
<CustomProperty Name="Name" Value="EnterNameForPart" />
<CustomProperty Name="FormLocation" Value="EnterInfoPathFormFileNameWithExtension" />
<CustomProperty Name="IsReadOnly" Value="True" />
<CustomProperty Name="Height" Value="1000" />
</CustomProperties>
</OBPart>
<!-- InfoPath form view External Data Part. Requires an InfoPath form in the solution artifacts folder. -->
<!-- This part takes a DataSourceName attribute and is associated with another part in the layout like Rich List Part. -->
<OBPart PartType="InfoPath" DataSourceName="EnterViewNameFromSolutionManifest" >
<CustomProperties>
<CustomProperty Name="Name" Value="EnterNameForPart" />
<CustomProperty Name="FormLocation" Value="EnterInfoPathFormFileNameWithExtension" />
<CustomProperty Name="IsReadOnly" Value="True" />
<CustomProperty Name="Height" Value="1000" />
</CustomProperties>
</OBPart>
<!-- This snippet shows how to define the layout for a custom External Data Part. -->
<OBPart PartType="Custom" QualifiedTypeName="EnterFullyQualified.NETTypeOfCustomExternalDataPart" >
<CustomProperties>
<CustomProperty Name="EnterCustomProperty1NameOfCustomPart" Value="EnterValue" />
<CustomProperty Name="EnterCustomProperty2NameOfCustomPart" Value="EnterValue" />
</CustomProperties>
</OBPart>
</Children>
</Container>