Beispiel #1
0
  public void doEdit(
      @FormGroup("editUserInfo") Group userInfo,
      @Param("pageIndex") int pageIndex,
      @Param("searchKey") String searchKey,
      Navigator nav,
      @FormField(name = "formUserError", group = "editUserInfo") CustomErrors err) {
    User user = new User();
    userInfo.setProperties(user);
    if (null != user.getPassword()) {
      if (user.getPassword().length() < 6) {
        err.setMessage("passwordTooLess");
        return;
      }
      user.setPassword(SecurityUtils.getPassword(user.getPassword()));
    }

    try {
      userService.updataUser(user);
    } catch (RepeatConfigureException rce) {
      err.setMessage("invalidUser");
      return;
    }
    nav.redirectToLocation(
        "userManager.htm?pageIndex=" + pageIndex + "&searchKey=" + urlEncode(searchKey));
  }
  /** 修改系统参数 */
  public void doEdit(
      @FormGroup("systemParameterDetailInfo") Group systemParameterDetailInfo, Navigator nav)
      throws Exception {

    SystemParameter systemParameter = new SystemParameter();
    systemParameterDetailInfo.setProperties(systemParameter);
    systemParameterService.createOrUpdate(systemParameter);
    nav.redirectToLocation("systemParameter.htm?");
  }
Beispiel #3
0
 public void doAdd(
     @FormGroup("addUserInfo") Group userInfo,
     Navigator nav,
     @FormField(name = "formUserError", group = "addUserInfo") CustomErrors err) {
   User user = new User();
   userInfo.setProperties(user);
   user.setPassword(SecurityUtils.getPassword(user.getPassword()));
   try {
     userService.createUser(user);
   } catch (RepeatConfigureException rce) {
     err.setMessage("invalidUser");
     return;
   }
   nav.redirectTo(WebConstant.USER_MANAGER_LINK);
 }
Beispiel #4
0
 @Override
 public String toString() {
   return group.toString();
 }
Beispiel #5
0
 /** 将对象中的值置入当前group instance中。 */
 public void mapTo(Object object) {
   group.mapTo(object);
 }
Beispiel #6
0
 /** 判断这个group有没有被验证过。 */
 public boolean isValidated() {
   return group.isValidated();
 }
Beispiel #7
0
 /** 取得所有的fields。 */
 public Iterator<FieldHelper> getFields() {
   return new FieldHelperIterator(group.getFields().iterator());
 }
Beispiel #8
0
 /** 取得指定名称的field helper。 */
 public FieldHelper get(String fieldName) {
   Field field = group.getField(fieldName);
   return field == null ? null : new FieldHelper(field);
 }