public void toolBarItemSelected() { viewManager.showQueuedPage(group.getId()); } });
@Override public List<User> meetCriteria(final List<User> users) { final List<User> usersOfGroup = new ArrayList<User>(); for (final User user : users) { final List<Group> groupsOfUser = this.groupsByUser.get(user.getId()); for (final Group groupOfUser : groupsOfUser) { if (groupOfUser != null && this.expectedGroupId.equals(groupOfUser.getId())) { usersOfGroup.add(user); break; } } } return usersOfGroup; }
@ApiOperation(value = "Delete a group", tags = {"Groups"}) @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the group was found and has been deleted. Response-body is intentionally empty."), @ApiResponse(code = 404, message = "Indicates the requested group does not exist.") }) @RequestMapping(value = "/identity/groups/{groupId}", method = RequestMethod.DELETE) public void deleteGroup(@ApiParam(name="groupId", value="The id of the group to delete.") @PathVariable String groupId, HttpServletResponse response) { Group group = getGroupFromRequest(groupId); identityService.deleteGroup(group.getId()); response.setStatus(HttpStatus.NO_CONTENT.value()); } }
@ApiOperation(value = "Delete a member from a group", tags = {"Groups"}) @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the group was found and the member has been deleted. The response body is left empty intentionally."), @ApiResponse(code = 404, message = "Indicates the requested group was not found or that the user is not a member of the group. The status description contains additional information about the error.") }) @RequestMapping(value = "/identity/groups/{groupId}/members/{userId}", method = RequestMethod.DELETE) public void deleteMembership(@ApiParam(name = "groupId", value="The id of the group to remove a member from.") @PathVariable("groupId") String groupId,@ApiParam(name = "userId", value="The id of the user to remove.") @PathVariable("userId") String userId, HttpServletRequest request, HttpServletResponse response) { Group group = getGroupFromRequest(groupId); // Check if user is not a member of group since API doesn't return typed // exception if (identityService.createUserQuery().memberOfGroup(group.getId()).userId(userId).count() != 1) { throw new ActivitiObjectNotFoundException("User '" + userId + "' is not part of group '" + group.getId() + "'.", null); } identityService.deleteMembership(userId, group.getId()); response.setStatus(HttpStatus.NO_CONTENT.value()); } }
protected List<String> getGroupsForCandidateUser(String candidateUser) { // TODO: Discuss about removing this feature? Or document it properly // and maybe recommend to not use it // and explain alternatives List<Group> groups = Context.getCommandContext().getGroupEntityManager().findGroupsByUser(candidateUser); List<String> groupIds = new ArrayList<String>(); for (Group group : groups) { groupIds.add(group.getId()); } return groupIds; }
protected Set<String> getCurrentGroups() { Set<String> groupIds = new HashSet<String>(); List<Group> currentGroups = identityService.createGroupQuery().groupMember(userId).list(); for (Group group : currentGroups) { groupIds.add(group.getId()); } return groupIds; }
protected List<String> getGroupsForCandidateUser(String candidateUser) { // TODO: Discuss about removing this feature? Or document it properly // and maybe recommend to not use it // and explain alternatives List<Group> groups = Context.getCommandContext().getGroupEntityManager().findGroupsByUser(candidateUser); List<String> groupIds = new ArrayList<String>(); for (Group group : groups) { groupIds.add(group.getId()); } return groupIds; }
protected List<String> getGroupIds(String userId) { List<String> groupIds = new ArrayList<String>(); List<Group> groups = identityService.createGroupQuery().groupMember(userId).list(); for (Group group : groups) { groupIds.add(group.getId()); } return groupIds; }
protected List<String> getGroupsForCandidateUser(String candidateUser) { // TODO: Discuss about removing this feature? Or document it properly and maybe recommend to not use it // and explain alternatives List<Group> groups = Context .getCommandContext() .getGroupEntityManager() .findGroupsByUser(candidateUser); List<String> groupIds = new ArrayList<String>(); for (Group group : groups) { groupIds.add(group.getId()); } return groupIds; }
public List<String> getAuthorizationGroups() { // Similar behaviour as the TaskQuery.taskCandidateUser() which // includes the groups the candidate // user is part of if (authorizationUserId != null) { List<Group> groups = Context.getCommandContext().getGroupEntityManager().findGroupsByUser(authorizationUserId); List<String> groupIds = new ArrayList<String>(); for (Group group : groups) { groupIds.add(group.getId()); } return groupIds; } return null; }
protected List<String> getGroupIds(String userId) { List<String> groupIds = new ArrayList<String>(); List<Group> groups = identityService.createGroupQuery().groupMember(userId).list(); for (Group group : groups) { groupIds.add(group.getId()); } return groupIds; }
protected String getGroupName(Group theGroup) { if(theGroup.getName() == null) { return theGroup.getId(); } return group.getName(); }
protected List<String> getCurrentMembers() { List<User> users = identityService.createUserQuery().memberOfGroup(group.getId()).list(); List<String> userIds = new ArrayList<String>(); for (User user : users) { userIds.add(user.getId()); } return userIds; }
public void buttonClick(ClickEvent event) { ExplorerApp.get().getViewManager().showGroupPage(group.getId()); } });
public GroupResponse createGroupResponse(Group group, RestUrlBuilder urlBuilder) { GroupResponse response = new GroupResponse(); response.setId(group.getId()); response.setName(group.getName()); response.setType(group.getType()); response.setUrl(urlBuilder.buildUrl(RestUrls.URL_GROUP, group.getId())); return response; }
public GroupListItem(Group group) { addItemProperty("id", new ObjectProperty<String>(group.getId(), String.class)); if (group.getName() != null) { addItemProperty("name", new ObjectProperty<String>(group.getName() + " (" + group.getName() + ")", String.class)); } else { addItemProperty("name", new ObjectProperty<String>("(" + group.getId() + ")", String.class)); } }
@Override protected Object doExecute() throws Exception { List<Group> groups = getProcessEngine().getIdentityService() .createGroupQuery().orderByGroupId().asc().list(); if (groups.isEmpty()) { err().println("No groups found."); } for (Group group : groups) { out().printf("%s\t%s\t%s\n", group.getId(), group.getName(), group.getType()); } return null; } }
@Override protected Object doExecute() throws Exception { List<Group> groups = getProcessEngine().getIdentityService() .createGroupQuery().orderByGroupId().asc().list(); if (groups.isEmpty()) { err().println("No groups found."); } for (Group group : groups) { out().printf("%s\t%s\t%s\n", group.getId(), group.getName(), group.getType()); } return null; } }
protected void handleFormSubmit() { try { // create user form.commit(); // will throw exception in case validation is false Group group = createGroup(); // close popup and navigate to new group close(); ExplorerApp.get().getViewManager().showGroupPage(group.getId()); } catch (InvalidValueException e) { // Do nothing: the Form component will render the errormsgs automatically setHeight(270, UNITS_PIXELS); } }
public GroupSelectionItem(Group group) { addItemProperty("id", new ObjectProperty<String>(group.getId(), String.class)); if (group.getName() != null) { addItemProperty("name", new ObjectProperty<String>(group.getName(), String.class)); } if (group.getType() != null) { addItemProperty("type", new ObjectProperty<String>(group.getType(), String.class)); } }