cancel
Showing results for 
Search instead for 
Did you mean: 

Delete user from UME by Java webdynpro

Former Member
0 Kudos

Hi all,

I've to delete an user from UME.

Code above doesn't work fine.


	IUserAccountFactory accountFactory = UMFactory.getUserAccountFactory();
	IUserFactory userFactory = UMFactory.getUserFactory();
	
	try {
		IUserAccount account = accountFactory.getUserAccountByLogonId(wdContext.currentTableUseriElement().getIdUtente());
		IUserAccount mutableAccount = accountFactory.getMutableUserAccount(account.getUniqueID());
		userFactory.deleteUser(account.getUniqueID());
	} catch (UMException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} 
   

Have you any idea?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

use this code,

String uid = "testuser01";
try
{
    IUserFactory userFact = UMFactory.getUserFactory();
IUser user = userFact.getUserByLoginID(uid);
String uniqueId = user.getUniqueID();
userFact.deleteUser(uniqueId);
}
catch(UMException e)
{
}

Regards,

Sunaina Reddy T

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

You have to use the commit() method of IUserAccount to commit the changes.

Thanks,

Venkat

Former Member
0 Kudos

I've just tried but there was an exception

" Maint method commit cannot be used because the principal is not mutable! "

So I've tried in this way


//		account.commit();
		mutableAccount.commit();

No exception was genereted but it doesn't work fine (it doesn't delete the user)

Former Member
0 Kudos

Hi,

Your code is proper, expect for some changes. Do the following changes and it should work:

IUserAccountFactory accountFactory = UMFactory.getUserAccountFactory();
  IUserFactory userFactory = UMFactory.getUserFactory();
  userFactory.deleteUser(userFactory.getUserByLogonID(logonId).getUniqueID());

Thanks,

Venkat

Former Member
0 Kudos

thanks.

It workes fine

Former Member
0 Kudos

I don't have any error message or exception.

Former Member
0 Kudos

Hi Domenico Petronella ,

what exception u got?

after deploying this application? did u attach this iview to some user(Authorized user having user administration role in portal) in portal?

Regards,

Manivannan P