Compartilhar via


Template: Layout.xml

Applies to: SharePoint Server 2010

The following is an example of a template for a layout. A layout defines how one or more External Data Parts are arranged to display information to the user. After you define layouts, they can be hosted in task panes and in InfoPath forms in Microsoft Outlook 2010. This is specified in the Solution Manifest (OIR.config) file. A single solution can contain multiple layout files. There are two native External Data Parts: Rich List Part, used to show external items in a simple list and InfoPath, used to show a custom InfoPath form. In addition to using the List and InfoPath External Data Parts, you can use custom External Data Parts created by a developer that are in a layout.

This template shows how to specify the three types of External Data Parts in a layout. You can add new ones or remove the ones you do not need in your solution.

<?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>