{
if (isInError())
return;
Visit visit = (Visit) getVisit();
VirtualLibraryEngine vengine = (VirtualLibraryEngine) cycle.getEngine();
UserListEditMap map = getListEditMap();
List updatedUsers = map.getValues();
Person[] updates = (Person[]) updatedUsers.toArray(new Person[updatedUsers.size()]);
Integer[] resetPasswordUserIds = toArray(map.getResetPasswordKeys());
Integer[] deletedUserIds = toArray(map.getDeletedKeys());
String password = getPassword();
setPassword(null);
if (Tapestry.isBlank(password) && Tapestry.size(resetPasswordUserIds) != 0)
{
setErrorField("inputPassword", getMessage("need-password"));
return;
}
Integer adminId = visit.getUserId();
int i = 0;
while (true)
{
try
{
IOperations operations = vengine.getOperations();
operations.updatePersons(
updates,
resetPasswordUserIds,
password,
deletedUserIds,
adminId);
break;
}
catch (RemoteException ex)
{
vengine.rmiFailure(getMessage("update-failure"), ex, i++);
}
catch (RemoveException ex)
{
throw new ApplicationRuntimeException(ex);
}