Creating a new entity type and adding a new property type to it

Use the following data graph to create a new entity type ContactPerson and add a new property cellPhone to it.

Input data graph

This task has to be done in two createSchema calls. First data graph creates a new entity type called ContactPerson that extends from the Person data object.
<?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="Person">
        <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>

Output data graph

<?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="Person">
        <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>

Input data graph

Second data graph creates a new property type called cellPhone and adds it to the new entity type ContactPerson.
Note: The property cellPhone is mapped to LDAP attribute 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>

Output data graph

<?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 file

After schema is created, the wimxmlextension.xml looks like the following:
<?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="Person"/>
    <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 file

After schema is created, the following section is added to 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"/>
Terms of use | Feedback
(C) Copyright IBM Corporation 2005. All Rights Reserved.
IBM virtual member manager 6.1