创建实体类型并向其添加新属性类型

使用数据图可创建实体类型 ContactPerson 并向其添加新属性 cellPhone。

输入数据图

此任务必须在两个 createSchema 调用中完成。第一个数据图创建扩展自 PersonAccount 数据对象的实体类型 ContactPerson。
<?xml version="1.0" encoding="UTF-8"?>
<sdo:datagraph xmlns:sdo="commonj.sdo"
    xmlns:wim="http://www.ibm.com/websphere/wim">
  <wim:Root>
    <wim:schema>
      <wim:entitySchema nsURI="http://www.yourco.com/wim/yourext" entityName="ContactPerson"
          parentEntityName="PersonAccount">
        <wim:entityConfiguration defaultParent="cn=users,dc=yourco,dc=com" rdnProperty="uid">
          <wim:metaData name="objectClasses">
            <wim:values>eContactPerson</wim:values>
          </wim:metaData>
          <wim:metaData name="objectClassesForCreate">
            <wim:values>eContactPerson</wim:values>
            <wim:values>inetOrgPerson</wim:values>
          </wim:metaData>
          <wim:metaData name="rdnAttributes">
            <wim:values>uid</wim:values>
            <wim:values>sn</wim:values>
          </wim:metaData>
        </wim:entityConfiguration>
      </wim:entitySchema>
    </wim:schema>
  </wim:Root>
</sdo:datagraph>

输出数据图

<?xml version="1.0" encoding="UTF-8"?>
<sdo:datagraph xmlns:sdo="commonj.sdo"
    xmlns:wim="http://www.ibm.com/websphere/wim">
  <wim:Root>
    <wim:schema>
      <wim:entitySchema nsURI="http://www.yourco.com/wim/yourext" entityName="ContactPerson"
          parentEntityName="PersonAccount">
        <wim:repositoryIds>LDAP1</wim:repositoryIds>
        <wim:entityConfiguration defaultParent="cn=users,dc=yourco,dc=com" rdnProperty="uid">
          <wim:metaData name="objectClasses">
            <wim:values>eContactPerson</wim:values>
          </wim:metaData>
          <wim:metaData name="objectClassesForCreate">
            <wim:values>eContactPerson</wim:values>
            <wim:values>inetOrgPerson</wim:values>
          </wim:metaData>
          <wim:metaData name="rdnAttributes">
            <wim:values>uid</wim:values>
            <wim:values>sn</wim:values>
          </wim:metaData>
        </wim:entityConfiguration>
      </wim:entitySchema>
    </wim:schema>
  </wim:Root>
</sdo:datagraph>

输入数据图

第二个数据图创建名为 cellPhone 的属性类型,并将其添加到新实体类型 ContactPerson。
注: 属性 cellPhone 会映射到 LDAP 属性 celluarTelephoneNumber。
<?xml version="1.0" encoding="UTF-8"?>
<sdo:datagraph xmlns:sdo="commonj.sdo"
    xmlns:wim="http://www.ibm.com/websphere/wim">
  <wim:Root>
    <wim:schema>
      <wim:propertySchema nsURI="http://www.yourco.com/wim/yourext" dataType="String"
          propertyName="cellPhone">
        <wim:applicableEntityTypeNames>yourext:ContactPerson</wim:applicableEntityTypeNames>
        <wim:metaData name="repositoryPropertyName">
          <wim:values>cellularTelephoneNumber</wim:values>
        </wim:metaData>
      </wim:propertySchema>
    </wim:schema>
  </wim:Root>
</sdo:datagraph>

输出数据图

<?xml version="1.0" encoding="UTF-8"?>
<sdo:datagraph xmlns:sdo="commonj.sdo"
    xmlns:wim="http://www.ibm.com/websphere/wim">
  <wim:Root>
    <wim:schema>
      <wim:propertySchema nsURI="http://www.yourco.com/wim/yourext" dataType="String"
          propertyName="cellPhone">
        <wim:repositoryIds>LDAP1</wim:repositoryIds>
        <wim:applicableEntityTypeNames>yourext:ContactPerson</wim:applicableEntityTypeNames>
        <wim:metaData name="repositoryPropertyName">
          <wim:values>cellularTelephoneNumber</wim:values>
        </wim:metaData>
      </wim:propertySchema>
    </wim:schema>
  </wim:Root>
</sdo:datagraph>

wimxmlextension.xml 文件

模式创建后,wimxmlextension.xml 如以下片段所示:
<?xml version="1.0" encoding="UTF-8"?>
<sdo:datagraph xmlns:sdo="commonj.sdo"
    xmlns:wim="http://www.ibm.com/websphere/wim">
  <wim:schema>
    <wim:entitySchema nsURI="http://www.yourco.com/wim/yourext" entityName="ContactPerson"
        parentEntityName="PersonAccount"/>
    <wim:propertySchema nsURI="http://www.yourco.com/wim/yourext" dataType="String"
        propertyName="cellPhone">
      <wim:applicableEntityTypeNames>yourext:ContactPerson</wim:applicableEntityTypeNames>
    </wim:propertySchema>
  </wim:schema>
</sdo:datagraph>

wimconfig.xml 文件

模式创建后,以下部分将添加到 wimconfig.xml 中:
<config:supportedEntityTypes defaultParent="cn=users,dc=yourco,dc=com" name="yourext:ContactPerson">
  <config:rdnProperties>uid</config:rdnProperties>
</config:supportedEntityTypes>

<config:ldapEntityTypes name="yourext:ContactPerson">
  <config:objectClasses>eContactPerson</config:objectClasses>
  <config:objectClassesForCreate>eContactPerson</config:objectClassesForCreate>
  <config:objectClassesForCreate>inetOrgPerson</config:objectClassesForCreate>
</config:ldapEntityTypes>

<config:attributes name="cellularTelephoneNumber" propertyName="yourext:cellPhone"/>


使用条款 | 反馈