レコード属性スキーマ

レコードには、PEER_RECORD構造体の pszAttributes メンバーの XML 文字列として表される名前または値のペアのシーケンスであるアプリケーション固有の属性を含めることができます。 属性は、 PeerGroupSearchRecords の呼び出しによって開始されるレコード検索をフィルター処理するために使用されます。これは、 レコード検索クエリ形式 で指定された XML 検索フィルターをパラメーターとして受け取ります。

レコード属性には、次の 3 種類のいずれかを指定できます。

  • int は整数値です。
  • date は、 で https://www.w3.org/TR/NOTE-datetime説明されている標準形式の 1 つとして表される datetime 値です。
  • string は Unicode 文字列値です。

次の一覧は、ピア インフラストラクチャによって予約されている特定の属性名を示しています。

  • peerlastmodifiedby
  • peercreatorid
  • peerlastmodificationtime
  • peerrecordid
  • peerrecordtype
  • peercreationtime
  • peerlastmodificationtime

レコード属性の定義の例

次のスキーマ例は、レコード属性を定義する方法を示しています。

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="https://www.w3.org/2001/XMLSchema">
   <xs:simpleType name="alphanum">
       <xs:restriction base="xs:string">
          <xs:pattern value="\c+" />
       </xs:restriction>
   </xs:simpleType>
   <xs:complexType name="attributeType">
       <xs:simpleContent>
          <xs:extension base="xs:string">
                <xs:attribute name="name" type="alphanum" />
                <xs:attribute name="type">
                    <xs:simpleType>
                        <xs:restriction base="alphanum">
                           <xs:enumeration value="string"/>
                           <xs:enumeration value="date"/>
                           <xs:enumeration value="int"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:attribute>
           </xs:extension>
       </xs:simpleContent>
    </xs:complexType>
    <xs:element name="attributes">
       <xs:complexType>
           <xs:sequence>
                <xs:element name="attribute" type="attributeType" minOccurs="0" maxOccurs="unbounded" />
           </xs:sequence>
       </xs:complexType>
    </xs:element>
</xs:schema>  

Note

属性名は、英数字のシーケンスである必要があります。 ハイフン ("-") やアンダースコア ("_") などの特殊文字は、属性名では使用できません。

 

次の XML 属性シーケンスの例には、PEER_RECORDの pszAttributes メンバーに表示されるカスタム AuthenticationType 属性と AuthExpires 属性が含まれています

<attributes>
  <attribute name="AuthenticationType" type="string">Kerberos</attribute><attribute name="AuthExpires" type="date">2002-01-31</attribute>
<attributes>