Search in sources :

Example 6 with User

use of com.alibaba.otter.shared.common.model.user.User in project otter by alibaba.

the class UserAction method doAdd.

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);
}
Also used : RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException) User(com.alibaba.otter.shared.common.model.user.User)

Example 7 with User

use of com.alibaba.otter.shared.common.model.user.User in project otter by alibaba.

the class UserAction method doEdit.

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));
}
Also used : RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException) User(com.alibaba.otter.shared.common.model.user.User)

Example 8 with User

use of com.alibaba.otter.shared.common.model.user.User in project otter by alibaba.

the class EditUser method execute.

/**
     * 找到单个Channel,用于编辑Channel信息界面加载信息
     * 
     * @param channelId
     * @param context
     * @throws WebxException
     */
public void execute(@Param("userId") Long userId, @Param("pageIndex") int pageIndex, @Param("searchKey") String searchKey, Context context, Navigator nav) throws Exception {
    User user = userService.findUserById(userId);
    context.put("user", user);
    context.put("pageIndex", pageIndex);
    context.put("searchKey", searchKey);
}
Also used : User(com.alibaba.otter.shared.common.model.user.User)

Aggregations

User (com.alibaba.otter.shared.common.model.user.User)8 RepeatConfigureException (com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException)2 UserDO (com.alibaba.otter.manager.biz.user.dal.dataobject.UserDO)2 ArrayList (java.util.ArrayList)2 TurbineRunData (com.alibaba.citrus.turbine.TurbineRunData)1 TurbineUtil.getTurbineRunData (com.alibaba.citrus.turbine.util.TurbineUtil.getTurbineRunData)1 Paginator (com.alibaba.citrus.util.Paginator)1 AuthorizeType (com.alibaba.otter.shared.common.model.user.AuthorizeType)1 HashMap (java.util.HashMap)1