Пример #1
0
 public String QueryAppItems() {
   AppManageService ams = new AppManageService();
   items = new ArrayList<Application>();
   try {
     //			if( queryAll ) {
     Application criteria = new Application();
     criteria.setName(appName);
     criteria.setFlag(appFlag);
     total = ams.QueryAllAppItems(criteria, page, rows, items);
     //			} else {
     //				total = ams.QueryUserItems( id, page, rows, items );
     //			}
   } catch (Exception e) {
     message = e.getMessage();
     setResult(false);
     return SUCCESS;
   }
   setResult(true);
   return SUCCESS;
 }
Пример #2
0
  public String SaveApp() {
    AppManageService ams = new AppManageService();
    try {
      if (Application.CHECKBOXCHECKED.equals(app.getHasAccountType())) {
        if (Application.CHECKBOXCHECKED.equals(app.getHasPwdAccount())) {
          if (Application.PWDPOLICYSELF.equals(app.getPwd_policy())) {
            String pwdstrength = "";
            if (Application.CHECKBOXCHECKED.equals(pwdstrength_lower)) {
              pwdstrength += Application.PWDSTRENGTHLOWER;
            }
            if (Application.CHECKBOXCHECKED.equals(pwdstrength_upper)) {
              pwdstrength += Application.PWDSTRENGTHUPPER;
            }
            if (Application.CHECKBOXCHECKED.equals(pwdstrength_number)) {
              pwdstrength += Application.PWDSTRENGTHNUMBER;
            }
            if (Application.CHECKBOXCHECKED.equals(pwdstrength_special)) {
              pwdstrength += Application.PWDSTRENGTHSPECIAL;
            }
            app.setPwdstrength(pwdstrength);
          } else {
            app.setDefault_username(null);
            app.setDefault_pwd_type(null);
            app.setDefault_pwd(null);
            app.setPwdlen_min(0);
            app.setPwdlen_max(0);
            app.setPwdstrength(null);
          }

        } else {
          app.setPwd_policy(null);
          app.setDefault_username(null);
          app.setDefault_pwd_type(null);
          app.setDefault_pwd(null);
          app.setPwdlen_min(0);
          app.setPwdlen_max(0);
          app.setPwdstrength(null);
        }

        if (!Application.CHECKBOXCHECKED.equals(app.getHasCertAccount())) {
          app.setCert_policy_pki(null);
        }
      } else {
        app.setHasPwdAccount(null);
        app.setPwd_policy(null);
        app.setDefault_username(null);
        app.setDefault_pwd_type(null);
        app.setDefault_pwd(null);
        app.setPwdlen_min(0);
        app.setPwdlen_max(0);
        app.setPwdstrength(null);
        app.setHasCertAccount(null);
        app.setCert_policy_pki(null);
      }

      app = ams.SaveApp(app);
    } catch (Exception e) {
      message = e.getMessage();
      setResult(false);
      return SUCCESS;
    }
    setResult(true);
    return SUCCESS;
  }