ALC Version: ALC ES2.5
The class DirectoryManager has a method called uploadLocalUser. I created a DSC in java and deployed into ALC. There were no error or warnings.
The class is defined here:
http://help.adobe.com/en_US/livecycle/11.0/ProgramLC/javadoc/com/adobe/idp/um/api/DirectoryManager.h..., java.lang.String, java.lang.String)
The method is defined this way:
void updateLocalUser(User updatedUser,
java.lang.String oldPassword,
java.lang.String newPassword)
throws UMException
This is the code I'm using:
public boolean ChangePassword(java.lang.String userOID,java.lang.String oldPassword,java.lang.String newPassword){
try
{
ServiceClientFactory myFactory = ServiceClientFactory.createInstance();
DirectoryManagerServiceClient dmClient = new DirectoryManagerServiceClient(myFactory);
PrincipalSearchFilter psf = new PrincipalSearchFilter();
psf.setPrincipalOid(userOID);
List<User> principalList = dmClient.findPrincipals(psf);
Iterator<User> pit = principalList.iterator();
if(pit.hasNext()){
User theUser = pit.next();
dmClient.updateLocalUser(theUser,oldPassword,newPassword);
return true;
}
return false;
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
When executed, the code gives the following error:
2014-08-18 17:55:38,973 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract void com.adobe.idp.um.businesslogic.directoryservices.DirectoryServicesManager.updateLocalUser(com.adobe.idp.um.api.infomodel.impl.UserImpl,java.lang.String) throws com.adobe.idp.common.errors.exception.IDPException,com.adobe.idp.common.errors.exception.IDPSystemException, causedBy:
Can you tell us where is the problem with this API function? is it the code?...
Thank you very much.
Solved! Go to Solution.
Hi , please also try with "userID"
psf.setUserId("myLCUser");
List<User> principalList = dirClient.findPrincipals(psf);
Iterator<User> pit = principalList.iterator();
User testUser = null;
if (pit.hasNext())
{
testUser = pit.next();
}
dirClient.updateLocalUser(testUser, "oldPassword", "newPassword");
This works fine for me and I can change the password. I am able to do same using psf.setPrincipalOid(userOID); but in here, the value I used is "ID" of the user, not "userId".
In userOID case, if you try debugging and confirming the value of userOID , which you must be retrieving at some earlier step. I hope that helps.
Views
Replies
Total Likes
Hi , please also try with "userID"
psf.setUserId("myLCUser");
List<User> principalList = dirClient.findPrincipals(psf);
Iterator<User> pit = principalList.iterator();
User testUser = null;
if (pit.hasNext())
{
testUser = pit.next();
}
dirClient.updateLocalUser(testUser, "oldPassword", "newPassword");
This works fine for me and I can change the password. I am able to do same using psf.setPrincipalOid(userOID); but in here, the value I used is "ID" of the user, not "userId".
In userOID case, if you try debugging and confirming the value of userOID , which you must be retrieving at some earlier step. I hope that helps.
Views
Replies
Total Likes
Hi,
Finding the user was not the problem. I can find the user using OID and userID.
The line that give me the exception was:
dirClient.updateLocalUser(testUser, "oldPassword", "newPassword");
Maybe the ALC version I have has a bug...
I will keep trying...
thanks,
Views
Replies
Total Likes
I try with another user and my original code worked.... so... aparently the account had problems...
Views
Likes
Replies
Views
Likes
Replies