Express (Distributed operating systems), v8.0 > Secure applications and their environment > Authenticate users > Select a registry or repository > Manage realms in a federated repository > Virtual member manager > Develop with virtual member manager > Integrate virtual member manager into the application > Program tasks


Renaming an entity

Use the update(DataObject) method to rename an entity.


About this task

To rename an entity, set its RDN property to a new value. In this example the RDN property of Person, uid, is changed from SalesMgr to SalesManager.

To change the uid value from SalesMgr to SalesManager, add this sample code to the application code and replace the variables with the actual values to use for this request:

DataObject root = SDOHelper.createRootDataObject();
DataObject entity = SDOHelper.createEntityDataObject(root, null, DO_PERSON_ACCOUNT);
entity.createDataObject(DO_IDENTIFIER).set(PROP_UNIQUE_NAME,
                      "uid=SalesMgr,cn=users,dc=yourco,dc=com");
String newUid = "SalesManager";
String newCn = "SalesManager";
entity.set("uid", newUid);
entity.set("cn", newCn);

root = service.update(root);


Sample input and output data graphs

For this particular example the input data graph is:

<?xml version="1.0" encoding="UTF-8"?>
<sdo:datagraph xmlns:xsi="//www.w3.org/2001/XMLSchema-instance"
               xmlns:sdo="commonj.sdo"
               xmlns:wim="//www.ibm.com/websphere/wim">
<wim:Root>
<wim:entities xsi:type="wim:PersonAccount">
<wim:identifier uniqueName="uid=SalesMgr,cn=users,dc=yourco,dc=com"/>
<wim:uid>SalesManager
</wim:uid>
<wim:cn>Sales Manager </wim:cn>
</wim:entities>
</wim:Root>
</sdo:datagraph> 

The resulting output data graph for this example is:

<?xml version="1.0" encoding="UTF-8"?>
<sdo:datagraph xmlns:xsi="//www.w3.org/2001/XMLSchema-instance"
               xmlns:sdo="commonj.sdo"
               xmlns:wim="//www.ibm.com/websphere/wim">
<wim:Root>
<wim:entities xsi:type="wim:PersonAccount">
<wim:identifier externalId="5e846c20-a1b4-4bfc-bce2-1f841d762f9a"
                      externalName="uid=SalesManager,cn=users,dc=yourco,dc=com"
                      repositoryId="LDAP1"
                      uniqueId="5e846c20-a1b4-4bfc-bce2-1f841d762f9a"
                      uniqueName="uid=SalesManager,cn=users,dc=yourco,dc=com"/>
</wim:entities>
</wim:Root>
</sdo:datagraph> 

Parent topic: Program tasks


Related


update method

+

Search Tips   |   Advanced Search