热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.activiti.engine.IdentityService.setUserInfo()方法的使用及代码示例

本文整理了Java中org.activiti.engine.IdentityService.setUserInfo()方法的一些代码示例,展示了Identi

本文整理了Java中org.activiti.engine.IdentityService.setUserInfo()方法的一些代码示例,展示了IdentityService.setUserInfo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IdentityService.setUserInfo()方法的具体详情如下:
包路径:org.activiti.engine.IdentityService
类名称:IdentityService
方法名:setUserInfo

IdentityService.setUserInfo介绍

[英]Generic extensibility key-value pairs associated with a user
[中]

代码示例

代码示例来源:origin: org.activiti/activiti-rest

@ApiOperation(value = "Delete a user’s info", tags = {"Users"})
@ApiResponses(value = {
@ApiResponse(code = 204, message = "Indicates the user was found and the info for the given key has been deleted. Response body is left empty intentionally."),
@ApiResponse(code = 404, message = "Indicates the requested user was not found or the user doesn’t have info for the given key. Status description contains additional information about the error.")
})
@RequestMapping(value = "/identity/users/{userId}/info/{key}", method = RequestMethod.DELETE)
public void deleteUserInfo(@ApiParam(name = "userId", value="The id of the user to delete the info for.") @PathVariable("userId") String userId,@ApiParam(name = "key", value="The key of the user info to delete.") @PathVariable("key") String key, HttpServletResponse response) {
User user = getUserFromRequest(userId);
String validKey = getValidKeyFromRequest(user, key);
identityService.setUserInfo(user.getId(), validKey, null);
response.setStatus(HttpStatus.NO_CONTENT.value());
}

代码示例来源:origin: org.activiti/activiti-explorer

public void buttonClick(ClickEvent event) {
user.setFirstName((String) firstNameField.getValue());
user.setLastName((String) lastNameField.getValue());
user.setEmail((String) emailField.getValue());
identityService.saveUser(user);

identityService.setUserInfo(user.getId(), Constants.USER_INFO_JOB_TITLE, jobTitleField.getValue().toString());
if (birthDateField.getValue() != null && !"".equals(birthDateField.getValue().toString())) {
identityService.setUserInfo(user.getId(), Constants.USER_INFO_BIRTH_DATE, new SimpleDateFormat(Constants.DEFAULT_DATE_FORMAT).format(birthDateField.getValue()));
}
identityService.setUserInfo(user.getId(), Constants.USER_INFO_LOCATION, locationField.getValue().toString());
identityService.setUserInfo(user.getId(), Constants.USER_INFO_PHONE, phoneField.getValue().toString());
identityService.setUserInfo(user.getId(), Constants.USER_INFO_TWITTER, twitterField.getValue().toString());
identityService.setUserInfo(user.getId(), Constants.USER_INFO_SKYPE, skypeField.getValue().toString());

// UI
editable = false;
loadProfileData();
initUi();
}
});

代码示例来源:origin: org.activiti/activiti-rest

@ApiOperation(value = "Update a user’s info", tags = {"Users"}, nickname = "updateUserInfo")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Indicates the user was found and the info has been updated."),
@ApiResponse(code = 400, message = "Indicates the value was missing from the request body."),
@ApiResponse(code = 404, message = "Indicates the requested user was not found or the user doesn’t have info for the given key. Status description contains additional information about the error.")
})
@RequestMapping(value = "/identity/users/{userId}/info/{key}", method = RequestMethod.PUT, produces = "application/json")
public UserInfoResponse setUserInfo(@ApiParam(name = "userId", value="The id of the user to update the info for.") @PathVariable("userId") String userId,@ApiParam(name = "key", value="The key of the user info to update.") @PathVariable("key") String key, @RequestBody UserInfoRequest userRequest, HttpServletRequest request) {
User user = getUserFromRequest(userId);
String validKey = getValidKeyFromRequest(user, key);
if (userRequest.getValue() == null) {
throw new ActivitiIllegalArgumentException("The value cannot be null.");
}
if (userRequest.getKey() == null || validKey.equals(userRequest.getKey())) {
identityService.setUserInfo(user.getId(), key, userRequest.getValue());
} else {
throw new ActivitiIllegalArgumentException("Key provided in request body doesn't match the key in the resource URL.");
}
return restResponseFactory.createUserInfoResponse(key, userRequest.getValue(), user.getId());
}

代码示例来源:origin: org.activiti/activiti-rest

@ApiOperation(value = "Create a new user’s info entry", tags = {"Users"}, nickname = "createUserInfo")
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Indicates the user was found and the info has been created."),
@ApiResponse(code = 400, message = "Indicates the key or value was missing from the request body. Status description contains additional information about the error."),
@ApiResponse(code = 404, message = "Indicates the requested user was not found."),
@ApiResponse(code = 409, message = "Indicates there is already an info-entry with the given key for the user, update the resource instance (PUT).")
})
@RequestMapping(value = "/identity/users/{userId}/info", method = RequestMethod.POST, produces = "application/json")
public UserInfoResponse setUserInfo(@ApiParam(name="userId", value="The id of the user to create the info for.") @PathVariable String userId, @RequestBody UserInfoRequest userRequest, HttpServletRequest request, HttpServletResponse response) {
User user = getUserFromRequest(userId);
if (userRequest.getKey() == null) {
throw new ActivitiIllegalArgumentException("The key cannot be null.");
}
if (userRequest.getValue() == null) {
throw new ActivitiIllegalArgumentException("The value cannot be null.");
}
String existingValue = identityService.getUserInfo(user.getId(), userRequest.getKey());
if (existingValue != null) {
throw new ActivitiConflictException("User info with key '" + userRequest.getKey() + "' already exists for this user.");
}
identityService.setUserInfo(user.getId(), userRequest.getKey(), userRequest.getValue());
response.setStatus(HttpStatus.CREATED.value());
return restResponseFactory.createUserInfoResponse(userRequest.getKey(), userRequest.getValue(), user.getId());
}
}

代码示例来源:origin: org.activiti/activiti-explorer

identityService.setUserInfo(userId, userInfo.get(i), userInfo.get(i+1));

代码示例来源:origin: com.github.hongframework/hframe-workflow

identityService.setUserInfo(userId, userInfo.get(i), userInfo.get(i+1));

推荐阅读
author-avatar
li-yuefang_883
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有