共用方式為


記錄屬性架構

記錄可以有應用程式特定的屬性,這些屬性是名稱或值組序列,以 xml 字串表示于PEER_RECORD結構的pszAttributes成員中。 屬性是用來篩選 由對 PeerGroupSearchRecords呼叫起始的記錄搜尋,它會採用 記錄搜尋查詢格式 中指定的 XML 搜尋篩選做為參數。

記錄屬性可以是下列三種類型之一:

下列清單會識別對等基礎結構所保留的特定屬性名稱:

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

注意

屬性名稱必須是英數位元序列。 屬性名稱中不允許連字號 (「-」) 和底線 (「_」) 等特殊字元。

 

下列 XML 屬性序列範例包含出現在PEER_RECORD pszAttributes成員中的自訂AuthenticationTypeAuthExpires屬性。

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