@Override public PeopleAssignments newPeopleAssignments() { return new PeopleAssignmentsImpl(); }
public TaskFluent setAdminUser(String userId) { if(assignments.getBusinessAdministrators().isEmpty()){ List<OrganizationalEntity> businessAdmins = new ArrayList<OrganizationalEntity>(); assignments.setBusinessAdministrators(businessAdmins); } assignments.getBusinessAdministrators().add(new UserImpl(userId)); return this; }
public TaskFluent addPotentialUser(String userId) { if(assignments.getPotentialOwners().isEmpty()){ List<OrganizationalEntity> potentialOwners = new ArrayList<OrganizationalEntity>(); assignments.setPotentialOwners(potentialOwners); } assignments.getPotentialOwners().add(new UserImpl(userId)); return this; }
@Test public void testAllowDelegateUserInBusinessAdministrators() { final long takId = 1; final String userId = "user"; final TaskImpl task = new TaskImpl(); task.setTaskData(new TaskDataImpl()); final PeopleAssignmentsImpl peopleAssignments = new PeopleAssignmentsImpl(); peopleAssignments.setBusinessAdministrators(Collections.<OrganizationalEntity>singletonList(new UserImpl(userId))); task.setPeopleAssignments(peopleAssignments); when(taskService.getTask(takId)).thenReturn(task); assertTrue(taskOperationsService.allowDelegate(takId, userId, Collections.<String>emptySet())); }
@Test public void testAllowDelegateUserInPotentialOwner() { final long takId = 1; final String userId = "user"; final TaskImpl task = new TaskImpl(); task.setTaskData(new TaskDataImpl()); final PeopleAssignmentsImpl peopleAssignments = new PeopleAssignmentsImpl(); peopleAssignments.setPotentialOwners(Collections.<OrganizationalEntity>singletonList(new UserImpl(userId))); task.setPeopleAssignments(peopleAssignments); when(taskService.getTask(takId)).thenReturn(task); assertTrue(taskOperationsService.allowDelegate(takId, userId, Collections.<String>emptySet())); }
peopleAssignments = new PeopleAssignmentsImpl(); peopleAssignments.readExternal( in );
@Test public void testAllowDelegateInitiator() { final long takId = 1; final String userId = "user"; final TaskImpl task = new TaskImpl(); task.setTaskData(new TaskDataImpl()); final PeopleAssignmentsImpl peopleAssignments = new PeopleAssignmentsImpl(); peopleAssignments.setTaskInitiator(new UserImpl(userId)); task.setPeopleAssignments(peopleAssignments); when(taskService.getTask(takId)).thenReturn(task); assertTrue(taskOperationsService.allowDelegate(takId, userId, Collections.<String>emptySet())); }
public void setRecipients(List<OrganizationalEntity> recipients) { this.recipients = convertToPersistentOrganizationalEntity(recipients); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + version; result = prime * result + priority; result = prime * result + archived.hashCode(); result = prime * result + ((taskType == null) ? 0 : taskType.hashCode()); result = prime * result + CollectionUtils.hashCode( descriptions ); result = prime * result + CollectionUtils.hashCode( names ); result = prime * result + CollectionUtils.hashCode( subjects ); result = prime * result + ((peopleAssignments == null) ? 0 : peopleAssignments.hashCode()); result = prime * result + ((delegation == null) ? 0 : delegation.hashCode()); result = prime * result + ((taskData == null) ? 0 : taskData.hashCode()); result = prime * result + ((deadlines == null) ? 0 : deadlines.hashCode()); return result; }
if ( peopleAssignments == null ) { if ( other.peopleAssignments != null ) return false; } else if ( !peopleAssignments.equals( other.peopleAssignments ) ) return false;
@Test public void testAllowDelegateGroupInBusinessAdministrators() { final long takId = 1; final String userId = "user"; final String groupId = "group"; final TaskImpl task = new TaskImpl(); task.setTaskData(new TaskDataImpl()); final PeopleAssignmentsImpl peopleAssignments = new PeopleAssignmentsImpl(); peopleAssignments.setBusinessAdministrators(Collections.<OrganizationalEntity>singletonList(new GroupImpl(groupId))); task.setPeopleAssignments(peopleAssignments); when(taskService.getTask(takId)).thenReturn(task); assertTrue(taskOperationsService.allowDelegate(takId, userId, Collections.singleton(groupId))); }
@Test public void testAllowDelegateGroupInPotentialOwner() { final long takId = 1; final String userId = "user"; final String groupId = "group"; final TaskImpl task = new TaskImpl(); task.setTaskData(new TaskDataImpl()); final PeopleAssignmentsImpl peopleAssignments = new PeopleAssignmentsImpl(); peopleAssignments.setPotentialOwners(Collections.<OrganizationalEntity>singletonList(new GroupImpl(groupId))); task.setPeopleAssignments(peopleAssignments); when(taskService.getTask(takId)).thenReturn(task); assertTrue(taskOperationsService.allowDelegate(takId, userId, Collections.singleton(groupId))); }
peopleAssignments = new PeopleAssignmentsImpl(); peopleAssignments.readExternal( in );
public void setBusinessAdministrators(List<OrganizationalEntity> businessAdministrators) { this.businessAdministrators = convertToPersistentOrganizationalEntity(businessAdministrators); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + version; result = prime * result + priority; result = prime * result + archived.hashCode(); result = prime * result + ((taskType == null) ? 0 : taskType.hashCode()); result = prime * result + CollectionUtils.hashCode( descriptions ); result = prime * result + CollectionUtils.hashCode( names ); result = prime * result + CollectionUtils.hashCode( subjects ); result = prime * result + ((peopleAssignments == null) ? 0 : peopleAssignments.hashCode()); result = prime * result + ((delegation == null) ? 0 : delegation.hashCode()); result = prime * result + ((taskData == null) ? 0 : taskData.hashCode()); result = prime * result + ((deadlines == null) ? 0 : deadlines.hashCode()); return result; }
if ( peopleAssignments == null ) { if ( other.peopleAssignments != null ) return false; } else if ( !peopleAssignments.equals( other.peopleAssignments ) ) return false;
public TaskFluent() { if (task == null) { task = new TaskImpl(); task.setTaskData(new TaskDataImpl()); assignments = new PeopleAssignmentsImpl(); task.setPeopleAssignments(assignments); names = new ArrayList<I18NText>(); task.setNames(names); descriptions = new ArrayList<I18NText>(); task.setDescriptions(descriptions); subjects = new ArrayList<I18NText>(); task.setSubjects(subjects); } }
public TaskFluent setAdminGroup(String groupId) { if(assignments.getBusinessAdministrators().isEmpty()){ List<OrganizationalEntity> businessAdmins = new ArrayList<OrganizationalEntity>(); assignments.setBusinessAdministrators(businessAdmins); } assignments.getBusinessAdministrators().add(new GroupImpl(groupId)); return this; }
public TaskFluent addPotentialGroup(String groupId) { if(assignments.getPotentialOwners().isEmpty()){ List<OrganizationalEntity> potentialOwners = new ArrayList<OrganizationalEntity>(); assignments.setPotentialOwners(potentialOwners); } assignments.getPotentialOwners().add(new GroupImpl(groupId)); return this; }
public void setPotentialOwners(List<OrganizationalEntity> potentialOwners) { this.potentialOwners = convertToPersistentOrganizationalEntity(potentialOwners); }