on 07-21-2004 2:22 PM
Hello,
could you please tell me how I can create Groups and add users to, within EP, using the User management API ?
do you have a javadoc on the User management API ?
best regards,
There is an excellent article by Will about using UME API
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/using the new user management api in ep 6.0
Enjoy
Lakshmi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Regarding the UM Javadocs:
They are located in both the PDK and here on SDN. I have prepared a session on creating users, etc. that will be published as part of the certification track. You might take a look at my presentation here on SDN, or Oliver's tutorial. I am wrting this from an airport lounge so I don't have my laptop right now or I would past some sample code in.
Good luck,
Will
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have my laptop now... Code to create a new User:
String uid = "testuser";
IUserMaint newUser = UMFactory.getUserFactory().newUser(uid);
newUser.setFirstName("Test");
newUser.setLastName("User");
newUser.setEmail("testuser@company.com");
newUser.commit();
IUserAccount uacc =UMFactory.getUserAccountFactory().
newUserAccount(uid,newUser.getUniqueID());
uacc.setPassword("secret");
uacc.setPasswordChangeRequired(false);
uacc.save();
uacc.commit();
Here's sample code for adding users to a group:
// assign individual user to a Group
String userid = "<unique-id of user>";
String groupid = "<unique-id of group>";
IGroupFactory grpFact = UMFactory.getGroupFactory();
// add the user
grpFact.addUserToGroup(userid, groupid);
// get rid of the user
grpFact.removeUserFromGroup(userid,groupid);
Note: the unique IDs are obtained by searching for the user or group. You can also use the appropriate factory (e.g. UserFactory)
The IDs look something like:
GRUP.CORP_LDAP_2.cn=developers,ou=groups,dc=sap,dc=corp
or
USER.CORP_LDAP.uid=i802895,ou=people,dc=sap,dc=corp
So:
String uid = "i802895";
IUser user = UMFactory.getUserFactory().getUserByLogonID(uid);
String uniqID = user.getUniqueID();
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.