Package org.mmisw.orrclient.gwt.client.rpc

Examples of org.mmisw.orrclient.gwt.client.rpc.CreateUpdateUserAccountResult


    // update password in back-end
    Map<String, String> values = userInfoResult.getProps();
    values.put("id", userInfoResult.getProps().get("id"));
    values.put("password", newPassword);
    values.put("sessionid", "4444444444444");
    CreateUpdateUserAccountResult updatePwResult = createUpdateUserAccount(values);
    if ( updatePwResult.getError() != null ) {
      result.setError(updatePwResult.getError());
      return result;
    }
   
   
    ///////////////////////////////////////////////////////////////
View Full Code Here


    return result;
  }
 
 
  public CreateUpdateUserAccountResult createUpdateUserAccount(Map<String,String> values) {
    CreateUpdateUserAccountResult result = new CreateUpdateUserAccountResult();
   
    String email = values.get("email");
    if ( email != null ) {
      try {
        new InternetAddress(email, true);
      }
      catch (AddressException e) {
        String error = "Malformed email address: " +e.getMessage();
        result.setError(error);
        return result;
      }
    }
   
    try {
      SignInResult signInResult = ontClient.createUpdateUserAccount(values);
      LoginResult loginResult = new LoginResult();
      loginResult.setSessionId(signInResult.getSessionId());
      loginResult.setUserId(signInResult.getUserId());
      loginResult.setUserName(signInResult.getUserName());
      loginResult.setUserRole(signInResult.getUserRole());
      result.setLoginResult(loginResult);
    }
    catch (Exception e) {
      String error = "error updating user information: " +
        e.getClass().getName()+ " : " +e.getMessage();
      result.setError(error);
      log.error(error, e);
    }
   
    return result;
   
View Full Code Here

    // update password in back-end
    Map<String, String> values = userInfoResult.getProps();
    values.put("id", userInfoResult.getProps().get("id"));
    values.put("password", newPassword);
    values.put("sessionid", "4444444444444");
    CreateUpdateUserAccountResult updatePwResult = createUpdateUserAccount(values);
    if ( updatePwResult.getError() != null ) {
      result.setError(updatePwResult.getError());
      return result;
    }
   
   
    ///////////////////////////////////////////////////////////////
View Full Code Here

    return result;
  }
 
 
  public CreateUpdateUserAccountResult createUpdateUserAccount(Map<String,String> values) {
    CreateUpdateUserAccountResult result = new CreateUpdateUserAccountResult();
   
    String email = values.get("email");
    if ( email != null ) {
      try {
        new InternetAddress(email, true);
      }
      catch (AddressException e) {
        String error = "Malformed email address: " +e.getMessage();
        result.setError(error);
        return result;
      }
    }
   
    try {
      SignInResult signInResult = ontClient.createUpdateUserAccount(values);
      final LoginResult loginResult = new LoginResult();
      loginResult.setSessionId(signInResult.getSessionId());
      loginResult.setUserId(signInResult.getUserId());
      loginResult.setUserName(signInResult.getUserName());
      loginResult.setUserRole(signInResult.getUserRole());
      result.setLoginResult(loginResult);

            _notifyUserCreated(loginResult);
    }
    catch (Exception e) {
      String error = "error updating user information: " +
        e.getClass().getName()+ " : " +e.getMessage();
      result.setError(error);
      log.error(error, e);
    }
   
    return result;
   
View Full Code Here

TOP

Related Classes of org.mmisw.orrclient.gwt.client.rpc.CreateUpdateUserAccountResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.