/** * 根据用户ID,获取用户信息 * * @param userId * @return */ @Override public User getUser(String userId) { User user = identityService.createUserQuery().userId(userId).singleResult(); return user; }
public boolean isValid(Object value) { if (value != null) { return identityService.createUserQuery().userId(value.toString()).singleResult() == null; } return false; } });
protected User getUserFromRequest(String userId) { User user = identityService.createUserQuery().userId(userId).singleResult(); if (user == null) { throw new ActivitiObjectNotFoundException("Could not find a user with id '" + userId + "'.", User.class); } return user; } }
public Item loadSingleResult(String id) { return new UserListItem(identityService.createUserQuery().userId(id).singleResult()); }
@Override public Picture getUserPicture(String userId) { // return new Picture(IoUtil.readInputStream(this.getClass().getClassLoader().getResourceAsStream("org/activiti/explorer/images/fozzie.jpg"), null), "image/jpeg"); // try{ // picture = super.getUserPicture(userId); // }catch (Exception e) { // if(picture == null) { // byte[] pictureBytes = IoUtil.readInputStream(this.getClass().getClassLoader().getResourceAsStream("org/activiti/explorer/images/fozzie.jpg"), null); // picture = new Picture(pictureBytes, "image/jpeg"); // } // } return ((UserEntity)this.createUserQuery().userId(userId).singleResult()).getPicture(); }
/** * 设置当前处理人信息 * * @param vars * @param currentTask */ private void setCurrentTaskAssignee(Map<String, Object> vars, Task currentTask) { String assignee = currentTask.getAssignee(); if (assignee != null) { User assigneeUser = identityService.createUserQuery().userId(assignee).singleResult(); String userInfo = assigneeUser.getFirstName() + " " + assigneeUser.getLastName(); vars.put("当前处理人", userInfo); } } }
public List<String> getAvailableLogins(final String filter) { IdentityService is = getProcessEngine().getIdentityService(); User user1 = is.createUserQuery().userId(filter).singleResult(); List<User> users = is.createUserQuery() .userEmailLike("%" + filter + "%") .orderByUserId().asc() .listPage(0, 100); List<String> res = new ArrayList<String>(); for (User u : users) { res.add(u.getId()); } Collections.sort(res); if (user1 != null) { res.add(0, user1.getId()); } return res; }
public UserDetailsComponent(String userId, String role) { this.role = role; this.identityService = ProcessEngines.getDefaultProcessEngine().getIdentityService(); this.viewManager = ExplorerApp.get().getViewManager(); if (userId != null) { user = identityService.createUserQuery().userId(userId).singleResult(); skypeId = identityService.getUserInfo(userId, Constants.USER_INFO_SKYPE); } }
public UserDetailPanel(UserPage userPage, String userId) { this.userPage = userPage; this.i18nManager = ExplorerApp.get().getI18nManager(); this.identityService = ProcessEngines.getDefaultProcessEngine().getIdentityService(); this.user = identityService.createUserQuery().userId(userId).singleResult(); init(); }
public Label resolveText(Event event) { IdentityService identityService = ProcessEngines.getDefaultProcessEngine().getIdentityService(); User user = identityService.createUserQuery().userId(event.getUserId()).singleResult(); String eventAuthor = "<span class='" + ExplorerLayout.STYLE_TASK_EVENT_AUTHOR + "'>" + user.getFirstName() + " " + user.getLastName() + "</span> "; User involvedUser = identityService.createUserQuery().userId(event.getMessageParts().get(0)).singleResult(); text = i18nManager.getMessage(Messages.EVENT_ADD_USER_LINK, eventAuthor, event.getMessageParts().get(1)); // second msg part = role } else if (Event.ACTION_DELETE_USER_LINK.equals(event.getAction())) { User involvedUser = identityService.createUserQuery().userId(event.getMessageParts().get(0)).singleResult(); text = i18nManager.getMessage(Messages.EVENT_DELETE_USER_LINK, eventAuthor,
protected void handlePasswordChange() { if (passwordField1.getValue() == null || "".equals(passwordField1.getValue().toString()) || passwordField2.getValue() == null || "".equals(passwordField2.getValue().toString())) { errorLabel.setValue(i18nManager.getMessage(Messages.PASSWORD_CHANGE_INPUT_REQUIRED)); } else if (!passwordField1.getValue().equals(passwordField2.getValue())){ errorLabel.setValue(i18nManager.getMessage(Messages.PASSWORD_CHANGE_INPUT_MATCH)); } else { String password = passwordField1.getValue().toString(); // Change data User user = identityService.createUserQuery().userId(currentUser.getId()).singleResult(); user.setPassword(password); identityService.saveUser(user); // Refresh logged in user session data ExplorerApp.get().setUser(ExplorerApp.get().getLoginHandler().authenticate( user.getId(), user.getPassword())); // Close popup close(); // Show notification ExplorerApp.get().getNotificationManager().showInformationNotification(Messages.PASSWORD_CHANGED_NOTIFICATION); } }
public void setValue(Object newValue) throws ReadOnlyException, ConversionException { wrappedField.setValue(newValue); // Update label if(newValue != null) { if(selectedUser == null || !selectedUser.getId().equals(newValue)) { selectedUser = ProcessEngines.getDefaultProcessEngine().getIdentityService().createUserQuery().userId((String) newValue).singleResult(); } selectedUserLabel.setValue(getSelectedUserLabel()); selectedUserLabel.addStyleName(ExplorerLayout.STYLE_FORM_USER_SELECTED); selectedUserLabel.removeStyleName(ExplorerLayout.STYLE_FORM_NO_USER_SELECTED); } else { selectedUser = null; selectedUserLabel.setValue(i18nManager.getMessage(Messages.FORM_USER_NO_USER_SELECTED)); selectedUserLabel.addStyleName(ExplorerLayout.STYLE_FORM_NO_USER_SELECTED); selectedUserLabel.removeStyleName(ExplorerLayout.STYLE_FORM_USER_SELECTED); } }
protected void initUserLink(final String userId) { User user = ProcessEngines.getDefaultProcessEngine().getIdentityService().createUserQuery().userId(userId).singleResult(); Button userButton = new Button(user.getFirstName() + " " + user.getLastName()); ClickListener buttonClickListener = new ClickListener() { private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { viewManager.showProfilePopup(userId); } }; userButton.addStyleName(Reindeer.BUTTON_LINK); userButton.addListener(buttonClickListener); addComponent(userButton); setComponentAlignment(userButton, Alignment.MIDDLE_LEFT); }
public void buttonClick(ClickEvent event) { User user = identityService.createUserQuery().userId(identityLink.getUserId()).singleResult(); String name = user.getFirstName() + " " + user.getLastName(); ConfirmationDialogPopupWindow confirmationPopup = new ConfirmationDialogPopupWindow( i18nManager.getMessage(Messages.TASK_INVOLVED_REMOVE_CONFIRMATION_TITLE, name), i18nManager.getMessage(Messages.TASK_INVOLVED_REMOVE_CONFIRMATION_DESCRIPTION, name, task.getName())); confirmationPopup.addListener(new ConfirmationEventListener() { private static final long serialVersionUID = 1L; protected void rejected(ConfirmationEvent event) { } protected void confirmed(ConfirmationEvent event) { taskService.deleteUserIdentityLink(identityLink.getTaskId(), identityLink.getUserId(), identityLink.getType()); taskDetailPanel.notifyPeopleInvolvedChanged(); } }); viewManager.showPopupWindow(confirmationPopup); }
User user = identityService.createUserQuery().userId(userName).singleResult();
/** * @param user * @param roleNames */ public ActivitiBpmSession(UserData user, Collection<String> roleNames) { super(user, roleNames, ProcessToolContext.Util.getThreadProcessToolContext().getRegistry()); IdentityService is = getProcessEngine().getIdentityService(); User bpmUser = is.createUserQuery().userId(user.getLogin()).singleResult(); if (bpmUser == null) { bpmUser = is.newUser(user.getLogin()); bpmUser.setEmail(user.getEmail()); bpmUser.setFirstName(user.getRealName()); is.saveUser(bpmUser); } }
protected void loadProfileData() { this.user = identityService.createUserQuery().userId(userId).singleResult(); this.picture = identityService.getUserPicture(user.getId()); this.birthDate = identityService.getUserInfo(user.getId(), Constants.USER_INFO_BIRTH_DATE); this.jobTitle = identityService.getUserInfo(user.getId(), Constants.USER_INFO_JOB_TITLE); this.location = identityService.getUserInfo(user.getId(), Constants.USER_INFO_LOCATION); this.phone = identityService.getUserInfo(user.getId(), Constants.USER_INFO_PHONE); this.twitterName = identityService.getUserInfo(user.getId(), Constants.USER_INFO_TWITTER); this.skypeId = identityService.getUserInfo(user.getId(), Constants.USER_INFO_SKYPE); }