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


Update the properties of an entity

Use the update(DataObject) method and the PropertyControl to change the properties of an entity.


About this task

The update method is used to modify the properties of an entity. In this example the cn property of a person is changed from SalesMgr to SalesManager.

To modify the cn property of a person 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=SalesManager,cn=users,dc=yourco,dc=com");
String newCn = "Sales Manager";
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=SalesManager,cn=users,dc=yourco,dc=com"/>
<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