Class TeamRestEndpoint
java.lang.Object
ch.colabproject.colab.api.rest.team.TeamRestEndpoint
@Path("teams")
@Consumes("application/json")
@Produces("application/json")
public class TeamRestEndpoint
extends Object
REST Teams controller. Allow to manage roles and teams members
- Author:
- maxence, sandra
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeMemberPosition(Long memberId, HierarchicalPosition position) Update hierarchical position of a membervoidcreateEmptyAssignment(Long cardId, Long memberId) Add an assignment for a card and a member without involvement levelcreateRole(TeamRole role) Create a role.voiddeleteAssignments(Long cardId, Long memberId) Delete all assignments for a card and a membervoiddeleteRole(Long roleId) Delete a rolevoiddeleteSharingLinkTokensByCard(Long cardId) Delete all sharing link tokens for the given card.voiddeleteSharingLinkTokensByProject(Long projectId) Delete all sharing link tokens for the given project.voiddeleteTeamMember(Long memberId) Delete a team membergenerateSharingLinkToken(Long projectId, Long cardId) Create a token to share the project.getAssignmentsForCard(Long cardId) Get assignments related to the given cardgetAssignmentsForProject(Long projectId) Get Assignments related to the given projectGet a rolegetTeamMember(Long memberId) Get a TeamMembergetTeamMembersForProject(Long projectId) Get the members of the project teamgetTeamRolesForProject(Long projectId) Get the team roles defined in the given projectvoidgiveRoleTo(Long roleId, Long memberId) Give a role to a member.inviteSomeone(Long projectId, String email) Send invitation to someone.voidremoveAssignmentLevel(Long cardId, Long memberId) Remove the level of an assignment level for a card and a membervoidremoveRoleFrom(Long roleId, Long memberId) Remove a role from some team member.voidsetAssignment(Long cardId, Long memberId, InvolvementLevel level) Set an assignment for a card and a membervoidupdateRole(TeamRole role) Update a role.voidupdateTeamMember(TeamMember member) Update a TeamMember.
-
Constructor Details
-
TeamRestEndpoint
public TeamRestEndpoint()
-
-
Method Details
-
getTeamMembersForProject
@GET @Path("members/byproject/{projectId: [0-9]+}") public List<TeamMember> getTeamMembersForProject(@PathParam("projectId") Long projectId) Get the members of the project team- Parameters:
projectId- id of the project- Returns:
- list of team members
-
getTeamMember
@GET @Path("member/{memberId: [0-9]+}") public TeamMember getTeamMember(@PathParam("memberId") Long memberId) Get a TeamMember- Parameters:
memberId- id of the team member- Returns:
- the team member
-
updateTeamMember
Update a TeamMember. Only fields which are editable by users will be impacted.- Parameters:
member- new value- Throws:
ColabMergeException- if update failed
-
changeMemberPosition
@PUT @Path("member/{memberId: [0-9]+}/{position}") public void changeMemberPosition(@PathParam("memberId") Long memberId, @PathParam("position") HierarchicalPosition position) Update hierarchical position of a member- Parameters:
memberId- id of the memberposition- new hierarchical position
-
deleteTeamMember
@DELETE @Path("member/{memberId: [0-9]+}") public void deleteTeamMember(@PathParam("memberId") Long memberId) Delete a team member- Parameters:
memberId- id of the member
-
inviteSomeone
@POST @Path("Invite/{projectId: [0-9]+}/{email}") public TeamMember inviteSomeone(@PathParam("projectId") Long projectId, @PathParam("email") String email) Send invitation to someone.- Parameters:
projectId- id of the projectemail- recipient address- Returns:
- the pending team member
-
generateSharingLinkToken
@POST @Path("sharingLink/generate/{projectId: [0-9]+}/{cardId: [0-9]+}") public SerializationStringWrapper generateSharingLinkToken(@PathParam("projectId") Long projectId, @PathParam("cardId") Long cardId) Create a token to share the project.- Parameters:
projectId- The id of the project that will become visible (mandatory)cardId- The id of the card that will become editable (optional)- Returns:
- the URL to use to consume the token
-
deleteSharingLinkTokensByProject
@DELETE @Path("sharingLink/deleteByProject/{projectId: [0-9]+}") public void deleteSharingLinkTokensByProject(@PathParam("projectId") Long projectId) Delete all sharing link tokens for the given project.- Parameters:
projectId- the id of the project
-
deleteSharingLinkTokensByCard
@DELETE @Path("sharingLink/deleteByCard/{cardId: [0-9]+}") public void deleteSharingLinkTokensByCard(@PathParam("cardId") Long cardId) Delete all sharing link tokens for the given card.- Parameters:
cardId- the id of the card
-
getTeamRolesForProject
@GET @Path("roles/byproject/{projectId: [0-9]+}") public List<TeamRole> getTeamRolesForProject(@PathParam("projectId") Long projectId) Get the team roles defined in the given project- Parameters:
projectId- the id of the project- Returns:
- list of team roles
-
createRole
Create a role. The role must have a projectId set.- Parameters:
role- the role to create- Returns:
- id of the new role
-
getRole
Get a role- Parameters:
roleId- id of the role- Returns:
- the role
-
updateRole
Update a role. Only fields which are editable by users will be impacted.- Parameters:
role- the role to update- Throws:
ColabMergeException- if update failed
-
deleteRole
Delete a roleTODO: shall we allow to delete non-empty roles?
- Parameters:
roleId- id of the role to delete id of the role to delete
-
giveRoleTo
@PUT @Path("role/{roleId: [0-9]+}/giveto/{memberId: [0-9]+}") public void giveRoleTo(@PathParam("roleId") Long roleId, @PathParam("memberId") Long memberId) Give a role to a member. Member and role must belong to the same project. CurrentUser must have the right to edit the role- Parameters:
roleId- id of the rolememberId- id of the team member
-
removeRoleFrom
@PUT @Path("role/{roleId: [0-9]+}/removeto/{memberId : [0-9]+}") public void removeRoleFrom(@PathParam("roleId") Long roleId, @PathParam("memberId") Long memberId) Remove a role from some team member. CurrentUser must have the right to edit the role.- Parameters:
roleId- id of the rolememberId- id of the team member
-
getAssignmentsForProject
@GET @Path("assignments/byproject/{projectId: [0-9]+}") public List<Assignment> getAssignmentsForProject(@PathParam("projectId") Long projectId) Get Assignments related to the given project- Parameters:
projectId- the id of the project- Returns:
- assignments list
-
getAssignmentsForCard
@GET @Path("assignments/bycard/{cardId: [0-9]+}") public List<Assignment> getAssignmentsForCard(@PathParam("cardId") Long cardId) Get assignments related to the given card- Parameters:
cardId- id of the card- Returns:
- assignments list
-
createEmptyAssignment
@PUT @Path("assignment/card/{cardId: [0-9]+}/member/{memberId: [0-9]+}") public void createEmptyAssignment(@PathParam("cardId") Long cardId, @PathParam("memberId") Long memberId) Add an assignment for a card and a member without involvement level- Parameters:
cardId- id of the cardmemberId- id of the team member
-
setAssignment
@POST @Path("assignment/card/{cardId: [0-9]+}/member/{memberId: [0-9]+}/{level}") public void setAssignment(@PathParam("cardId") Long cardId, @PathParam("memberId") Long memberId, @PathParam("level") InvolvementLevel level) Set an assignment for a card and a member- Parameters:
cardId- id of the cardmemberId- id of the team memberlevel- involvement level
-
removeAssignmentLevel
@POST @Path("assignment/card/{cardId: [0-9]+}/member/{memberId: [0-9]+}") public void removeAssignmentLevel(@PathParam("cardId") Long cardId, @PathParam("memberId") Long memberId) Remove the level of an assignment level for a card and a member- Parameters:
cardId- id of the cardmemberId- id of the team member
-
deleteAssignments
@DELETE @Path("assignment/card/{cardId: [0-9]+}/member/{memberId: [0-9]+}") public void deleteAssignments(@PathParam("cardId") Long cardId, @PathParam("memberId") Long memberId) Delete all assignments for a card and a member- Parameters:
cardId- id of the cardmemberId- id of the team member
-