on 04-06-2009 5:41 PM
Hello,
I am using this code to set and get custom ume attributes:
String[] phoneExt={wdContext.currentInputValuesElement().getPhone_Ext().toString().trim()};
newUser.setAttribute("com.sap.security.core.usermanagement","phone_ext", phoneExt);
String[] phoneExt = searchedUser.getAttribute("com.sap.security.core.usermanagement","phone_ext");
String ext = "";
for(int j=0; j<phoneExt.length; j++){
ext = phoneExt[j];
break;
}
This doesn't seem to work. Can anybody let me know the correct way.
Is it possible to change a portal user's login Id by using API. Can anybody provide the code for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sameer,
Thanks for your reply.
I am able to set the custom ume attribute using this code:
String phoneExt[] ={wdContext.currentInputValuesElement().getPhone_Ext().toString().trim()};
newUser.setAttribute("com.sap.security.core.usermanagement","phone_ext", phoneExt);
But when I try to read the attributes under "com.sap.security.core.usermanagement", I don't see the custom attribute "phone_ext"
Before entering attribute: uniquename
Before entering attribute: office_num
Before entering attribute: displayname
Before entering attribute: jobtitle
Before entering attribute: company
Before entering attribute: locale
Before entering attribute: lastname
Before entering attribute: LAST_MODIFIED_BY
Before entering attribute: dn
Before entering attribute: kpnprefix
Before entering attribute: PRINCIPAL_MODIFY_DATE
Before entering attribute: krb5principalname
Before entering attribute: firstname
Before entering attribute: description
Before entering attribute: email
I see following values in config tool under ume.admin.addattrs: "krb5principalname;kpnprefix;dn;com.greenheck.usermgt:office_num;phone_ext"
What could be wrong.
Thanks
Tony.
Waht is "newUser"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using namespaces in the code:
//get custom phone_ext attribute
String namespaces[] = searchedUser.getAttributeNamespaces();
String ns = null;
for (int i = 0; i < namespaces.length; i++) {
if (i > 0)
ns = namespaces[ i ];
String attrNames[] = searchedUser.getAttributeNames(ns);
if (ns != null){
g_message_manager.reportSuccess("NS: " + ns);
if(ns.equals("com.sap.security.core.usermanagement")){
for (int j = 0; j < attrNames.length; j++) {
if(attrNames[j].equals("phone_ext")){
g_message_manager.reportSuccess("\n" + attrNames[j] + " = ");
Object attr[] = searchedUser.getAttribute(ns, attrNames[j]);
for (int k = 0; k < attr.length; k++){
if(!(null == attr[k])|| !(attr[k].toString().length() == 0))
searchResult.setPhone_Ext(attr[k].toString());
break;
}
}else
continue;
}
}else
continue;
}
}
This doesn't seem to work. Can any body point the right way.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.