Create Role in SUN IDM

How to set the attributes for a resource when creating a role in sun idm using the webservice, i have done the following to create the role and assign it to a resource but i am not able to set the attributes it will be very helpful if someone can help me with this.

LighthouseClient client =new LighthouseClient();

client.setUrl("http://sunidm:8080/idm/servlet/rpcrouter2");

client.setUser("configurator");

client.setPassword("configurator");

AddRequest req =new AddRequest();

req.setOperationalAttribute("trace","true");

req.setObjectClass("Role");

req.setIdentifier("role_name1");

req.setAttribute("resources","MSSQLSERVER");

//how to set the attributes for this resource//

// for example how to set the serverRoles to admin or defaultDB

// to pubs

SpmlResponse res = client.request(req);

System.out.println(res.getResult());

[1307 byte] By [atulvija] at [2007-11-26 14:22:46]
# 1

I've never seen anyone creating Role objects within IdM using SPML but that doesn't say it can't be done. I'd be tempted to create a custom workflow taskdefinition and then invoke that workflow using SPML extended request message passing in the values that the workflow can take to create the role. Creating the Role object and associated RoleAttribute values is pretty straightforward using workflow.

Here's some SPML code to call a specific workflow:

ExtendedRequest extReq = new ExtendedRequest();

extReq.setOperationIdentifier("launchProcess");

extReq.setAttribute("process", "<name of workflow>")

extReq.setAttribute("<variable name>", "<variable value>");

ExtendedResponse resp = (ExtendedResponse)client.request(extReq);

Here's workflow bits to create a role View. You can manipulate the Role view to achieve your objective read the Role View bit of the docs.

<Action id='0' name='Create Role View' application='com.waveset.session.WorkflowServices'>

<ReportTitle>

<s>Create Role View</s>

</ReportTitle>

<Argument name='op' value='createView'/>

<Argument name='viewId' value='Role'/>

<Argument name='type' value='Role'/>

<Argument name='authorized' value='true'/>

<Argument name='subject' value='#ID#Configurator'/>

<Return from='view' to='role'/>

</Action>

<Action id='0' name='Checkin View' application='com.waveset.session.WorkflowServices'>

<Argument name='op' value='checkinView'/>

<Argument name='authorised' value='true'/>

<Argument name='view' value='$(role)'/>

</Action>

HTH,

Paul

PaulWalker999a at 2007-7-8 2:14:56 > top of Java-index,Web & Directory Servers,Directory Servers...
# 2

The only problem using the workflow for this is that, different resources will have different attributes and hence if one resource has 3 attributes i can create the role view and send the request using spml like u mentioned but then how can i set attributes for a resource which has lets say 5 attributes....

atulvija at 2007-7-8 2:14:56 > top of Java-index,Web & Directory Servers,Directory Servers...