Partager via


Extrait de code XML : utiliser une mise en forme personnalisée pour générer le rendu de types complexes dans un modèle BDC

Dernière modification : mercredi 21 avril 2010

S’applique à : SharePoint Server 2010

L’exemple suivant illustre la définition de la mise en forme personnalisée dans le modèle BDC.

Exemple

<Method Name="GetDefaultCustomerView" DefaultDisplayName="GetDefaultCustomerView€">
  <Parameters>
    <Parameter Direction="In" Name="CustomerId">
      <TypeDescriptor TypeName="System.String" IdentifierName="CustomerId" Name="CustomerId" />
    </Parameter>
    <Parameter Direction="Return" Name="Customer">
      <TypeDescriptor TypeName="WSProxyName.Customer, WSLobSystem-Formatter" ReadOnly="true" Name="CustomerDataRecord">
        <Properties>
          <Property Name="ComplexFormatting" Type="System.Boolean">true</Property>
        </Properties>
        <TypeDescriptors>
          <TypeDescriptor TypeName="System.String" ReadOnly="true" IdentifierName="CustomerId" Name="CustomerId" DefaultDisplayName="CustomerId">
            <Properties>
              <Property Name="ShowInPicker" Type="System.Boolean">true</Property>
            </Properties>
          </TypeDescriptor>
          <TypeDescriptor TypeName="WSProxyName.ContactInfo, WSLobSystem-Formatter" ReadOnly="true" Name="ContactInfo" DefaultDisplayName="ContactInfo">
            <Properties>
              <Property Name="FormatString" Type="System.String">{0} {1}, {2}, {3}  {4}</Property>
              <Property Name="ShowInPicker" Type="System.Boolean">true</Property>
            </Properties>
            <TypeDescriptors>
              <TypeDescriptor TypeName="System.String" ReadOnly="true" Name="FirstName" DefaultDisplayName="FirstName" />
              <TypeDescriptor TypeName="System.String" ReadOnly="true" Name="LastName" DefaultDisplayName="LastName" />
              <TypeDescriptor TypeName="WSProxyName.Address, WSLobSystem-Formatter" ReadOnly="true" Name="Address" DefaultDisplayName="Address">
                <TypeDescriptors>
                  <TypeDescriptor TypeName="System.String" ReadOnly="true" Name="StreetAddress" DefaultDisplayName="StreetAddress" />
                  <TypeDescriptor TypeName="System.String" ReadOnly="true" Name="City" DefaultDisplayName="City" />
                  <TypeDescriptor TypeName="System.String" ReadOnly="true" Name="ZipCode" DefaultDisplayName="ZipCode" />
                </TypeDescriptors>
              </TypeDescriptor>
              <TypeDescriptor TypeName="System.String" ReadOnly="true" Name="Telephone" DefaultDisplayName="Telephone" />
            </TypeDescriptors>
          </TypeDescriptor>
          <TypeDescriptor TypeName="System.DateTime" ReadOnly="true" Name="LastChanged" DefaultDisplayName="LastChanged">
            <Properties>
              <Property Name="HideInItemWebPartByDefault" Type="System.Boolean">true</Property>
              <Property Name="HideInListWebPartByDefault" Type="System.Boolean">true</Property>
            </Properties>
            <Interpretation>
              <NormalizeDateTime LobDateTimeMode="UTC" />
            </Interpretation>
          </TypeDescriptor>
          <TypeDescriptor TypeName="System.Int32" ReadOnly="true" Name="EmployeeId" DefaultDisplayName="EmployeeId">
            <Properties>
              <Property Name="HideInItemWebPartByDefault" Type="System.Boolean">true</Property>
              <Property Name="HideInListWebPartByDefault" Type="System.Boolean">true</Property>
            </Properties>
          </TypeDescriptor>
        </TypeDescriptors>
      </TypeDescriptor>
    </Parameter>
  </Parameters>
  <MethodInstances>
    <MethodInstance Type="SpecificFinder" ReturnParameterName="Customer" Default="true" Name="GetDefaultCustomerView" DefaultDisplayName="GetDefaultCustomerView">
    </MethodInstance>
  </MethodInstances>
</Method>