作成手順 7: Order 外部コンテンツ タイプを定義する
最終更新日: 2010年6月11日
適用対象: SharePoint Server 2010
この手順では、Order という名前の外部コンテンツ タイプを定義します。Order 外部コンテンツ タイプは、2 つのソース エンティティ (Customer と Region) を持つ関連付けを示します。詳細については、次に示す GetOrdersForCustomerAndRegion の定義を参照してください。また、この手順は、関連付けメソッドでフィルターを定義できることも示しています。
注意
バックエンド Web メソッドが、定義するフィルターをサポートしている必要があります。
前提条件
Order エンティティを定義するには
Order エンティティの XML を、Region エンティティ要素の後で、Entities 終了タグ (</Entities>) の前に追加します。この XML では、エンティティのタイトル、識別子、および注文を返すメソッドが定義されています。
<Entity Namespace="SampleWebService" Version="1.2.0.0" EstimatedInstanceCount="10000" Name="WSOrder" DefaultDisplayName="WSOrder"> <Properties> <Property Name="OutlookItemType" Type="System.String">Task</Property> </Properties> <Identifiers> <Identifier TypeName="System.String" Name="OrderID" /> </Identifiers> <Methods> <Method IsStatic="false" Name="GetOrderByID"> <Parameters> <Parameter Direction="In" Name="id"> <TypeDescriptor TypeName="System.String" IdentifierName="OrderID" Name="id" DefaultDisplayName="OrderID" /> </Parameter> <Parameter Direction="Return" Name="GetOrderByID"> <TypeDescriptor TypeName="BCSServiceProxy.Order, http://air-mail/WSOrders2010/service.asmx?wsdl" Name="GetOrderByID"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" ReadOnly="true" IdentifierName="OrderID" Name="OrderID" /> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" IdentifierEntityName="WSCustomer" IdentifierEntityNamespace="SampleWebService" ForeignIdentifierAssociationName="GetOrdersForCustomer" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" Name="RegionID" /> <TypeDescriptor TypeName="System.String" Name="CurrencyCode" /> <TypeDescriptor TypeName="System.Decimal" Name="SubTotal"> <Properties> <Property Name="Decimal Digits" Type="System.Int32">4</Property> </Properties> </TypeDescriptor> <TypeDescriptor TypeName="System.String" Name="OrderDate"> <Properties> <Property Name="OfficeProperty" Type="System.String">Subject</Property> </Properties> </TypeDescriptor> <TypeDescriptor TypeName="System.String" Name="ShipDate" /> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="SpecificFinder" ReturnParameterName="GetOrderByID" Default="true" Name="GetOrderByID" DefaultDisplayName="Read Item WSOrder"> <Properties> <Property Name="LastDesignedOfficeItemType" Type="System.String">Task</Property> </Properties> </MethodInstance> </MethodInstances> </Method> <Method IsStatic="false" Name="GetOrders"> <Parameters> <Parameter Direction="Return" Name="GetOrders"> <TypeDescriptor TypeName="BCSServiceProxy.Order[], http://air-mail/WSOrders2010/service.asmx?wsdl" IsCollection="true" Name="GetOrders"> <TypeDescriptors> <TypeDescriptor TypeName="BCSServiceProxy.Order, http://air-mail/WSOrders2010/service.asmx?wsdl" Name="GetOrdersElement"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" ReadOnly="true" IdentifierName="OrderID" Name="OrderID" /> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" IdentifierEntityName="WSCustomer" IdentifierEntityNamespace="SampleWebService" ForeignIdentifierAssociationName="GetOrdersForCustomer" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" Name="RegionID" /> <TypeDescriptor TypeName="System.String" Name="CurrencyCode" /> <TypeDescriptor TypeName="System.Decimal" Name="SubTotal"> <Properties> <Property Name="Decimal Digits" Type="System.Int32">4</Property> </Properties> </TypeDescriptor> <TypeDescriptor TypeName="System.String" Name="OrderDate" /> <TypeDescriptor TypeName="System.String" Name="ShipDate" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="Finder" ReturnParameterName="GetOrders" Default="true" Name="GetOrders" DefaultDisplayName="WSOrder Read List"> <Properties> <Property Name="UseClientCachingForSearch" Type="System.String"></Property> <Property Name="RootFinder" Type="System.String"></Property> </Properties> </MethodInstance> </MethodInstances> </Method> <Method IsStatic="false" Name="GetOrdersForCustomer"> <Parameters> <Parameter Direction="In" Name="custid"> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" IdentifierEntityName="WSCustomer" IdentifierEntityNamespace="SampleWebService" ForeignIdentifierAssociationName="GetOrdersForCustomer" Name="custid" /> </Parameter> <Parameter Direction="Return" Name="GetOrdersForCustomer"> <TypeDescriptor TypeName="BCSServiceProxy.Order[], http://air-mail/WSOrders2010/service.asmx?wsdl" IsCollection="true" Name="GetOrdersForCustomer"> <TypeDescriptors> <TypeDescriptor TypeName="BCSServiceProxy.Order, http://air-mail/WSOrders2010/service.asmx?wsdl" Name="GetOrdersForCustomerElement"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" ReadOnly="true" IdentifierName="OrderID" Name="OrderID" /> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" IdentifierEntityName="WSCustomer" IdentifierEntityNamespace="SampleWebService" ForeignIdentifierAssociationName="GetOrdersForCustomer" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" Name="RegionID" /> <TypeDescriptor TypeName="System.String" Name="CurrencyCode" /> <TypeDescriptor TypeName="System.Decimal" Name="SubTotal"> <Properties> <Property Name="Decimal Digits" Type="System.Int32">4</Property> </Properties> </TypeDescriptor> <TypeDescriptor TypeName="System.String" Name="OrderDate" /> <TypeDescriptor TypeName="System.String" Name="ShipDate" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <Association Name="GetOrdersForCustomer" Type="AssociationNavigator" ReturnParameterName="GetOrdersForCustomer" DefaultDisplayName="WSOrder Navigate Association"> <Properties> <Property Name="ForeignFieldMappings" Type="System.String"> <?xml version="1.0" encoding="utf-8"?> <ForeignFieldMappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ForeignFieldMappingsList> <ForeignFieldMapping ForeignIdentifierName="CustomerID" ForeignIdentifierEntityName="WSCustomer" ForeignIdentifierEntityNamespace="SampleWebService" FieldName="CustomerID" /> </ForeignFieldMappingsList> </ForeignFieldMappings> </Property> </Properties> <SourceEntity Namespace="SampleWebService" Name="WSCustomer" /> <DestinationEntity Namespace="SampleWebService" Name="WSOrder" /> </Association> </MethodInstances> </Method> <Method IsStatic="false" Name="GetOrdersForCustomerAndRegion"> <Parameters> <Parameter Direction="In" Name="custid"> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" IdentifierEntityName="WSCustomer" IdentifierEntityNamespace="SampleWebService" ForeignIdentifierAssociationName="GetOrdersForCustomerAndRegion" Name="custid" /> </Parameter> <Parameter Direction="In" Name="regid"> <TypeDescriptor TypeName="System.String" IdentifierName="RegionID" IdentifierEntityName="WSRegion" IdentifierEntityNamespace="SampleWebService" ForeignIdentifierAssociationName="GetOrdersForCustomerAndRegion" Name="regtid" /> </Parameter> <Parameter Direction="Return" Name="GetOrdersForCustomerAndRegion"> <TypeDescriptor TypeName="BCSServiceProxy.Order[], http://air-mail/WSOrders2010/service.asmx?wsdl" IsCollection="true" Name="GetOrdersForCustomerAndRegion"> <TypeDescriptors> <TypeDescriptor TypeName="BCSServiceProxy.Order, http://air-mail/WSOrders2010/service.asmx?wsdl" Name="GetOrdersForCustomerElement"> <TypeDescriptors> <TypeDescriptor TypeName="System.String" ReadOnly="true" IdentifierName="OrderID" Name="OrderID" /> <TypeDescriptor TypeName="System.String" IdentifierName="CustomerID" IdentifierEntityName="WSCustomer" IdentifierEntityNamespace="SampleWebService" ForeignIdentifierAssociationName="GetOrdersForCustomer" Name="CustomerID" /> <TypeDescriptor TypeName="System.String" Name="RegionID" /> <TypeDescriptor TypeName="System.String" Name="CurrencyCode" /> <TypeDescriptor TypeName="System.Decimal" Name="SubTotal"> <Properties> <Property Name="Decimal Digits" Type="System.Int32">4</Property> </Properties> </TypeDescriptor> <TypeDescriptor TypeName="System.String" Name="OrderDate" /> <TypeDescriptor TypeName="System.String" Name="ShipDate" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <Association Name="GetOrdersForCustomerAndRegion" Type="AssociationNavigator" ReturnParameterName="GetOrdersForCustomerAndRegion" DefaultDisplayName="Orders for Customer and Region Navigate Association"> <Properties> <Property Name="ForeignFieldMappings" Type="System.String"> <?xml version="1.0" encoding="utf-8"?> <ForeignFieldMappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ForeignFieldMappingsList> <ForeignFieldMapping ForeignIdentifierName="CustomerID" ForeignIdentifierEntityName="WSCustomer" ForeignIdentifierEntityNamespace="SampleWebService" FieldName="CustomerID" /> </ForeignFieldMappingsList> </ForeignFieldMappings> </Property> </Properties> <SourceEntity Namespace="SampleWebService" Name="WSCustomer" /> <SourceEntity Namespace="SampleWebService" Name="WSRegion" /> <DestinationEntity Namespace="SampleWebService" Name="WSOrder" /> </Association> </MethodInstances> </Method> </Methods> <AssociationGroups> <AssociationGroup Name="WSOrder-WSCustomer"> <AssociationReference AssociationName="GetOrdersForCustomer" Reverse="false" EntityNamespace="SampleWebService" EntityName="WSOrder" /> </AssociationGroup> </AssociationGroups> </Entity>