cancel
Showing results for 
Search instead for 
Did you mean: 

Access key properties from CIM class in SLD from web dynpro

Former Member
0 Kudos

Hi all,

I dont know if my questions sounds ignorant but it would be great if anybody could help me out with this.

Can we access the key properties from CIM class in SLD from web dynpro java. If so, could anybody give me a small example of it?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, try this:

ClientFactory factory = ClientFactory.newInstance();

URL Url = new URL(sldURL); // sldURL like "http://<host>:<port>/sld/cimom";

CIMOMClient client = factory.createClient(Url, user, password);

CIMClient cimClient = new CIMClient(client);

CIMClass cimClass = cimClient.getCIMClass("<CIMClassName>);

CIMValueNamedInstance[] d = cimClient.enumerateInstances(jcoDestClass.getCIMClassname());

for (int i=0; i <d.length; i++ ) {

CIMValueNamedInstance instance = d<i>;

CIMInstance cimInst = instance.getInstance();

CIMInstancename instName = instance.getInstancename();

CIMKeybindingList bindingList = instName.getKeybindingList();

CIMKeybinding elem = (CIMKeybinding)bindingList.getItem("Name");

CIMKeyValue value = elem.getKeyValue();

String name= value.getValue();

....

}

i suggest u to use debuger for more details)

To make this code builad able and runable u should add reference on 'com.sap.lcr.api.cimclient' library.