예제 #1
0
 /**
  * Place all the data object in the context for use in the template.
  *
  * @param data RunData instance
  * @param context Context instance
  * @exception Exception, a generic exception
  */
 public void doBuildTemplate(RunData data, Context context) {
   try {
     ParameterParser pp = data.getParameters();
     String userName = pp.getString("username");
     String modetype = pp.getString("Process");
     String mode = pp.getString("mode");
     String stat = pp.getString("status");
     String counter = pp.getString("count", "");
     context.put("tdcolor", counter);
     int uid = UserUtil.getUID(userName);
     List userList = UserManagement.getUserDetail(Integer.toString(uid));
     context.put("udetail", userList);
     context.put("Process", modetype);
     context.put("mode", mode);
     context.put("status", stat);
   } catch (Exception e) {
     data.setMessage("The error in user id :- " + e);
   }
 }
예제 #2
0
  public void doRegister(RunData data, Context context) throws Exception {
    try {
      MultilingualUtil m_u = new MultilingualUtil();
      ParameterParser pp = data.getParameters();
      String serverName = data.getServerName();
      int srvrPort = data.getServerPort();
      String serverPort = Integer.toString(srvrPort);

      String roleName = pp.getString("role", "");

      /**
       * Getting the value of file from temporary variable According to selection of Language. and
       * replacing the String from property file.
       *
       * @see MultilingualUtil in utils
       */
      LangFile = (String) data.getUser().getTemp("LangFile");

      /** Retreiving details entered by the user */
      String gname = new String();
      // String roleName=new String();
      gname = pp.getString("group", "");
      // roleName=pp.getString("role","");
      if (gname.equals("")) {
        gname = new String();
        gname = pp.getString("group_author");
      }
      if (roleName.equals("")) {
        roleName = new String();
        roleName = pp.getString("role_author");
      }
      String uname = pp.getString("UNAME");
      String passwd = pp.getString("PASSWD");
      if (passwd.equals("")) passwd = uname;
      String fname = pp.getString("FNAME");
      String lname = pp.getString("LNAME");
      String email = pp.getString("EMAIL");
      email = UserManagement.ChkMailId(email);
      /**
       * Passing the value of file from temporary variable According to selection of Language. Adds
       * the new user in the database.
       *
       * @see UserManagement in utils
       */
      String msg =
          UserManagement.CreateUserProfile(
              uname,
              passwd,
              fname,
              lname,
              email,
              gname,
              roleName,
              serverName,
              serverPort,
              LangFile);

      data.setMessage(msg);
    } catch (Exception ex) {
      data.setMessage("The Error in AddUser Action");
    }
  }