Package se.bth.pulse.controller
Class ProjectAdminController
java.lang.Object
se.bth.pulse.controller.ProjectAdminController
This class is a view controller that serves the project admin page. The return string is the name
of the view to be rendered. The model is used to pass attributes to the view.
-
Method Summary
Modifier and TypeMethodDescriptionshowAddProjects
(org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) Shows the add project page to the user.showDeleteProject
(Integer id, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) This function is used to render the project admin page for deleting of a project.showEditProjects
(Integer id, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) This function is used to render the project admin page for editing of a project.showEditUsersProjects
(Integer id, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) This function is used to render the project admin page for editing of a projects members.showProjects
(org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) This function is used to render the project admin page.
-
Method Details
-
showProjects
@GetMapping("/admin/projects") public String showProjects(org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) This function is used to render the project admin page. It uses the project repository to get all the projects.- Parameters:
model
- - used to pass attributes to the viewauthentication
- - used to get the username and role of the logged-in user- Returns:
- String - the view to be rendered
-
showAddProjects
@GetMapping("/admin/project/add") public String showAddProjects(org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) Shows the add project page to the user.- Parameters:
model
- - used to pass attributes to the viewauthentication
- - used to get the username and role of the logged-in user- Returns:
- String - the view to be rendered
-
showEditProjects
@GetMapping("/admin/project/edit/{id}") public String showEditProjects(@PathVariable("id") Integer id, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) This function is used to render the project admin page for editing of a project. It uses the project repository to get the project with the given id. The id is passed as a path variable.- Parameters:
id
- - the id of the project to be editedmodel
- - used to pass attributes to the viewauthentication
- - used to get the username and role of the logged-in user- Returns:
- String - the view to be rendered
-
showEditUsersProjects
@GetMapping("/admin/project/users/{id}") public String showEditUsersProjects(@PathVariable("id") Integer id, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) This function is used to render the project admin page for editing of a projects members. It uses the project repository to get the project with the given id. The id is passed as a path variable.- Parameters:
id
- - the id of the project to be editedmodel
- - used to pass attributes to the viewauthentication
- - used to get the username and role of the logged-in user- Returns:
- String - the view to be rendered
-
showDeleteProject
@GetMapping("/admin/project/delete/{id}") public String showDeleteProject(@PathVariable("id") Integer id, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) This function is used to render the project admin page for deleting of a project. It uses the project repository to get the project with the given id. The id is passed as a path variable.- Parameters:
id
- - the id of the project to be deletedmodel
- - used to pass attributes to the viewauthentication
- - used to get the username and role of the logged-in user- Returns:
-