Package main.boundary.mainpage
Class SupervisorMainPage
java.lang.Object
main.boundary.mainpage.SupervisorMainPage
The
SupervisorMainPage
class is a boundary class that represents the main page for a supervisor in a system. It provides methods to display the main page options and handle user input for different actions, such as viewing the supervisor's profile, changing the supervisor's password, creating a project, modifying project titles, viewing pending student requests, approving or rejecting student requests, submitting requests for transferring, viewing all incoming/outgoing request history and status, and logging out.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static String
getRequestToProcess
(List<Request> requests) This method allows the supervisor to view all the requests that are pending for approval.private static void
supervisorApproveOrRejectRequest
(Supervisor supervisor) This method allows the supervisor to approve or reject a request by entering the request ID and the desired status.private static void
supervisorChangeProjectTitle
(Supervisor supervisor) This method allows the supervisor to modify the title of an existing project by entering the project ID and the new title.private static void
supervisorCreateProject
(Supervisor supervisor) This method allows the supervisor to create a project by entering the required details such as project title, project description, and project capacity.static void
supervisorMainPage
(User user) This method displays the main page options to the supervisor and handles user input to perform corresponding actions based on the selected option.private static void
supervisorRequestForTransfer
(Supervisor supervisor) This method allows the supervisor to submit a request for transferring a project by entering the project ID and the student ID.private static void
supervisorViewAllPendingRequest
(Supervisor supervisor) This method displays all pending student requests for the supervisor.private static void
supervisorViewAllProjects
(Supervisor supervisor) private static void
supervisorViewAllRequestHistory
(Supervisor supervisor) This method displays all request history for the supervisor.
-
Constructor Details
-
SupervisorMainPage
public SupervisorMainPage()
-
-
Method Details
-
supervisorMainPage
This method displays the main page options to the supervisor and handles user input to perform corresponding actions based on the selected option.- Parameters:
user
- the supervisor.
-
supervisorViewAllProjects
- Throws:
PageBackException
-
supervisorViewAllRequestHistory
This method displays all request history for the supervisor.- Parameters:
supervisor
- the supervisor.- Throws:
PageBackException
-
supervisorApproveOrRejectRequest
private static void supervisorApproveOrRejectRequest(Supervisor supervisor) throws PageBackException This method allows the supervisor to approve or reject a request by entering the request ID and the desired status.- Parameters:
supervisor
- the supervisor.- Throws:
PageBackException
- if the user wants to go back to the previous page.
-
supervisorCreateProject
This method allows the supervisor to create a project by entering the required details such as project title, project description, and project capacity.- Parameters:
supervisor
- the supervisor.- Throws:
PageBackException
- if the user wants to go back to the previous page.
-
supervisorChangeProjectTitle
private static void supervisorChangeProjectTitle(Supervisor supervisor) throws ModelAlreadyExistsException, ModelNotFoundException, PageBackException This method allows the supervisor to modify the title of an existing project by entering the project ID and the new title.- Parameters:
supervisor
- the supervisor.- Throws:
ModelAlreadyExistsException
- if the project already exists.ModelNotFoundException
- if the project is not found.PageBackException
- if the user wants to go back to the previous page.
-
supervisorRequestForTransfer
This method allows the supervisor to submit a request for transferring a project by entering the project ID and the student ID.- Parameters:
supervisor
- the supervisor.- Throws:
PageBackException
- if the user wants to go back to the previous page.
-
getRequestToProcess
This method allows the supervisor to view all the requests that are pending for approval.- Parameters:
requests
- the list of requests.- Returns:
- the request ID.
- Throws:
PageBackException
- if the user wants to go back to the previous page.
-
supervisorViewAllPendingRequest
This method displays all pending student requests for the supervisor.- Parameters:
supervisor
- the supervisor.- Throws:
PageBackException
- if the user wants to go back to the previous page.
-