├── Project 01 - College Management Application ├── HELP.md ├── Readme.txt ├── mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml ├── settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ └── org.springframework.ide.eclipse.prefs ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── CMA │ │ │ │ ├── CollegeManagementApplication.java │ │ │ │ ├── DAO │ │ │ │ ├── AdminRepository.java │ │ │ │ ├── CourseRepository.java │ │ │ │ ├── GradeRepository.java │ │ │ │ ├── StudentRepository.java │ │ │ │ └── TeacherRepository.java │ │ │ │ ├── configuration │ │ │ │ └── ManufacturingConfiguration.java │ │ │ │ ├── controllers │ │ │ │ ├── Admin.java │ │ │ │ ├── AdminAdminManagement.java │ │ │ │ ├── AdminStudentManagement.java │ │ │ │ ├── AdminTeacherManagement.java │ │ │ │ ├── Login.java │ │ │ │ ├── Logout.java │ │ │ │ ├── Students.java │ │ │ │ └── Teachers.java │ │ │ │ ├── entities │ │ │ │ ├── AdminEntity.java │ │ │ │ ├── CourseEntity.java │ │ │ │ ├── GradeEntity.java │ │ │ │ ├── StudentEntity.java │ │ │ │ └── TeacherEntity.java │ │ │ │ ├── other │ │ │ │ └── CourseSelector.java │ │ │ │ └── session │ │ │ │ ├── Session.java │ │ │ │ └── SessionHandler.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── static │ │ │ ├── CSS │ │ │ │ ├── LoginScreen.css │ │ │ │ └── UserStyle.css │ │ │ └── images │ │ │ │ └── LoginImage.jpg │ │ │ └── templates │ │ │ ├── Layout.html │ │ │ ├── admin-portal │ │ │ ├── admin-admin-saved.html │ │ │ ├── admin-all-students.html │ │ │ ├── admin-all-teachers.html │ │ │ ├── admin-change-password-failed.html │ │ │ ├── admin-change-password-succeeded.html │ │ │ ├── admin-manage-account.html │ │ │ ├── admin-manage-admins.html │ │ │ ├── admin-manage-students.html │ │ │ ├── admin-manage-teachers.html │ │ │ ├── admin-page-main.html │ │ │ ├── admin-single-student.html │ │ │ ├── admin-single-teacher.html │ │ │ ├── admin-student-not-found.html │ │ │ ├── admin-student-password-reset.html │ │ │ ├── admin-student-saved.html │ │ │ ├── admin-teacher-not-found.html │ │ │ ├── admin-teacher-password-reset.html │ │ │ └── admin-teacher-saved.html │ │ │ ├── login │ │ │ ├── LoginScreen.html │ │ │ └── LoginScreenUserNotFound.html │ │ │ ├── student-portal │ │ │ ├── student-change-password-failed.html │ │ │ ├── student-change-password-succeeded.html │ │ │ ├── student-display-grades.html │ │ │ ├── student-manage-account.html │ │ │ ├── student-manage-courses.html │ │ │ └── student-page-main.html │ │ │ └── teacher-portal │ │ │ ├── teacher-change-password-failed.html │ │ │ ├── teacher-change-password-succeeded.html │ │ │ ├── teacher-course-saved.html │ │ │ ├── teacher-create-new-course.html │ │ │ ├── teacher-manage-account.html │ │ │ ├── teacher-manage-chosen-course.html │ │ │ ├── teacher-manage-courses.html │ │ │ └── teacher-page-main.html │ └── test │ │ └── java │ │ └── com │ │ └── CMA │ │ └── CollegeManagementApplicationTests.java └── target │ ├── classes │ ├── META-INF │ │ ├── MANIFEST.MF │ │ └── maven │ │ │ └── com.CMA │ │ │ └── College-Management-Application │ │ │ ├── pom.properties │ │ │ └── pom.xml │ ├── application.properties │ ├── com │ │ └── CMA │ │ │ ├── CollegeManagementApplication.class │ │ │ ├── DAO │ │ │ ├── AdminRepository.class │ │ │ ├── CourseRepository.class │ │ │ ├── GradeRepository.class │ │ │ ├── StudentRepository.class │ │ │ └── TeacherRepository.class │ │ │ ├── configuration │ │ │ └── ManufacturingConfiguration.class │ │ │ ├── controllers │ │ │ ├── Admin.class │ │ │ ├── AdminAdminManagement.class │ │ │ ├── AdminStudentManagement.class │ │ │ ├── AdminTeacherManagement.class │ │ │ ├── Login.class │ │ │ ├── Logout.class │ │ │ ├── Students.class │ │ │ └── Teachers.class │ │ │ ├── entities │ │ │ ├── AdminEntity.class │ │ │ ├── CourseEntity.class │ │ │ ├── GradeEntity.class │ │ │ ├── StudentEntity.class │ │ │ └── TeacherEntity.class │ │ │ ├── other │ │ │ └── CourseSelector.class │ │ │ ├── password │ │ │ └── PasswordGenerator.class │ │ │ └── session │ │ │ ├── Session.class │ │ │ └── SessionHandler.class │ ├── static │ │ ├── CSS │ │ │ ├── LoginScreen.css │ │ │ └── UserStyle.css │ │ └── images │ │ │ └── LoginImage.jpg │ └── templates │ │ ├── Layout.html │ │ ├── admin-portal │ │ ├── admin-admin-saved.html │ │ ├── admin-all-students.html │ │ ├── admin-all-teachers.html │ │ ├── admin-change-password-failed.html │ │ ├── admin-change-password-succeeded.html │ │ ├── admin-manage-account.html │ │ ├── admin-manage-admins.html │ │ ├── admin-manage-students.html │ │ ├── admin-manage-teachers.html │ │ ├── admin-page-main.html │ │ ├── admin-single-student.html │ │ ├── admin-single-teacher.html │ │ ├── admin-student-not-found.html │ │ ├── admin-student-password-reset.html │ │ ├── admin-student-saved.html │ │ ├── admin-teacher-not-found.html │ │ ├── admin-teacher-password-reset.html │ │ └── admin-teacher-saved.html │ │ ├── login │ │ ├── LoginScreen.html │ │ └── LoginScreenUserNotFound.html │ │ ├── student-portal │ │ ├── student-change-password-failed.html │ │ ├── student-change-password-succeeded.html │ │ ├── student-display-grades.html │ │ ├── student-manage-account.html │ │ ├── student-manage-courses.html │ │ └── student-page-main.html │ │ └── teacher-portal │ │ ├── teacher-change-password-failed.html │ │ ├── teacher-change-password-succeeded.html │ │ ├── teacher-course-saved.html │ │ ├── teacher-create-new-course.html │ │ ├── teacher-manage-account.html │ │ ├── teacher-manage-chosen-course.html │ │ ├── teacher-manage-courses.html │ │ └── teacher-page-main.html │ └── test-classes │ └── com │ └── CMA │ └── CollegeManagementApplicationTests.class ├── Project 02 - Library Application ├── HELP.md ├── mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml ├── settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ └── org.springframework.ide.eclipse.prefs ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── libraryapp │ │ │ │ ├── DAO │ │ │ │ ├── BookRepository.java │ │ │ │ ├── NotificationRepository.java │ │ │ │ └── UserRepository.java │ │ │ │ ├── LibraryApplication.java │ │ │ │ ├── controllers │ │ │ │ ├── AdminController.java │ │ │ │ ├── EmployeeController.java │ │ │ │ ├── ErrorPagesController.java │ │ │ │ ├── HomeController.java │ │ │ │ ├── SecurityController.java │ │ │ │ └── UserController.java │ │ │ │ ├── entities │ │ │ │ ├── Book.java │ │ │ │ ├── Notification.java │ │ │ │ └── User.java │ │ │ │ ├── security │ │ │ │ ├── CurrentUserFinder.java │ │ │ │ ├── SecurityConfiguration.java │ │ │ │ └── SecurityContext.java │ │ │ │ ├── services │ │ │ │ ├── BookService.java │ │ │ │ ├── NotificationService.java │ │ │ │ └── UserService.java │ │ │ │ └── utils │ │ │ │ ├── DateTracker.java │ │ │ │ ├── FineCalculator.java │ │ │ │ ├── ListInStringConverter.java │ │ │ │ └── MidnightApplicationRefresh.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── static │ │ │ ├── CSS │ │ │ │ ├── account-layout.css │ │ │ │ └── security-layout.css │ │ │ └── Images │ │ │ │ ├── library.jpg │ │ │ │ └── payment-icons.png │ │ │ └── templates │ │ │ ├── admin │ │ │ ├── admin-account-settings-saved.html │ │ │ ├── admin-confirm-account-settings.html │ │ │ ├── admin-home.html │ │ │ ├── admin-manage-account.html │ │ │ └── admin-manage-accounts.html │ │ │ ├── employee │ │ │ ├── employee-book-deleted.html │ │ │ ├── employee-book-information-changed.html │ │ │ ├── employee-book-saved.html │ │ │ ├── employee-books-returned.html │ │ │ ├── employee-change-book-info.html │ │ │ ├── employee-confirm-order.html │ │ │ ├── employee-confirm-returned-books.html │ │ │ ├── employee-delete-book.html │ │ │ ├── employee-home.html │ │ │ ├── employee-new-book.html │ │ │ ├── employee-order-saved.html │ │ │ ├── employee-orders.html │ │ │ ├── employee-reservation-ready-for-pick-up.html │ │ │ ├── employee-reservations.html │ │ │ ├── employee-returned-books.html │ │ │ ├── employee-show-books.html │ │ │ ├── employee-show-user-info.html │ │ │ └── employee-show-users.html │ │ │ ├── error-pages │ │ │ ├── 400-error.html │ │ │ ├── 403-error.html │ │ │ ├── 404-error.html │ │ │ ├── 408-error.html │ │ │ ├── 500-error.html │ │ │ ├── 502-error.html │ │ │ ├── 503-error.html │ │ │ └── 504-error.html │ │ │ ├── page-layout.html │ │ │ ├── security │ │ │ ├── account-created.html │ │ │ ├── login.html │ │ │ ├── logout.html │ │ │ └── register.html │ │ │ └── user │ │ │ ├── user-FAQ.html │ │ │ ├── user-book-can-not-be-extended.html │ │ │ ├── user-book-extended.html │ │ │ ├── user-browse-books.html │ │ │ ├── user-do-payment.html │ │ │ ├── user-home.html │ │ │ ├── user-pay-fine.html │ │ │ ├── user-pay-reservation.html │ │ │ ├── user-your-books.html │ │ │ └── user-your-reservations.html │ └── test │ │ └── java │ │ └── com │ │ └── libraryapp │ │ └── LibraryApplicationTests.java └── target │ ├── 400-error.html │ ├── classes │ ├── META-INF │ │ ├── MANIFEST.MF │ │ └── maven │ │ │ └── com.libraryapp │ │ │ └── Library-Application │ │ │ ├── pom.properties │ │ │ └── pom.xml │ ├── application.properties │ ├── com │ │ └── libraryapp │ │ │ ├── DAO │ │ │ ├── BookRepository.class │ │ │ ├── NotificationRepository.class │ │ │ └── UserRepository.class │ │ │ ├── LibraryApplication.class │ │ │ ├── controllers │ │ │ ├── AdminController.class │ │ │ ├── EmployeeController.class │ │ │ ├── ErrorPagesController.class │ │ │ ├── HomeController.class │ │ │ ├── SecurityController.class │ │ │ └── UserController.class │ │ │ ├── entities │ │ │ ├── Book.class │ │ │ ├── Notification.class │ │ │ └── User.class │ │ │ ├── security │ │ │ ├── CurrentUserFinder.class │ │ │ ├── SecurityConfiguration.class │ │ │ └── SecurityContext.class │ │ │ ├── services │ │ │ ├── BookService.class │ │ │ ├── NotificationService.class │ │ │ └── UserService.class │ │ │ └── utils │ │ │ ├── DateTracker.class │ │ │ ├── FineCalculator.class │ │ │ ├── ListInStringConverter.class │ │ │ └── MidnightApplicationRefresh.class │ ├── static │ │ ├── CSS │ │ │ ├── account-layout.css │ │ │ └── security-layout.css │ │ └── Images │ │ │ ├── library.jpg │ │ │ └── payment-icons.png │ └── templates │ │ ├── admin │ │ ├── admin-account-settings-saved.html │ │ ├── admin-confirm-account-settings.html │ │ ├── admin-home.html │ │ ├── admin-manage-account.html │ │ └── admin-manage-accounts.html │ │ ├── employee │ │ ├── employee-book-deleted.html │ │ ├── employee-book-information-changed.html │ │ ├── employee-book-saved.html │ │ ├── employee-books-returned.html │ │ ├── employee-change-book-info.html │ │ ├── employee-confirm-order.html │ │ ├── employee-confirm-returned-books.html │ │ ├── employee-delete-book.html │ │ ├── employee-home.html │ │ ├── employee-new-book.html │ │ ├── employee-order-saved.html │ │ ├── employee-orders.html │ │ ├── employee-reservation-ready-for-pick-up.html │ │ ├── employee-reservations.html │ │ ├── employee-returned-books.html │ │ ├── employee-show-books.html │ │ ├── employee-show-user-info.html │ │ └── employee-show-users.html │ │ ├── error-pages │ │ ├── 400-error.html │ │ ├── 403-error.html │ │ ├── 404-error.html │ │ ├── 408-error.html │ │ ├── 500-error.html │ │ ├── 502-error.html │ │ ├── 503-error.html │ │ └── 504-error.html │ │ ├── page-layout.html │ │ ├── security │ │ ├── account-created.html │ │ ├── login.html │ │ ├── logout.html │ │ └── register.html │ │ └── user │ │ ├── user-FAQ.html │ │ ├── user-book-can-not-be-extended.html │ │ ├── user-book-extended.html │ │ ├── user-browse-books.html │ │ ├── user-do-payment.html │ │ ├── user-home.html │ │ ├── user-pay-fine.html │ │ ├── user-pay-reservation.html │ │ ├── user-your-books.html │ │ └── user-your-reservations.html │ └── test-classes │ └── com │ └── libraryapp │ └── LibraryApplicationTests.class └── README.md /Project 01 - College Management Application/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.4/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.4/maven-plugin/reference/html/#build-image) 9 | * [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.4.4/reference/htmlsingle/#using-boot-devtools) 10 | * [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.4.4/reference/htmlsingle/#boot-features-jpa-and-spring-data) 11 | * [Thymeleaf](https://docs.spring.io/spring-boot/docs/2.4.4/reference/htmlsingle/#boot-features-spring-mvc-template-engines) 12 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.4.4/reference/htmlsingle/#boot-features-developing-web-applications) 13 | 14 | ### Guides 15 | The following guides illustrate how to use some features concretely: 16 | 17 | * [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) 18 | * [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/) 19 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 20 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 21 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 22 | 23 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Project 01 - College Management Application/mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.4 9 | 10 | 11 | com.CMA 12 | College-Management-Application 13 | 0.0.1-SNAPSHOT 14 | College-Management-Application 15 | College Management Application 16 | 17 | 1.8 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-thymeleaf 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-devtools 36 | runtime 37 | true 38 | 39 | 40 | com.h2database 41 | h2 42 | runtime 43 | 44 | 45 | org.springframework.boot 46 | spring-boot-starter-test 47 | test 48 | 49 | 50 | 51 | 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-maven-plugin 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=UTF-8 5 | encoding/=UTF-8 6 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.methodParameters=generate 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled 6 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 7 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore 8 | org.eclipse.jdt.core.compiler.release=disabled 9 | org.eclipse.jdt.core.compiler.source=1.8 10 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles=pom.xml 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/settings/org.springframework.ide.eclipse.prefs: -------------------------------------------------------------------------------- 1 | boot.validation.initialized=true 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/DAO/AdminRepository.java: -------------------------------------------------------------------------------- 1 | package com.CMA.DAO; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.CMA.entities.AdminEntity; 6 | 7 | public interface AdminRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/DAO/CourseRepository.java: -------------------------------------------------------------------------------- 1 | package com.CMA.DAO; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.CMA.entities.CourseEntity; 6 | 7 | public interface CourseRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/DAO/GradeRepository.java: -------------------------------------------------------------------------------- 1 | package com.CMA.DAO; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.CMA.entities.GradeEntity; 6 | 7 | public interface GradeRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/DAO/StudentRepository.java: -------------------------------------------------------------------------------- 1 | package com.CMA.DAO; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.CMA.entities.StudentEntity; 6 | 7 | public interface StudentRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/DAO/TeacherRepository.java: -------------------------------------------------------------------------------- 1 | package com.CMA.DAO; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.CMA.entities.TeacherEntity; 6 | 7 | public interface TeacherRepository extends CrudRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/configuration/ManufacturingConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.CMA.configuration; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | import com.CMA.other.CourseSelector; 7 | 8 | @Configuration 9 | public class ManufacturingConfiguration { 10 | 11 | @Bean 12 | public CourseSelector newCourseSelector() { 13 | return new CourseSelector(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/controllers/AdminAdminManagement.java: -------------------------------------------------------------------------------- 1 | package com.CMA.controllers; 2 | import java.util.List; 3 | 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.ui.Model; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | 12 | import com.CMA.DAO.AdminRepository; 13 | import com.CMA.entities.AdminEntity; 14 | import com.CMA.session.SessionHandler; 15 | 16 | @Controller 17 | @RequestMapping(value="/admin") 18 | public class AdminAdminManagement { 19 | 20 | private String portalType="ADMIN"; 21 | 22 | @Autowired 23 | AdminRepository adRepo; 24 | 25 | @GetMapping(value="/ManageAdmins") 26 | public String manageAdmins(Model model) { 27 | if (SessionHandler.accessNotAllowed(portalType)) return SessionHandler.redirect(); 28 | model.addAttribute("admin", new AdminEntity()); 29 | List allAdmins = (List) adRepo.findAll(); 30 | model.addAttribute("allAdmins", allAdmins); 31 | return "admin-portal/admin-manage-admins.html"; 32 | } 33 | 34 | @PostMapping(value="/saveAdmin") 35 | public String saveAdmin(AdminEntity admin, @RequestParam String password) { 36 | if (SessionHandler.accessNotAllowed(portalType)) return SessionHandler.redirect(); 37 | admin.setPassword(password); 38 | adRepo.save(admin); 39 | return "redirect:/admin/adminSaved"; 40 | } 41 | 42 | @GetMapping(value="/adminSaved") 43 | public String adminSaved() { 44 | if (SessionHandler.accessNotAllowed(portalType)) return SessionHandler.redirect(); 45 | return "admin-portal/admin-admin-saved.html"; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/controllers/Login.java: -------------------------------------------------------------------------------- 1 | package com.CMA.controllers; 2 | import org.springframework.beans.factory.annotation.Autowired; 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PostMapping; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | 8 | import com.CMA.DAO.AdminRepository; 9 | import com.CMA.DAO.StudentRepository; 10 | import com.CMA.DAO.TeacherRepository; 11 | import com.CMA.entities.AdminEntity; 12 | import com.CMA.entities.StudentEntity; 13 | import com.CMA.entities.TeacherEntity; 14 | import com.CMA.session.Session; 15 | import com.CMA.session.SessionHandler; 16 | 17 | 18 | @Controller 19 | public class Login { 20 | 21 | @Autowired 22 | AdminRepository adRepo; 23 | 24 | @Autowired 25 | TeacherRepository teaRepo; 26 | 27 | @Autowired 28 | StudentRepository studRepo; 29 | 30 | 31 | @GetMapping 32 | public String login() { 33 | return "login/LoginScreen"; 34 | } 35 | 36 | @GetMapping(value="/pleasetryagain") 37 | public String tryAgain() { 38 | return "login/LoginScreenUserNotFound"; 39 | } 40 | 41 | @PostMapping(value="/authorisation") 42 | public String authorisation(@RequestParam String email, @RequestParam String password) { 43 | 44 | for (StudentEntity student : studRepo.findAll()) { 45 | if (student.getEmail().toLowerCase().equals(email.toLowerCase()) && student.getPassword().equals(password)) { 46 | SessionHandler.setSession(new Session(true, "STUDENT", student.getStudentId())); 47 | return "redirect:/students"; 48 | } 49 | } 50 | 51 | for (TeacherEntity teacher : teaRepo.findAll()) { 52 | if (teacher.getEmail().toLowerCase().equals(email.toLowerCase()) && teacher.getPassword().equals(password)) { 53 | SessionHandler.setSession(new Session(true, "TEACHER", teacher.getTeacherId())); 54 | return "redirect:/teachers"; 55 | } 56 | } 57 | 58 | for (AdminEntity admin : adRepo.findAll()) { 59 | if (admin.getEmail().toLowerCase().equals(email.toLowerCase()) && admin.getPassword().equals(password)) { 60 | SessionHandler.setSession(new Session(true, "ADMIN", admin.getAdminId())); 61 | return "redirect:/admin"; 62 | } 63 | } 64 | 65 | return "redirect:/pleasetryagain"; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/controllers/Logout.java: -------------------------------------------------------------------------------- 1 | package com.CMA.controllers; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | import com.CMA.session.SessionHandler; 7 | 8 | @Controller 9 | public class Logout { 10 | 11 | @GetMapping(value="/logout") 12 | public String logout() { 13 | SessionHandler.getSession().setLoggedIn(false); 14 | SessionHandler.getSession().setUserId(-1); 15 | SessionHandler.getSession().setUserType(""); 16 | return "redirect:/"; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/entities/AdminEntity.java: -------------------------------------------------------------------------------- 1 | package com.CMA.entities; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | 8 | @Entity 9 | public class AdminEntity { 10 | 11 | @Id 12 | @GeneratedValue(strategy=GenerationType.AUTO) 13 | private long adminId; 14 | private String firstName; 15 | private String lastName; 16 | private String email; 17 | private String password; 18 | 19 | public AdminEntity () { 20 | 21 | } 22 | 23 | public AdminEntity(String firstName, String lastName, String email, String password) { 24 | super(); 25 | this.firstName = firstName; 26 | this.lastName = lastName; 27 | this.email = email; 28 | this.password = password; 29 | } 30 | 31 | public String getFirstName() { 32 | return firstName; 33 | } 34 | public void setFirstName(String fistName) { 35 | this.firstName = fistName; 36 | } 37 | public String getLastName() { 38 | return lastName; 39 | } 40 | public void setLastName(String lastName) { 41 | this.lastName = lastName; 42 | } 43 | public String getEmail() { 44 | return email; 45 | } 46 | public void setEmail(String email) { 47 | this.email = email; 48 | } 49 | public String getPassword() { 50 | return password; 51 | } 52 | public void setPassword(String password) { 53 | this.password = password; 54 | } 55 | 56 | public long getAdminId() { 57 | return adminId; 58 | } 59 | 60 | public void setAdminId(long adminId) { 61 | this.adminId = adminId; 62 | } 63 | 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/entities/GradeEntity.java: -------------------------------------------------------------------------------- 1 | package com.CMA.entities; 2 | 3 | import javax.persistence.CascadeType; 4 | import javax.persistence.Entity; 5 | import javax.persistence.FetchType; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.ManyToOne; 11 | 12 | @Entity 13 | public class GradeEntity{ 14 | 15 | 16 | @Id 17 | @GeneratedValue(strategy=GenerationType.AUTO) 18 | private long gradeId; 19 | 20 | private double grade; 21 | 22 | @ManyToOne(cascade= {CascadeType.DETACH, CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, fetch = FetchType.LAZY) 23 | @JoinColumn(name="course_Id") 24 | private CourseEntity theCourse; 25 | 26 | @ManyToOne(cascade = {CascadeType.DETACH, CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, fetch = FetchType.LAZY) 27 | @JoinColumn(name="student_Id") 28 | private StudentEntity theStudent; 29 | 30 | public GradeEntity() { 31 | 32 | } 33 | 34 | public GradeEntity(double grade) { 35 | super(); 36 | 37 | this.grade = grade; 38 | } 39 | 40 | public double getGrade() { 41 | return grade; 42 | } 43 | 44 | public void setGrade(double grade) { 45 | this.grade = grade; 46 | } 47 | 48 | public StudentEntity getTheStudent() { 49 | return theStudent; 50 | } 51 | 52 | public void setTheStudent(StudentEntity theStudent) { 53 | this.theStudent = theStudent; 54 | } 55 | 56 | public long getGradeId() { 57 | return gradeId; 58 | } 59 | 60 | public void setGradeId(long gradeId) { 61 | this.gradeId = gradeId; 62 | } 63 | 64 | public CourseEntity getTheCourse() { 65 | return theCourse; 66 | } 67 | 68 | public void setTheCourse(CourseEntity theCourse) { 69 | this.theCourse = theCourse; 70 | } 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/entities/TeacherEntity.java: -------------------------------------------------------------------------------- 1 | package com.CMA.entities; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.OneToMany; 10 | 11 | @Entity 12 | public class TeacherEntity { 13 | 14 | @Id 15 | @GeneratedValue(strategy=GenerationType.AUTO) 16 | private long teacherId; 17 | 18 | private String firstName; 19 | private String lastName; 20 | private String email; 21 | private String password; 22 | 23 | @OneToMany(mappedBy="theTeacher") 24 | private List courses; 25 | 26 | public TeacherEntity() { 27 | 28 | } 29 | 30 | public TeacherEntity(String firstName, String lastName, String email, String password) { 31 | super(); 32 | this.firstName = firstName; 33 | this.lastName = lastName; 34 | this.email = email; 35 | this.password = password; 36 | } 37 | 38 | public long getTeacherId() { 39 | return teacherId; 40 | } 41 | 42 | public void setTeacherId(long teacherId) { 43 | this.teacherId = teacherId; 44 | } 45 | 46 | public String getFirstName() { 47 | return firstName; 48 | } 49 | 50 | public void setFirstName(String firstName) { 51 | this.firstName = firstName; 52 | } 53 | 54 | public String getLastName() { 55 | return lastName; 56 | } 57 | 58 | public void setLastName(String lastName) { 59 | this.lastName = lastName; 60 | } 61 | 62 | public String getEmail() { 63 | return email; 64 | } 65 | 66 | public void setEmail(String email) { 67 | this.email = email; 68 | } 69 | 70 | public String getPassword() { 71 | return password; 72 | } 73 | 74 | public void setPassword(String password) { 75 | this.password = password; 76 | } 77 | 78 | public List getCourses() { 79 | return courses; 80 | } 81 | 82 | public void setCourses(List courses) { 83 | this.courses = courses; 84 | } 85 | 86 | 87 | 88 | 89 | } 90 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/session/Session.java: -------------------------------------------------------------------------------- 1 | package com.CMA.session; 2 | 3 | public class Session { 4 | 5 | boolean loggedIn; 6 | private String userType; 7 | private long userId; 8 | 9 | public Session(boolean loggedIn, String userType, long userId) { 10 | this.loggedIn = loggedIn; 11 | this.userType = userType; 12 | this.userId = userId; 13 | } 14 | 15 | public boolean isLoggedIn() { 16 | return loggedIn; 17 | } 18 | 19 | public void setLoggedIn(boolean loggedIn) { 20 | this.loggedIn = loggedIn; 21 | } 22 | 23 | public String getUserType() { 24 | return userType; 25 | } 26 | 27 | public void setUserType(String userType) { 28 | this.userType = userType; 29 | } 30 | 31 | public long getUserId() { 32 | return userId; 33 | } 34 | 35 | public void setUserId(long userId) { 36 | this.userId = userId; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/java/com/CMA/session/SessionHandler.java: -------------------------------------------------------------------------------- 1 | package com.CMA.session; 2 | 3 | public class SessionHandler{ 4 | 5 | private static Session session = new Session(false, "", -1); 6 | 7 | public static void setSession(Session session) { 8 | SessionHandler.session=session; 9 | } 10 | 11 | public static Session getSession() { 12 | return session; 13 | } 14 | 15 | public static Boolean accessNotAllowed(String userType) { 16 | if (session.loggedIn==false) return true; 17 | else if (!(userType.equals(session.getUserType()))) return true; 18 | else return false; 19 | } 20 | 21 | public static String redirect() { 22 | if (session.getUserType().equals("ADMIN")) return "redirect:/admin"; 23 | else if (session.getUserType().equals("STUDENT")) return "redirect:/students"; 24 | else if (session.getUserType().equals("TEACHER")) return "redirect:/teachers"; 25 | else return "redirect:/"; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/h2-console 3 | spring.jpa.show-sql=true 4 | spring.thymeleaf.cache=false 5 | spring.datasource.url=jdbc:h2:mem:testdb -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/static/CSS/LoginScreen.css: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | 3 | * { 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background: url("/images/LoginImage.jpg") no-repeat center center fixed; 9 | background-size: cover; 10 | font-family: Helvetica, sans-serif; 11 | } 12 | 13 | .wrapper { 14 | padding: 130px; 15 | 16 | } 17 | 18 | input[type=text],input[type=password], select, textarea { 19 | width: 100%; 20 | padding: 12px; 21 | border: 1px solid #ccc; 22 | border-radius: 4px; 23 | resize: vertical; 24 | } 25 | 26 | label { 27 | padding: 12px 12px 12px 0; 28 | display: inline-block; 29 | } 30 | 31 | input[type=submit] { 32 | background-color:#F08080; 33 | color: white; 34 | padding: 12px 20px; 35 | margin-top: 8px; 36 | border: none; 37 | border-radius: 4px; 38 | cursor: pointer; 39 | float: right; 40 | } 41 | 42 | .container { 43 | 44 | width: 350px; 45 | border-radius: 5px; 46 | background-color: #f2f2f2; 47 | padding: 20px; 48 | } 49 | 50 | .col-25 { 51 | float: left; 52 | width: 25%; 53 | margin-top: 6px; 54 | } 55 | 56 | .col-75 { 57 | float: left; 58 | width: 75%; 59 | margin-top: 6px; 60 | } 61 | 62 | .row:after { 63 | content: ""; 64 | display: table; 65 | clear: both; 66 | } 67 | 68 | .incorrect{ 69 | color: red; 70 | } 71 | 72 | @media screen and (max-width: 600px) { 73 | .col-25, .col-75, input[type=submit] { 74 | width: 100%; 75 | margin-top: 0; 76 | } 77 | } -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/static/images/LoginImage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/src/main/resources/static/images/LoginImage.jpg -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/Layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 21 | 22 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-admin-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Student created 6 | 7 | 8 | 9 |
10 |
11 |
12 |

New admin account created!

13 |
14 | 15 |
16 |
17 |
18 |
19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-all-students.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All students 6 | 7 | 8 | 9 |
    10 | 11 |
    12 |
    13 |

    All students

    14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
    Student IDFirst NameLast NameEmail
    28 |
    29 |
    30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-all-teachers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All teachers 6 | 7 | 8 | 9 |
      10 | 11 |
      12 |
      13 |

      All teachers

      14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
      Teacher IDFirst NameLast NameEmail
      28 |
      29 |
      30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-change-password-failed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Changing password failed 6 | 7 | 8 | 9 |
      10 |
      11 |
      12 |

      Changing password failed!

      13 | Old password is incorrect or mismatch between the new password and the confirmation. 14 |
      15 | 16 |
      17 |
      18 |
      19 |
      20 | 21 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-change-password-succeeded.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Password changed 6 | 7 | 8 | 9 |
      10 |
      11 |
      12 |

      Password is changed!

      13 |
      14 | 15 |
      16 |
      17 |
      18 |
      19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-page-main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Admin Dashboard 7 | 8 | 9 |
        10 | 11 |
        12 |
        13 |
        14 |
        15 |
        16 |

        17 |
        18 |
        19 | 20 |
        21 |
        22 |
        23 |
        24 |
        25 | 26 |
        27 |
        28 |

        Dashboard

        29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
        DataValue
        Total amount of students
        Total amount of teachers
        Average grade of all students
        47 |
        48 |
        49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-single-student.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Manage single student account 6 | 7 | 8 | 9 |
          10 | 11 |
          12 |
          13 | 14 |

          15 | 16 |
          17 |
          18 |

          Student ID:

          19 |
          20 |
          21 |

          22 |
          23 |
          24 | 25 |
          26 |
          27 |

          Email:

          28 |
          29 |
          30 |

          31 |
          32 |
          33 |
          34 |
          35 | 36 | 37 | 38 |
          39 |
          40 |
          41 |

          Reset password

          42 | 43 | 44 | 45 | 46 |
          47 |

          *Password will be reset to: "123456789".

          48 |
          49 | 50 |
          51 | 52 |
          53 |
          54 |
          55 |
          56 | 57 |
          58 |
          59 | 60 |

          Grades

          61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 |
          CourseGrade
          72 | 73 |
          74 |
          75 | 76 | 77 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-single-teacher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Manage single teacher account 6 | 7 | 8 | 9 |
            10 | 11 |
            12 |
            13 | 14 |

            15 | 16 |
            17 |
            18 |

            Teacher ID:

            19 |
            20 |
            21 |

            22 |
            23 |
            24 | 25 |
            26 |
            27 |

            Email:

            28 |
            29 |
            30 |

            31 |
            32 |
            33 |
            34 |
            35 | 36 | 37 | 38 |
            39 |
            40 |
            41 |

            Reset password

            42 | 43 | 44 | 45 | 46 |
            47 |

            *Password will be reset to: "Teacher543210".

            48 |
            49 | 50 |
            51 | 52 |
            53 |
            54 |
            55 |
            56 | 57 |
            58 |
            59 |

            Courses and average grades

            60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
            CourseAverage grade
            71 |
            72 |
            73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-student-not-found.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Student not found 6 | 7 | 8 | 9 |
            10 |
            11 |
            12 |

            Student not found!

            13 |
            14 | 15 |
            16 |
            17 |
            18 |
            19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-student-password-reset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Password reset 6 | 7 | 8 | 9 |
            10 |
            11 |
            12 |

            Password of student account is reset!

            13 |
            14 | 15 |
            16 |
            17 |
            18 |
            19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-student-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Student created 6 | 7 | 8 | 9 |
            10 |
            11 |
            12 |

            New student account created!

            13 |
            14 | 15 |
            16 |
            17 |
            18 |
            19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-teacher-not-found.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Teacher not found 6 | 7 | 8 | 9 |
            10 |
            11 |
            12 |

            Teacher not found!

            13 |
            14 | 15 |
            16 |
            17 |
            18 |
            19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-teacher-password-reset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Password reset 6 | 7 | 8 | 9 |
            10 |
            11 |
            12 |

            Password of teacher account is reset!

            13 |
            14 | 15 |
            16 |
            17 |
            18 |
            19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/admin-portal/admin-teacher-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Student created 6 | 7 | 8 | 9 |
            10 |
            11 |
            12 |

            New teacher account created!

            13 |
            14 | 15 |
            16 |
            17 |
            18 |
            19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/login/LoginScreen.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Login 6 | 7 | 8 | 9 |
            10 |
            11 |
            12 |
            13 |
            14 | 15 |
            16 |
            17 | 18 |
            19 |
            20 |
            21 |
            22 | 23 |
            24 |
            25 | 26 |
            27 |
            28 |
            29 | 30 |
            31 |
            32 |
            33 |
            34 | 35 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/login/LoginScreenUserNotFound.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Login 6 | 7 | 8 | 9 |
            10 |
            11 |
            12 | 13 |
            14 |
            15 | 16 |
            17 |
            18 | 19 |
            20 |
            21 |
            22 |
            23 | 24 |
            25 |
            26 | 27 |
            28 |
            29 |
            30 | 31 |
            32 |
            33 |
            34 |
            35 | 36 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/student-portal/student-change-password-failed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Changing password failed 6 | 7 | 8 | 9 |
            10 |
            11 |
            12 |

            Changing password failed!

            13 | Old password is incorrect or mismatch between the new password and the confirmation. 14 |
            15 | 16 |
            17 |
            18 |
            19 |
            20 | 21 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/student-portal/student-change-password-succeeded.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Password changed 6 | 7 | 8 | 9 |
            10 |
            11 |
            12 |

            Password is changed!

            13 |
            14 | 15 |
            16 |
            17 |
            18 |
            19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/student-portal/student-display-grades.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Grades 7 | 8 | 9 |
              10 | 11 |
              12 |
              13 |

              Grades

              14 |
              15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
              Course nameGrade
              25 |
              26 |
              27 |
              28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/student-portal/student-manage-courses.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Manage courses 7 | 8 | 9 |
                10 | 11 |
                12 |
                13 |
                14 |

                Available courses

                15 |
                16 |
                17 |

                Course

                18 |
                19 |
                20 | 23 |
                24 |

                *Courses that reached the maximum amount of students or are already started, are not available anymore.

                25 |
                26 |
                27 | 28 |
                29 |
                30 |
                31 |
                32 |
                33 |
                34 | 35 |
                36 |
                37 |

                Enrolled Courses (not started)

                38 |
                39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
                Course nameStart dateEnd date
                51 |
                52 |
                53 |
                54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/teacher-portal/teacher-change-password-failed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Changing password failed 6 | 7 | 8 | 9 |
                10 |
                11 |
                12 |

                Changing password failed!

                13 | Old password is incorrect or mismatch between the new password and the confirmation. 14 |
                15 | 16 |
                17 |
                18 |
                19 |
                20 | 21 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/teacher-portal/teacher-change-password-succeeded.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Password changed 6 | 7 | 8 | 9 |
                10 |
                11 |
                12 |

                Password is changed!

                13 |
                14 | 15 |
                16 |
                17 |
                18 |
                19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/main/resources/templates/teacher-portal/teacher-course-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Course saved 6 | 7 | 8 | 9 |
                10 |
                11 |
                12 |

                New course created!

                13 |
                14 | 15 |
                16 |
                17 |
                18 |
                19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/src/test/java/com/CMA/CollegeManagementApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.CMA; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CollegeManagementApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Build-Jdk-Spec: 15 3 | Implementation-Title: College-Management-Application 4 | Implementation-Version: 0.0.1-SNAPSHOT 5 | Created-By: Maven Integration for Eclipse 6 | 7 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/META-INF/maven/com.CMA/College-Management-Application/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Sun Mar 28 13:43:40 CEST 2021 3 | m2e.projectLocation=C\:\\Users\\marti\\eclipse-workspace\\College-Management-Application 4 | m2e.projectName=College-Management-Application 5 | groupId=com.CMA 6 | artifactId=College-Management-Application 7 | version=0.0.1-SNAPSHOT 8 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/META-INF/maven/com.CMA/College-Management-Application/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.4 9 | 10 | 11 | com.CMA 12 | College-Management-Application 13 | 0.0.1-SNAPSHOT 14 | College-Management-Application 15 | College Management Application 16 | 17 | 1.8 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-thymeleaf 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-devtools 36 | runtime 37 | true 38 | 39 | 40 | com.h2database 41 | h2 42 | runtime 43 | 44 | 45 | org.springframework.boot 46 | spring-boot-starter-test 47 | test 48 | 49 | 50 | 51 | 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-maven-plugin 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/h2-console 3 | spring.jpa.show-sql=true 4 | spring.thymeleaf.cache=false 5 | spring.datasource.url=jdbc:h2:mem:testdb -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/CollegeManagementApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/CollegeManagementApplication.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/DAO/AdminRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/DAO/AdminRepository.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/DAO/CourseRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/DAO/CourseRepository.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/DAO/GradeRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/DAO/GradeRepository.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/DAO/StudentRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/DAO/StudentRepository.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/DAO/TeacherRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/DAO/TeacherRepository.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/configuration/ManufacturingConfiguration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/configuration/ManufacturingConfiguration.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/controllers/Admin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/controllers/Admin.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/controllers/AdminAdminManagement.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/controllers/AdminAdminManagement.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/controllers/AdminStudentManagement.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/controllers/AdminStudentManagement.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/controllers/AdminTeacherManagement.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/controllers/AdminTeacherManagement.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/controllers/Login.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/controllers/Login.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/controllers/Logout.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/controllers/Logout.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/controllers/Students.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/controllers/Students.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/controllers/Teachers.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/controllers/Teachers.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/entities/AdminEntity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/entities/AdminEntity.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/entities/CourseEntity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/entities/CourseEntity.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/entities/GradeEntity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/entities/GradeEntity.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/entities/StudentEntity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/entities/StudentEntity.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/entities/TeacherEntity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/entities/TeacherEntity.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/other/CourseSelector.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/other/CourseSelector.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/password/PasswordGenerator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/password/PasswordGenerator.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/session/Session.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/session/Session.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/com/CMA/session/SessionHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/com/CMA/session/SessionHandler.class -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/static/CSS/LoginScreen.css: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | 3 | * { 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background: url("/images/LoginImage.jpg") no-repeat center center fixed; 9 | background-size: cover; 10 | font-family: Helvetica, sans-serif; 11 | } 12 | 13 | .wrapper { 14 | padding: 130px; 15 | 16 | } 17 | 18 | input[type=text],input[type=password], select, textarea { 19 | width: 100%; 20 | padding: 12px; 21 | border: 1px solid #ccc; 22 | border-radius: 4px; 23 | resize: vertical; 24 | } 25 | 26 | label { 27 | padding: 12px 12px 12px 0; 28 | display: inline-block; 29 | } 30 | 31 | input[type=submit] { 32 | background-color:#F08080; 33 | color: white; 34 | padding: 12px 20px; 35 | margin-top: 8px; 36 | border: none; 37 | border-radius: 4px; 38 | cursor: pointer; 39 | float: right; 40 | } 41 | 42 | .container { 43 | 44 | width: 350px; 45 | border-radius: 5px; 46 | background-color: #f2f2f2; 47 | padding: 20px; 48 | } 49 | 50 | .col-25 { 51 | float: left; 52 | width: 25%; 53 | margin-top: 6px; 54 | } 55 | 56 | .col-75 { 57 | float: left; 58 | width: 75%; 59 | margin-top: 6px; 60 | } 61 | 62 | .row:after { 63 | content: ""; 64 | display: table; 65 | clear: both; 66 | } 67 | 68 | .incorrect{ 69 | color: red; 70 | } 71 | 72 | @media screen and (max-width: 600px) { 73 | .col-25, .col-75, input[type=submit] { 74 | width: 100%; 75 | margin-top: 0; 76 | } 77 | } -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/static/images/LoginImage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/classes/static/images/LoginImage.jpg -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/Layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 21 | 22 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-admin-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Student created 6 | 7 | 8 | 9 |
                10 |
                11 |
                12 |

                New admin account created!

                13 |
                14 | 15 |
                16 |
                17 |
                18 |
                19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-all-students.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All students 6 | 7 | 8 | 9 |
                  10 | 11 |
                  12 |
                  13 |

                  All students

                  14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
                  Student IDFirst NameLast NameEmail
                  28 |
                  29 |
                  30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-all-teachers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All teachers 6 | 7 | 8 | 9 |
                    10 | 11 |
                    12 |
                    13 |

                    All teachers

                    14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
                    Teacher IDFirst NameLast NameEmail
                    28 |
                    29 |
                    30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-change-password-failed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Changing password failed 6 | 7 | 8 | 9 |
                    10 |
                    11 |
                    12 |

                    Changing password failed!

                    13 | Old password is incorrect or mismatch between the new password and the confirmation. 14 |
                    15 | 16 |
                    17 |
                    18 |
                    19 |
                    20 | 21 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-change-password-succeeded.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Password changed 6 | 7 | 8 | 9 |
                    10 |
                    11 |
                    12 |

                    Password is changed!

                    13 |
                    14 | 15 |
                    16 |
                    17 |
                    18 |
                    19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-page-main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Admin Dashboard 7 | 8 | 9 |
                      10 | 11 |
                      12 |
                      13 |
                      14 |
                      15 |
                      16 |

                      17 |
                      18 |
                      19 | 20 |
                      21 |
                      22 |
                      23 |
                      24 |
                      25 | 26 |
                      27 |
                      28 |

                      Dashboard

                      29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
                      DataValue
                      Total amount of students
                      Total amount of teachers
                      Average grade of all students
                      47 |
                      48 |
                      49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-single-student.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Manage single student account 6 | 7 | 8 | 9 |
                        10 | 11 |
                        12 |
                        13 | 14 |

                        15 | 16 |
                        17 |
                        18 |

                        Student ID:

                        19 |
                        20 |
                        21 |

                        22 |
                        23 |
                        24 | 25 |
                        26 |
                        27 |

                        Email:

                        28 |
                        29 |
                        30 |

                        31 |
                        32 |
                        33 |
                        34 |
                        35 | 36 | 37 | 38 |
                        39 |
                        40 |
                        41 |

                        Reset password

                        42 | 43 | 44 | 45 | 46 |
                        47 |

                        *Password will be reset to: "123456789".

                        48 |
                        49 | 50 |
                        51 | 52 |
                        53 |
                        54 |
                        55 |
                        56 | 57 |
                        58 |
                        59 | 60 |

                        Grades

                        61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 |
                        CourseGrade
                        72 | 73 |
                        74 |
                        75 | 76 | 77 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-single-teacher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Manage single teacher account 6 | 7 | 8 | 9 |
                          10 | 11 |
                          12 |
                          13 | 14 |

                          15 | 16 |
                          17 |
                          18 |

                          Teacher ID:

                          19 |
                          20 |
                          21 |

                          22 |
                          23 |
                          24 | 25 |
                          26 |
                          27 |

                          Email:

                          28 |
                          29 |
                          30 |

                          31 |
                          32 |
                          33 |
                          34 |
                          35 | 36 | 37 | 38 |
                          39 |
                          40 |
                          41 |

                          Reset password

                          42 | 43 | 44 | 45 | 46 |
                          47 |

                          *Password will be reset to: "Teacher543210".

                          48 |
                          49 | 50 |
                          51 | 52 |
                          53 |
                          54 |
                          55 |
                          56 | 57 |
                          58 |
                          59 |

                          Courses and average grades

                          60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
                          CourseAverage grade
                          71 |
                          72 |
                          73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-student-not-found.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Student not found 6 | 7 | 8 | 9 |
                          10 |
                          11 |
                          12 |

                          Student not found!

                          13 |
                          14 | 15 |
                          16 |
                          17 |
                          18 |
                          19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-student-password-reset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Password reset 6 | 7 | 8 | 9 |
                          10 |
                          11 |
                          12 |

                          Password of student account is reset!

                          13 |
                          14 | 15 |
                          16 |
                          17 |
                          18 |
                          19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-student-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Student created 6 | 7 | 8 | 9 |
                          10 |
                          11 |
                          12 |

                          New student account created!

                          13 |
                          14 | 15 |
                          16 |
                          17 |
                          18 |
                          19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-teacher-not-found.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Teacher not found 6 | 7 | 8 | 9 |
                          10 |
                          11 |
                          12 |

                          Teacher not found!

                          13 |
                          14 | 15 |
                          16 |
                          17 |
                          18 |
                          19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-teacher-password-reset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Password reset 6 | 7 | 8 | 9 |
                          10 |
                          11 |
                          12 |

                          Password of teacher account is reset!

                          13 |
                          14 | 15 |
                          16 |
                          17 |
                          18 |
                          19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/admin-portal/admin-teacher-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Student created 6 | 7 | 8 | 9 |
                          10 |
                          11 |
                          12 |

                          New teacher account created!

                          13 |
                          14 | 15 |
                          16 |
                          17 |
                          18 |
                          19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/login/LoginScreen.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Login 6 | 7 | 8 | 9 |
                          10 |
                          11 |
                          12 |
                          13 |
                          14 | 15 |
                          16 |
                          17 | 18 |
                          19 |
                          20 |
                          21 |
                          22 | 23 |
                          24 |
                          25 | 26 |
                          27 |
                          28 |
                          29 | 30 |
                          31 |
                          32 |
                          33 |
                          34 | 35 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/login/LoginScreenUserNotFound.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Login 6 | 7 | 8 | 9 |
                          10 |
                          11 |
                          12 | 13 |
                          14 |
                          15 | 16 |
                          17 |
                          18 | 19 |
                          20 |
                          21 |
                          22 |
                          23 | 24 |
                          25 |
                          26 | 27 |
                          28 |
                          29 |
                          30 | 31 |
                          32 |
                          33 |
                          34 |
                          35 | 36 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/student-portal/student-change-password-failed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Changing password failed 6 | 7 | 8 | 9 |
                          10 |
                          11 |
                          12 |

                          Changing password failed!

                          13 | Old password is incorrect or mismatch between the new password and the confirmation. 14 |
                          15 | 16 |
                          17 |
                          18 |
                          19 |
                          20 | 21 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/student-portal/student-change-password-succeeded.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Password changed 6 | 7 | 8 | 9 |
                          10 |
                          11 |
                          12 |

                          Password is changed!

                          13 |
                          14 | 15 |
                          16 |
                          17 |
                          18 |
                          19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/student-portal/student-display-grades.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Grades 7 | 8 | 9 |
                            10 | 11 |
                            12 |
                            13 |

                            Grades

                            14 |
                            15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
                            Course nameGrade
                            25 |
                            26 |
                            27 |
                            28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/student-portal/student-manage-courses.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Manage courses 7 | 8 | 9 |
                              10 | 11 |
                              12 |
                              13 |
                              14 |

                              Available courses

                              15 |
                              16 |
                              17 |

                              Course

                              18 |
                              19 |
                              20 | 23 |
                              24 |

                              *Courses that reached the maximum amount of students or are already started, are not available anymore.

                              25 |
                              26 |
                              27 | 28 |
                              29 |
                              30 |
                              31 |
                              32 |
                              33 |
                              34 | 35 |
                              36 |
                              37 |

                              Enrolled Courses (not started)

                              38 |
                              39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
                              Course nameStart dateEnd date
                              51 |
                              52 |
                              53 |
                              54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/teacher-portal/teacher-change-password-failed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Changing password failed 6 | 7 | 8 | 9 |
                              10 |
                              11 |
                              12 |

                              Changing password failed!

                              13 | Old password is incorrect or mismatch between the new password and the confirmation. 14 |
                              15 | 16 |
                              17 |
                              18 |
                              19 |
                              20 | 21 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/teacher-portal/teacher-change-password-succeeded.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Password changed 6 | 7 | 8 | 9 |
                              10 |
                              11 |
                              12 |

                              Password is changed!

                              13 |
                              14 | 15 |
                              16 |
                              17 |
                              18 |
                              19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/classes/templates/teacher-portal/teacher-course-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Course saved 6 | 7 | 8 | 9 |
                              10 |
                              11 |
                              12 |

                              New course created!

                              13 |
                              14 | 15 |
                              16 |
                              17 |
                              18 |
                              19 | 20 | -------------------------------------------------------------------------------- /Project 01 - College Management Application/target/test-classes/com/CMA/CollegeManagementApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 01 - College Management Application/target/test-classes/com/CMA/CollegeManagementApplicationTests.class -------------------------------------------------------------------------------- /Project 02 - Library Application/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.4/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.4/maven-plugin/reference/html/#build-image) 9 | * [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.4.4/reference/htmlsingle/#using-boot-devtools) 10 | * [JDBC API](https://docs.spring.io/spring-boot/docs/2.4.4/reference/htmlsingle/#boot-features-sql) 11 | * [Spring Data JPA](https://docs.spring.io/spring-boot/docs/2.4.4/reference/htmlsingle/#boot-features-jpa-and-spring-data) 12 | * [Spring Security](https://docs.spring.io/spring-boot/docs/2.4.4/reference/htmlsingle/#boot-features-security) 13 | * [Thymeleaf](https://docs.spring.io/spring-boot/docs/2.4.4/reference/htmlsingle/#boot-features-spring-mvc-template-engines) 14 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.4.4/reference/htmlsingle/#boot-features-developing-web-applications) 15 | 16 | ### Guides 17 | The following guides illustrate how to use some features concretely: 18 | 19 | * [Accessing Relational Data using JDBC with Spring](https://spring.io/guides/gs/relational-data-access/) 20 | * [Managing Transactions](https://spring.io/guides/gs/managing-transactions/) 21 | * [Accessing Data with JPA](https://spring.io/guides/gs/accessing-data-jpa/) 22 | * [Securing a Web Application](https://spring.io/guides/gs/securing-web/) 23 | * [Spring Boot and OAuth2](https://spring.io/guides/tutorials/spring-boot-oauth2/) 24 | * [Authenticating a User with LDAP](https://spring.io/guides/gs/authenticating-ldap/) 25 | * [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/) 26 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 27 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 28 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 29 | 30 | -------------------------------------------------------------------------------- /Project 02 - Library Application/mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Project 02 - Library Application/mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /Project 02 - Library Application/settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=UTF-8 5 | encoding/=UTF-8 6 | -------------------------------------------------------------------------------- /Project 02 - Library Application/settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.methodParameters=generate 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled 6 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 7 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore 8 | org.eclipse.jdt.core.compiler.release=disabled 9 | org.eclipse.jdt.core.compiler.source=1.8 10 | -------------------------------------------------------------------------------- /Project 02 - Library Application/settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles=pom.xml 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /Project 02 - Library Application/settings/org.springframework.ide.eclipse.prefs: -------------------------------------------------------------------------------- 1 | boot.validation.initialized=true 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/DAO/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.DAO; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.libraryapp.entities.Book; 7 | 8 | @Repository 9 | public interface BookRepository extends CrudRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/DAO/NotificationRepository.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.DAO; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.libraryapp.entities.Notification; 7 | 8 | @Repository 9 | public interface NotificationRepository extends CrudRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/DAO/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.DAO; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import org.springframework.stereotype.Repository; 5 | import com.libraryapp.entities.User; 6 | 7 | @Repository 8 | public interface UserRepository extends CrudRepository { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/controllers/ErrorPagesController.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.controllers; 2 | 3 | import javax.servlet.RequestDispatcher; 4 | import javax.servlet.http.HttpServletRequest; 5 | 6 | import org.springframework.boot.web.servlet.error.ErrorController; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | @Controller 12 | public class ErrorPagesController implements ErrorController { 13 | 14 | @RequestMapping(value="/error") 15 | public String errorHandler(HttpServletRequest request) { 16 | Object status = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE); 17 | 18 | if (status != null) { 19 | 20 | int statusCode = Integer.valueOf(status.toString()); 21 | 22 | if (statusCode == HttpStatus.BAD_REQUEST.value()) { 23 | return "error-pages/400-error.html"; 24 | } 25 | 26 | if (statusCode == HttpStatus.FORBIDDEN.value()) { 27 | return "error-pages/403-error.html"; 28 | } 29 | 30 | if (statusCode == HttpStatus.NOT_FOUND.value()) { 31 | return "error-pages/404-error.html"; 32 | } 33 | 34 | if (statusCode == HttpStatus.REQUEST_TIMEOUT.value()) { 35 | return "error-pages/408-error.html"; 36 | } 37 | 38 | if (statusCode == HttpStatus.INTERNAL_SERVER_ERROR.value()) { 39 | return "error-pages/500-error.html"; 40 | } 41 | 42 | if (statusCode == HttpStatus.BAD_GATEWAY.value()) { 43 | return "error-pages/502-error.html"; 44 | } 45 | 46 | if (statusCode == HttpStatus.SERVICE_UNAVAILABLE.value()) { 47 | return "error-pages/503-error.html"; 48 | } 49 | 50 | if (statusCode == HttpStatus.GATEWAY_TIMEOUT.value()) { 51 | return "error-pages/504-error.html"; 52 | } 53 | } 54 | 55 | return "error/general-error-page.html"; 56 | } 57 | 58 | @Override 59 | public String getErrorPath() { 60 | return "/error"; 61 | } 62 | } -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/controllers/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.controllers; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | 6 | import org.springframework.security.core.GrantedAuthority; 7 | import org.springframework.security.core.context.SecurityContextHolder; 8 | import org.springframework.security.core.userdetails.UserDetails; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | 12 | @Controller 13 | public class HomeController { 14 | 15 | @GetMapping(value="/") 16 | public String redirectToHome() { 17 | 18 | UserDetails principal = (UserDetails)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); 19 | Collection role = new ArrayList<>(); 20 | role = principal.getAuthorities(); 21 | 22 | if (role.toString().equals("[ROLE_ADMIN]")){ 23 | return "redirect:/admin"; 24 | } else if (role.toString().equals("[ROLE_EMPLOYEE]")){ 25 | return "redirect:/employee"; 26 | } else { 27 | return "redirect:/user"; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/controllers/SecurityController.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.controllers; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.ui.Model; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | 10 | import com.libraryapp.entities.User; 11 | import com.libraryapp.services.UserService; 12 | 13 | @Controller 14 | public class SecurityController { 15 | 16 | @Autowired 17 | BCryptPasswordEncoder pwEncoder; 18 | 19 | @Autowired 20 | UserService accService; 21 | 22 | @GetMapping(value="/login") 23 | public String login() { 24 | return "security/login.html"; 25 | } 26 | 27 | @GetMapping(value="/logout") 28 | public String logout() { 29 | return "security/logout.html"; 30 | } 31 | 32 | @GetMapping(value="/register") 33 | public String register(Model model) { 34 | model.addAttribute("newAccount", new User()); 35 | return "security/register.html"; 36 | } 37 | 38 | @PostMapping(value="/register/save") 39 | public String saveNewAccount(User account) { 40 | account.setPassword(pwEncoder.encode(account.getPassword())); 41 | accService.save(account); 42 | return "redirect:/register/accountcreated"; 43 | } 44 | 45 | @GetMapping(value="/register/accountcreated") 46 | public String accountCreated() { 47 | return "security/account-created.html"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/security/CurrentUserFinder.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.security; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.context.SecurityContextHolder; 5 | import org.springframework.security.core.userdetails.UserDetails; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.libraryapp.entities.User; 9 | import com.libraryapp.services.UserService; 10 | 11 | @Service 12 | public class CurrentUserFinder { 13 | 14 | @Autowired 15 | UserService usService; 16 | 17 | public long getCurrentUserId() { 18 | UserDetails details = (UserDetails)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); 19 | String username = details.getUsername(); 20 | long userId = -1; 21 | for (User user : usService.findAll()) { 22 | if (user.getUserName().equals(username)) { 23 | userId = user.getUserId(); 24 | break; 25 | } 26 | } 27 | return userId; 28 | } 29 | 30 | public User getCurrentUser() { 31 | User currentUser = usService.findById(getCurrentUserId()); 32 | return currentUser; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/security/SecurityConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.security; 2 | 3 | import javax.sql.DataSource; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 8 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 9 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 10 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 11 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 12 | 13 | @Configuration 14 | @EnableWebSecurity 15 | public class SecurityConfiguration extends WebSecurityConfigurerAdapter { 16 | 17 | @Autowired 18 | DataSource dataSource; 19 | 20 | @Autowired 21 | BCryptPasswordEncoder pwEncoder; 22 | 23 | @Override 24 | protected void configure(AuthenticationManagerBuilder auth) throws Exception { 25 | auth.jdbcAuthentication() 26 | .usersByUsernameQuery("select username, password, enabled from USERS where username = ?") 27 | .authoritiesByUsernameQuery("select username, role from USERS where username = ?") 28 | .dataSource(dataSource).passwordEncoder(pwEncoder); 29 | } 30 | 31 | @Override 32 | protected void configure(HttpSecurity http) throws Exception { 33 | 34 | http.authorizeRequests() 35 | .antMatchers("/user/**").hasRole("USER") 36 | .antMatchers("/employee/**").hasRole("EMPLOYEE") 37 | .antMatchers("/admin/**").hasRole("ADMIN") 38 | .antMatchers("/login/**").permitAll() 39 | .antMatchers("/register/**").permitAll() 40 | .antMatchers("/logout/**").permitAll() 41 | .antMatchers("/CSS/**").permitAll() 42 | .antMatchers("/Images/**").permitAll() 43 | .antMatchers("/**").authenticated().and().formLogin().loginPage("/login"); 44 | 45 | http.csrf().ignoringAntMatchers("/h2-console/**"); 46 | http.headers().frameOptions().disable(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/security/SecurityContext.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.security; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 6 | 7 | @Configuration 8 | public class SecurityContext { 9 | 10 | @Bean 11 | public BCryptPasswordEncoder createPwEncoder() { 12 | return new BCryptPasswordEncoder(); 13 | } 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/services/NotificationService.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.services; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.libraryapp.DAO.NotificationRepository; 10 | import com.libraryapp.entities.Notification; 11 | 12 | @Service 13 | public class NotificationService { 14 | 15 | @Autowired 16 | NotificationRepository notifRepo; 17 | 18 | public void save (Notification notification) { 19 | notifRepo.save(notification); 20 | } 21 | 22 | public void saveById (Long id) { 23 | Notification notification = notifRepo.findById(id).get(); 24 | notifRepo.save(notification); 25 | } 26 | 27 | public List findAll(){ 28 | List notifications = (ArrayList) notifRepo.findAll(); 29 | return notifications; 30 | } 31 | 32 | public void deleteById(Long id) { 33 | notifRepo.deleteById(id); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/services/UserService.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.services; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import com.libraryapp.DAO.UserRepository; 8 | import com.libraryapp.entities.User; 9 | 10 | @Service 11 | public class UserService { 12 | 13 | @Autowired 14 | UserRepository usRepo; 15 | 16 | public void save(User user) { 17 | usRepo.save(user); 18 | } 19 | 20 | public void saveById(Long userId) { 21 | User user = usRepo.findById(userId).get(); 22 | usRepo.save(user); 23 | } 24 | 25 | public User findById(long id) { 26 | User user = usRepo.findById(id).get(); 27 | return user; 28 | } 29 | 30 | public List findAll(){ 31 | return (List) usRepo.findAll(); 32 | } 33 | 34 | public List userSearcher(String firstName, String lastName){ 35 | if (firstName != null && lastName != null) return getByFullName(firstName, lastName); 36 | else if (firstName == null && lastName != null) return getByLastName(lastName); 37 | else if (firstName != null && lastName == null) return getByFirstName(firstName); 38 | else return new ArrayList(); 39 | } 40 | 41 | public List getByFirstName(String firstName){ 42 | List users = new ArrayList(); 43 | for (User user : usRepo.findAll()) { 44 | if (user.getFirstName().toLowerCase().contains(firstName.toLowerCase())) { 45 | users.add(user); 46 | } 47 | } 48 | return users; 49 | } 50 | 51 | public List getByLastName(String lastName){ 52 | List users = new ArrayList(); 53 | for (User user : usRepo.findAll()) { 54 | if(user.getLastName().toLowerCase().contains(lastName.toLowerCase())) { 55 | users.add(user); 56 | } 57 | } 58 | return users; 59 | } 60 | 61 | public List getByFullName(String firstName, String lastName){ 62 | List users = new ArrayList(); 63 | for (User user : usRepo.findAll()) { 64 | if (user.getFirstName().toLowerCase().contains(firstName.toLowerCase()) && 65 | user.getLastName().toLowerCase().contains(lastName.toLowerCase())) { 66 | users.add(user); 67 | } 68 | } 69 | return users; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/utils/ListInStringConverter.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.utils; 2 | 3 | import java.util.Arrays; 4 | import java.util.LinkedHashSet; 5 | import java.util.List; 6 | import java.util.Set; 7 | 8 | import org.springframework.stereotype.Component; 9 | 10 | @Component 11 | public class ListInStringConverter { 12 | 13 | public Set convertListInStringToSetInLong(String listInString){ 14 | 15 | Set converted = new LinkedHashSet(); 16 | 17 | if (listInString.length() <= 2) { 18 | return converted; 19 | } else { 20 | String idsInString = listInString.substring(1, listInString.length() -1); 21 | List idsStringArrayList = Arrays.asList(idsInString.split(", ")); 22 | for (String id : idsStringArrayList) converted.add(Long.parseLong(id)); 23 | return converted; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/java/com/libraryapp/utils/MidnightApplicationRefresh.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp.utils; 2 | 3 | import java.time.LocalDate; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Component; 7 | 8 | import com.libraryapp.entities.Book; 9 | import com.libraryapp.entities.Notification; 10 | import com.libraryapp.entities.User; 11 | import com.libraryapp.services.BookService; 12 | import com.libraryapp.services.NotificationService; 13 | import com.libraryapp.services.UserService; 14 | 15 | @Component 16 | public class MidnightApplicationRefresh { 17 | 18 | @Autowired 19 | BookService bookService; 20 | 21 | @Autowired 22 | UserService usService; 23 | 24 | @Autowired 25 | NotificationService notifService; 26 | 27 | //Removes overdue reservations and notifications. 28 | public void midnightApplicationRefresher() { 29 | 30 | for (Book book : bookService.findAll()) { 31 | if (book.getEndReservationDate() != null) { 32 | if (book.getEndReservationDate().compareTo(LocalDate.now()) == -1) { 33 | if (book.getReservedByUser() != null) { 34 | User user = book.getReservedByUser(); 35 | book.setReservedByUser(null); 36 | usService.save(user); 37 | } 38 | book.setStartReservationDate(null); 39 | book.setEndReservationDate(null); 40 | book.setReadyForPickup(false); 41 | bookService.save(book); 42 | } 43 | } 44 | } 45 | 46 | for (Notification notif : notifService.findAll()) { 47 | if (notif.getValidUntilDate() != null) { 48 | if (notif.getValidUntilDate().compareTo(LocalDate.now()) == -1) { 49 | notifService.deleteById(notif.getNotificationId()); 50 | } 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/h2-console 3 | spring.datasource.url=jdbc:h2:mem:testdb 4 | spring.jpa.show-sql=true 5 | spring.thymeleaf.cache=false 6 | spring.mvc.hiddenmethod.filter.enabled: true 7 | server.error.whitelabel.enabled=true 8 | 9 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/static/Images/library.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/src/main/resources/static/Images/library.jpg -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/static/Images/payment-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/src/main/resources/static/Images/payment-icons.png -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/admin/admin-account-settings-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Account Settings Saved 6 | 7 | 8 | 9 | 10 |
                              11 |

                              Account settings saved

                              12 | 13 |
                              14 |
                              15 |
                              16 | 17 |
                              18 |
                              19 |
                              20 | 21 |
                              22 | 23 | 24 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/admin/admin-confirm-account-settings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Confirm Account Changes 6 | 7 | 8 | 9 | 10 |
                              11 | 12 |

                              Confirm account settings

                              13 | 14 |
                              15 |
                              16 | Username: 17 |
                              18 |
                              19 | 20 |
                              21 |
                              22 | 23 |
                              24 |
                              25 | First name: 26 |
                              27 |
                              28 | 29 |
                              30 |
                              31 | 32 |
                              33 |
                              34 | Last name: 35 |
                              36 |
                              37 | 38 |
                              39 |
                              40 |
                              41 |
                              42 |
                              43 | Account enabled: 44 |
                              45 |
                              46 | 47 |
                              48 |
                              49 | 50 |
                              51 |
                              52 | Role: 53 |
                              54 |
                              55 | 56 |
                              57 |
                              58 | 59 |
                              60 |
                              61 |
                              62 | 63 | 64 | 65 | 66 | 67 |
                              68 |
                              69 |
                              70 |
                              71 | 72 |
                              73 |
                              74 |
                              75 |
                              76 | 77 | 78 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/admin/admin-home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Home 7 | 8 | 9 | 10 |
                                11 | 12 |
                                13 |

                                14 |
                                15 | 16 |
                                17 |

                                Notifications

                                18 | 19 |
                                20 |

                                There are no notifications.

                                21 |
                                22 | 23 |
                                24 |
                                25 |
                                26 | 27 |
                                28 |
                                29 | 30 |
                                31 |
                                32 |
                                33 | 34 | 35 | 36 |
                                37 | 38 | 39 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/admin/admin-manage-accounts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Manage accounts 6 | 7 | 8 | 9 |
                                  10 | 11 |
                                  12 |

                                  Manage Accounts

                                  13 | 14 |
                                  15 |
                                  16 |
                                  17 | 18 |
                                  19 |
                                  20 | 21 |
                                  22 | 23 |
                                  24 | 25 |
                                  26 |
                                  27 | 28 |
                                  29 |
                                  30 | 31 |
                                  32 |
                                  33 |
                                  34 |
                                  35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 61 | 67 | 68 |
                                  UsernameFirst NameLast NameEmailPhone NumberAddressCityRoleSelect Account
                                  57 | USER 58 | EMPLOYEE 59 | ADMIN 60 | 62 |
                                  63 | 64 | 65 |
                                  66 |
                                  69 |
                                  70 | 71 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/employee/employee-book-deleted.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Book deleted 6 | 7 | 8 | 9 |
                                  10 |

                                  Book is deleted successfully!

                                  11 | 12 |
                                  13 |
                                  14 | 15 |
                                  16 |
                                  17 |
                                  18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/employee/employee-book-information-changed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Book information changed 6 | 7 | 8 | 9 | 10 |
                                  11 |

                                  Book information changed

                                  12 |
                                  13 |
                                  14 | 15 |
                                  16 |
                                  17 |
                                  18 | 19 | 20 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/employee/employee-book-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Book Saved 6 | 7 | 8 | 9 | 10 |
                                  11 |

                                  Book saved!

                                  12 |
                                  13 |
                                  14 |
                                  15 |
                                  16 | 17 |
                                  18 |
                                  19 |
                                  20 |
                                  21 | 22 |
                                  23 |
                                  24 |
                                  25 |
                                  26 | 27 | 28 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/employee/employee-books-returned.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Books returned 6 | 7 | 8 | 9 | 10 |
                                  11 |

                                  Books returned

                                  12 | 13 |
                                  14 |
                                  15 | 16 |
                                  17 |
                                  18 |
                                  19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/employee/employee-confirm-order.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Confirm order 6 | 7 | 8 | 9 | 10 |
                                  11 |

                                  Confirm order

                                  12 | 13 |
                                  14 |
                                  15 | Name 16 |
                                  17 |
                                  18 | 19 |
                                  20 |
                                  21 | 22 |
                                  23 |
                                  24 | Address 25 |
                                  26 |
                                  27 | 28 |
                                  29 |
                                  30 | 31 |
                                  32 |
                                  33 | City 34 |
                                  35 |
                                  36 | 37 |
                                  38 |
                                  39 | 40 |
                                  41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 |
                                  TitleAuthorRelease YearEdition
                                  57 | 58 |
                                  59 |
                                  60 |
                                  61 | 62 | 63 | 64 | 65 |
                                  66 |
                                  67 | 68 |
                                  69 |
                                  70 | 71 | 72 | 73 |
                                  74 |
                                  75 |
                                  76 |
                                  77 | 78 | 79 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/employee/employee-delete-book.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Are you sure? 6 | 7 | 8 | 9 | 10 | 11 |
                                  12 | 13 |

                                  Are you sure you want to delete this book?

                                  14 | 15 |
                                  16 |
                                  17 | 18 |
                                  19 |
                                  20 | 21 |
                                  22 |
                                  23 | 24 |
                                  25 |
                                  26 | 27 |
                                  28 |
                                  29 | 30 |
                                  31 |
                                  32 | 33 |
                                  34 |
                                  35 | 36 |
                                  37 |
                                  38 | 39 |
                                  40 |
                                  41 | 42 |
                                  43 |
                                  44 | 45 |
                                  46 |
                                  47 | 48 |
                                  49 |
                                  50 | 51 |
                                  52 |
                                  53 |
                                  54 | 55 | 56 | 57 | 58 |
                                  59 |
                                  60 |
                                  61 | 62 |
                                  63 |
                                  64 | 65 | 66 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/employee/employee-home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Home 6 | 7 | 8 | 9 |
                                    10 | 11 |
                                    12 |

                                    13 |
                                    14 | 15 |
                                    16 |

                                    Notifications

                                    17 | 18 |
                                    19 |

                                    There are no notifications.

                                    20 |
                                    21 | 22 |
                                    23 |
                                    24 |
                                    25 | 26 |
                                    27 |
                                    28 | 29 |
                                    30 |
                                    31 |
                                    32 |
                                    33 | 34 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/employee/employee-new-book.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | New book 6 | 7 | 8 | 9 | 10 |
                                      11 | 12 |
                                      13 |

                                      Add new book to catalog

                                      14 | 15 | 16 |
                                      17 |
                                      18 |
                                      19 | 20 |
                                      21 | 22 |
                                      23 | 24 |
                                      25 |
                                      26 | 27 |
                                      28 |
                                      29 | 30 |
                                      31 |
                                      32 | 33 |
                                      34 |
                                      35 | 36 |
                                      37 |
                                      38 | 39 |
                                      40 |
                                      41 | 42 |
                                      43 |
                                      44 | 45 |
                                      46 |
                                      47 | 48 |
                                      49 |
                                      50 | 51 |
                                      52 |
                                      53 | 54 |
                                      55 |
                                      56 |
                                      57 |
                                      58 | 59 |
                                      60 |
                                      61 |
                                      62 | 63 |
                                      64 | 65 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/employee/employee-order-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Order saved 6 | 7 | 8 | 9 |
                                      10 |

                                      Order saved

                                      11 |
                                      12 |
                                      13 |
                                      14 | 15 |
                                      16 |
                                      17 |
                                      18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/employee/employee-reservation-ready-for-pick-up.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Set Reservation to Ready For Pick-Up 6 | 7 | 8 | 9 |
                                      10 |

                                      Set book reservation to ready for pick-up

                                      11 |

                                      Are you sure?

                                      12 |

                                      You are about to set this book's status to ready for pick-up:

                                      13 | 14 |
                                      15 |
                                      16 | Title: 17 |
                                      18 |
                                      19 | 20 |
                                      21 |
                                      22 | 23 |
                                      24 |
                                      25 | Author: 26 |
                                      27 |
                                      28 | 29 |
                                      30 |
                                      31 | 32 |
                                      33 |
                                      34 | Release year: 35 |
                                      36 |
                                      37 | 38 |
                                      39 |
                                      40 | 41 |
                                      42 |
                                      43 | Edition 44 |
                                      45 |
                                      46 | 47 |
                                      48 |
                                      49 | 50 |

                                      will receive a notification.

                                      51 | 52 |
                                      53 |
                                      54 |
                                      55 | 56 | 57 | 58 | 59 |
                                      60 |
                                      61 |
                                      62 |
                                      63 | 64 |
                                      65 |
                                      66 |
                                      67 | 68 |
                                      69 | 70 | 71 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/error-pages/400-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                      11 |

                                      Oops, something went wrong!

                                      12 | 13 |

                                      Please try again later!

                                      14 | 15 | (Bad request error 400) 16 |
                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/error-pages/403-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                      11 |

                                      Oops, something went wrong!

                                      12 | 13 |

                                      You don't have the authority to visit this page, please try another one.

                                      14 | 15 | (Forbidden page error 403) 16 |
                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/error-pages/404-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                      11 |

                                      Oops, something went wrong!

                                      12 | 13 |

                                      We can't find the page you are trying to visit, please try another one!

                                      14 | 15 | (Not found error 404) 16 |
                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/error-pages/408-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                      11 |

                                      Oops, something went wrong!

                                      12 | 13 |

                                      Please try again.

                                      14 | 15 | (Request timeout error 408) 16 |
                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/error-pages/500-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                      11 |

                                      Oops, something went wrong!

                                      12 | 13 |

                                      Please try again.

                                      14 | 15 | (Internal server error 500) 16 |
                                      17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/error-pages/502-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                      11 |

                                      Oops, something went wrong!

                                      12 | 13 |

                                      Please try again later.

                                      14 | 15 | (Bad gateway error 502) 16 |
                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/error-pages/503-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                      11 |

                                      Oops, something went wrong!

                                      12 | 13 |

                                      Our server is too busy at the moment, please try again later.

                                      14 | 15 | (Service unavailable error 503) 16 |
                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/error-pages/504-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                      11 |

                                      Oops, something went wrong!

                                      12 | 13 |

                                      A problem occurred on our server, please try again later.

                                      14 | 15 | (Gateway timeout error 504) 16 |
                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/page-layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 26 | 27 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/security/account-created.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Account created 6 | 7 | 8 | 9 | 10 | 11 | 12 |
                                      13 |
                                      14 |

                                      Account created!

                                      15 |
                                      16 | 17 |
                                      18 |
                                      19 |
                                      20 | 21 | 22 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/security/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Login 6 | 7 | 8 | 9 | 10 |
                                      11 |
                                      12 |
                                      13 | 14 |
                                      15 | Invalid username and password. 16 |
                                      17 | 18 |
                                      19 | You have been logged out. 20 |
                                      21 | 22 |
                                      23 |
                                      24 | 25 |
                                      26 |
                                      27 | 28 |
                                      29 |
                                      30 | 31 |
                                      32 |
                                      33 | 34 |
                                      35 |
                                      36 | 37 |
                                      38 |
                                      39 | 40 |
                                      41 | 42 |
                                      43 | 44 |
                                      45 | 46 |
                                      47 |
                                      48 | 49 | 50 | 51 |
                                      52 |
                                      53 | 54 | 55 |
                                      56 |
                                      57 | 58 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/security/logout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Logout 6 | 7 | 8 | 9 |
                                      10 | 11 |
                                      12 |
                                      13 |

                                      Are you sure you want to log out?

                                      14 | 15 |
                                      16 |
                                      17 | 18 | 19 |
                                      20 | 21 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/user/user-FAQ.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FAQ 6 | 7 | 8 | 9 |
                                        10 | 11 |
                                        12 |

                                        FAQ

                                        13 | 14 |

                                        Can't find your answer here? Please reach out to us by 15 | sending an email to customerservice@library.com.

                                        16 | 17 |

                                        For how long can I borrow a book?

                                        18 |

                                        Books can be borrowed for 21 days. This period can be extended by one week at a time, with a maximum of three weeks. Extending is free of charge 19 | and can only be done if no one else made a reservation for that particular book. The status of your books 20 | can be checked on your personal library account on our website.

                                        21 | 22 |

                                        How can I reserve a book?

                                        23 |

                                        Search for the book via your personal library account on our website and click the "Reserve book" button. A reservations is valid for 7 days and costs $1,- per book. 24 | If the book is not picked-up after 7 days, the reservation will automatically be canceled.

                                        25 | 26 |

                                        What happens if I can't return a book on time?

                                        27 | A fine of $0,20 per book is charged per day. When keeping a book in your possession that should have been returned, reservations 28 | cannot be made and new orders cannot be picked up. 29 | 30 |

                                        What happens if I lose a book?

                                        31 |

                                        Please contact our customer service as soon as possible. The library will charge a small price for the book, depending 32 | on its value.

                                        33 |
                                        34 | 35 | 36 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/user/user-book-can-not-be-extended.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Return date can not be extended 6 | 7 | 8 | 9 | 10 |
                                        11 |

                                        Return date can not be extended

                                        12 | 13 |

                                        The return date of the book you are trying to extend, cannot be extended. Possible reasons are: 14 |

                                        15 | - The maximum period of use is reached.
                                        16 | - The return date is already extended by 3 weeks.
                                        17 | - Someone else reserved the book.

                                        18 | 19 | Please make sure to return this book on time to the library. 20 |

                                        21 | 22 | 23 |
                                        24 |
                                        25 | 26 |
                                        27 |
                                        28 | 29 |
                                        30 | 31 | 32 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/user/user-book-extended.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Book extended 6 | 7 | 8 | 9 | 10 |
                                        11 | 12 |

                                        Book extended!

                                        13 |
                                        14 | 15 |
                                        16 |
                                        17 | 18 |
                                        19 |
                                        20 |
                                        21 | 22 | 23 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/user/user-do-payment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Payment 6 | 7 | 8 | 9 |
                                        10 |

                                        Payment

                                        11 | Payment icon... 12 | 13 |
                                        14 |
                                        15 | Book: 16 |
                                        17 |
                                        18 | 19 |
                                        20 |
                                        21 | 22 |
                                        23 |
                                        24 | Extend Period: 25 |
                                        26 |
                                        27 | 28 |
                                        29 |
                                        30 | 31 |
                                        32 |
                                        33 | Fine: 34 |
                                        35 |
                                        36 | 37 |
                                        38 |
                                        39 |
                                        40 | 41 |
                                        42 |
                                        43 |
                                        44 | 45 | 46 | 47 | 48 | 49 |
                                        50 |
                                        51 | 52 |
                                        53 |
                                        54 | 55 |
                                        56 |
                                        57 |
                                        58 | 59 |
                                        60 | 61 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/user/user-home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Home 6 | 7 | 8 | 9 |
                                          10 | 11 |
                                          12 |

                                          13 |
                                          14 | 15 |
                                          16 | 17 |

                                          Notifications

                                          18 | 19 |
                                          20 |

                                          There are no notifications.

                                          21 |
                                          22 | 23 |
                                          24 |
                                          25 |
                                          26 | 27 |
                                          28 |
                                          29 | 30 |
                                          31 |
                                          32 |
                                          33 | 34 |
                                          35 |

                                          WARNING

                                          36 |

                                          The return date of one or more books has expired. If possible, extend the return date or return the book(s) to the library as soon as possible to prevent higher fines. 37 | Until all overdue books are returned to the library, no new reservations can be made.

                                          38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
                                          TitleAuthorFine
                                          52 | 53 | 54 |
                                          55 | 56 | 57 |
                                          58 | 59 | 60 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/user/user-pay-fine.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Pay fine 6 | 7 | 8 | 9 | 10 | 11 |
                                          12 | 13 |

                                          Extend book

                                          14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
                                          TitleAuthor
                                          25 |

                                          26 | You are trying to extend the return date of a book that should have been returned to the library on . 27 | Since it wasn't extended or returned on time, a fine has built-up of $ . The return date for the book 28 | can be extended when the fine is paid. The original return date will be extended by week(s). 29 |

                                          30 | 31 |
                                          32 |
                                          33 |
                                          34 | 35 | 36 | 37 | 38 |
                                          39 |
                                          40 |
                                          41 |
                                          42 | 43 |
                                          44 |
                                          45 |
                                          46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/user/user-pay-reservation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Pay Reservation 6 | 7 | 8 | 9 | 10 |
                                          11 |

                                          Pay reservation

                                          12 | Payment icons... 13 | 14 |
                                          15 |
                                          16 | Total costs: 17 |
                                          18 |
                                          19 | 20 |
                                          21 |
                                          22 | 23 |
                                          24 |
                                          25 |
                                          26 | 27 | 28 | 29 |
                                          30 |
                                          31 |
                                          32 | 33 |
                                          34 | 35 | 36 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/user/user-your-books.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Your Books 6 | 7 | 8 | 9 |
                                            10 | 11 |
                                            12 |

                                            Your Books

                                            13 | 14 |

                                            You don't have any books in use.

                                            15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 46 | 47 |
                                            TitleAuthorRelease YearEditionReturn DateFineTimes ExtendedExtend
                                            38 |
                                            39 | 40 | 41 | 42 | 43 | 44 |
                                            45 |
                                            48 |
                                            49 | 50 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/main/resources/templates/user/user-your-reservations.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Your Reservations 6 | 7 | 8 | 9 |
                                              10 |
                                              11 | 12 |

                                              Your Reservations

                                              13 | 14 |

                                              You don't have any book reservations.

                                              15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
                                              TitleAuthorRelease YearEditionReserved FromReserved Until
                                              34 | 35 |
                                              36 | 37 | 38 | -------------------------------------------------------------------------------- /Project 02 - Library Application/src/test/java/com/libraryapp/LibraryApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.libraryapp; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LibraryApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/400-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Insert title here 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Build-Jdk-Spec: 15 3 | Implementation-Title: Library-Application 4 | Implementation-Version: 0.0.1-SNAPSHOT 5 | Created-By: Maven Integration for Eclipse 6 | 7 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/META-INF/maven/com.libraryapp/Library-Application/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Wed May 12 09:33:43 CEST 2021 3 | m2e.projectLocation=C\:\\Users\\marti\\eclipse-workspace\\Library-Application 4 | m2e.projectName=Library-Application 5 | groupId=com.libraryapp 6 | artifactId=Library-Application 7 | version=0.0.1-SNAPSHOT 8 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/h2-console 3 | spring.datasource.url=jdbc:h2:mem:testdb 4 | spring.jpa.show-sql=true 5 | spring.thymeleaf.cache=false 6 | spring.mvc.hiddenmethod.filter.enabled: true 7 | server.error.whitelabel.enabled=true 8 | 9 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/DAO/BookRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/DAO/BookRepository.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/DAO/NotificationRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/DAO/NotificationRepository.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/DAO/UserRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/DAO/UserRepository.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/LibraryApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/LibraryApplication.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/controllers/AdminController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/controllers/AdminController.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/controllers/EmployeeController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/controllers/EmployeeController.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/controllers/ErrorPagesController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/controllers/ErrorPagesController.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/controllers/HomeController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/controllers/HomeController.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/controllers/SecurityController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/controllers/SecurityController.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/controllers/UserController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/controllers/UserController.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/entities/Book.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/entities/Book.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/entities/Notification.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/entities/Notification.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/entities/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/entities/User.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/security/CurrentUserFinder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/security/CurrentUserFinder.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/security/SecurityConfiguration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/security/SecurityConfiguration.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/security/SecurityContext.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/security/SecurityContext.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/services/BookService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/services/BookService.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/services/NotificationService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/services/NotificationService.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/services/UserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/services/UserService.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/utils/DateTracker.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/utils/DateTracker.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/utils/FineCalculator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/utils/FineCalculator.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/utils/ListInStringConverter.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/utils/ListInStringConverter.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/com/libraryapp/utils/MidnightApplicationRefresh.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/com/libraryapp/utils/MidnightApplicationRefresh.class -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/static/Images/library.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/static/Images/library.jpg -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/static/Images/payment-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/classes/static/Images/payment-icons.png -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/admin/admin-account-settings-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Account Settings Saved 6 | 7 | 8 | 9 | 10 |
                                              11 |

                                              Account settings saved

                                              12 | 13 |
                                              14 |
                                              15 |
                                              16 | 17 |
                                              18 |
                                              19 |
                                              20 | 21 |
                                              22 | 23 | 24 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/admin/admin-confirm-account-settings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Confirm Account Changes 6 | 7 | 8 | 9 | 10 |
                                              11 | 12 |

                                              Confirm account settings

                                              13 | 14 |
                                              15 |
                                              16 | Username: 17 |
                                              18 |
                                              19 | 20 |
                                              21 |
                                              22 | 23 |
                                              24 |
                                              25 | First name: 26 |
                                              27 |
                                              28 | 29 |
                                              30 |
                                              31 | 32 |
                                              33 |
                                              34 | Last name: 35 |
                                              36 |
                                              37 | 38 |
                                              39 |
                                              40 |
                                              41 |
                                              42 |
                                              43 | Account enabled: 44 |
                                              45 |
                                              46 | 47 |
                                              48 |
                                              49 | 50 |
                                              51 |
                                              52 | Role: 53 |
                                              54 |
                                              55 | 56 |
                                              57 |
                                              58 | 59 |
                                              60 |
                                              61 |
                                              62 | 63 | 64 | 65 | 66 | 67 |
                                              68 |
                                              69 |
                                              70 |
                                              71 | 72 |
                                              73 |
                                              74 |
                                              75 |
                                              76 | 77 | 78 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/admin/admin-home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Home 7 | 8 | 9 | 10 |
                                                11 | 12 |
                                                13 |

                                                14 |
                                                15 | 16 |
                                                17 |

                                                Notifications

                                                18 | 19 |
                                                20 |

                                                There are no notifications.

                                                21 |
                                                22 | 23 |
                                                24 |
                                                25 |
                                                26 | 27 |
                                                28 |
                                                29 | 30 |
                                                31 |
                                                32 |
                                                33 | 34 | 35 | 36 |
                                                37 | 38 | 39 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/admin/admin-manage-accounts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Manage accounts 6 | 7 | 8 | 9 |
                                                  10 | 11 |
                                                  12 |

                                                  Manage Accounts

                                                  13 | 14 |
                                                  15 |
                                                  16 |
                                                  17 | 18 |
                                                  19 |
                                                  20 | 21 |
                                                  22 | 23 |
                                                  24 | 25 |
                                                  26 |
                                                  27 | 28 |
                                                  29 |
                                                  30 | 31 |
                                                  32 |
                                                  33 |
                                                  34 |
                                                  35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 61 | 67 | 68 |
                                                  UsernameFirst NameLast NameEmailPhone NumberAddressCityRoleSelect Account
                                                  57 | USER 58 | EMPLOYEE 59 | ADMIN 60 | 62 |
                                                  63 | 64 | 65 |
                                                  66 |
                                                  69 |
                                                  70 | 71 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/employee/employee-book-deleted.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Book deleted 6 | 7 | 8 | 9 |
                                                  10 |

                                                  Book is deleted successfully!

                                                  11 | 12 |
                                                  13 |
                                                  14 | 15 |
                                                  16 |
                                                  17 |
                                                  18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/employee/employee-book-information-changed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Book information changed 6 | 7 | 8 | 9 | 10 |
                                                  11 |

                                                  Book information changed

                                                  12 |
                                                  13 |
                                                  14 | 15 |
                                                  16 |
                                                  17 |
                                                  18 | 19 | 20 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/employee/employee-book-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Book Saved 6 | 7 | 8 | 9 | 10 |
                                                  11 |

                                                  Book saved!

                                                  12 |
                                                  13 |
                                                  14 |
                                                  15 |
                                                  16 | 17 |
                                                  18 |
                                                  19 |
                                                  20 |
                                                  21 | 22 |
                                                  23 |
                                                  24 |
                                                  25 |
                                                  26 | 27 | 28 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/employee/employee-books-returned.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Books returned 6 | 7 | 8 | 9 | 10 |
                                                  11 |

                                                  Books returned

                                                  12 | 13 |
                                                  14 |
                                                  15 | 16 |
                                                  17 |
                                                  18 |
                                                  19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/employee/employee-confirm-order.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Confirm order 6 | 7 | 8 | 9 | 10 |
                                                  11 |

                                                  Confirm order

                                                  12 | 13 |
                                                  14 |
                                                  15 | Name 16 |
                                                  17 |
                                                  18 | 19 |
                                                  20 |
                                                  21 | 22 |
                                                  23 |
                                                  24 | Address 25 |
                                                  26 |
                                                  27 | 28 |
                                                  29 |
                                                  30 | 31 |
                                                  32 |
                                                  33 | City 34 |
                                                  35 |
                                                  36 | 37 |
                                                  38 |
                                                  39 | 40 |
                                                  41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 |
                                                  TitleAuthorRelease YearEdition
                                                  57 | 58 |
                                                  59 |
                                                  60 |
                                                  61 | 62 | 63 | 64 | 65 |
                                                  66 |
                                                  67 | 68 |
                                                  69 |
                                                  70 | 71 | 72 | 73 |
                                                  74 |
                                                  75 |
                                                  76 |
                                                  77 | 78 | 79 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/employee/employee-delete-book.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Are you sure? 6 | 7 | 8 | 9 | 10 | 11 |
                                                  12 | 13 |

                                                  Are you sure you want to delete this book?

                                                  14 | 15 |
                                                  16 |
                                                  17 | 18 |
                                                  19 |
                                                  20 | 21 |
                                                  22 |
                                                  23 | 24 |
                                                  25 |
                                                  26 | 27 |
                                                  28 |
                                                  29 | 30 |
                                                  31 |
                                                  32 | 33 |
                                                  34 |
                                                  35 | 36 |
                                                  37 |
                                                  38 | 39 |
                                                  40 |
                                                  41 | 42 |
                                                  43 |
                                                  44 | 45 |
                                                  46 |
                                                  47 | 48 |
                                                  49 |
                                                  50 | 51 |
                                                  52 |
                                                  53 |
                                                  54 | 55 | 56 | 57 | 58 |
                                                  59 |
                                                  60 |
                                                  61 | 62 |
                                                  63 |
                                                  64 | 65 | 66 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/employee/employee-home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Home 6 | 7 | 8 | 9 |
                                                    10 | 11 |
                                                    12 |

                                                    13 |
                                                    14 | 15 |
                                                    16 |

                                                    Notifications

                                                    17 | 18 |
                                                    19 |

                                                    There are no notifications.

                                                    20 |
                                                    21 | 22 |
                                                    23 |
                                                    24 |
                                                    25 | 26 |
                                                    27 |
                                                    28 | 29 |
                                                    30 |
                                                    31 |
                                                    32 |
                                                    33 | 34 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/employee/employee-new-book.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | New book 6 | 7 | 8 | 9 | 10 |
                                                      11 | 12 |
                                                      13 |

                                                      Add new book to catalog

                                                      14 | 15 | 16 |
                                                      17 |
                                                      18 |
                                                      19 | 20 |
                                                      21 | 22 |
                                                      23 | 24 |
                                                      25 |
                                                      26 | 27 |
                                                      28 |
                                                      29 | 30 |
                                                      31 |
                                                      32 | 33 |
                                                      34 |
                                                      35 | 36 |
                                                      37 |
                                                      38 | 39 |
                                                      40 |
                                                      41 | 42 |
                                                      43 |
                                                      44 | 45 |
                                                      46 |
                                                      47 | 48 |
                                                      49 |
                                                      50 | 51 |
                                                      52 |
                                                      53 | 54 |
                                                      55 |
                                                      56 |
                                                      57 |
                                                      58 | 59 |
                                                      60 |
                                                      61 |
                                                      62 | 63 |
                                                      64 | 65 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/employee/employee-order-saved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Order saved 6 | 7 | 8 | 9 |
                                                      10 |

                                                      Order saved

                                                      11 |
                                                      12 |
                                                      13 |
                                                      14 | 15 |
                                                      16 |
                                                      17 |
                                                      18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/employee/employee-reservation-ready-for-pick-up.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Set Reservation to Ready For Pick-Up 6 | 7 | 8 | 9 |
                                                      10 |

                                                      Set book reservation to ready for pick-up

                                                      11 |

                                                      Are you sure?

                                                      12 |

                                                      You are about to set this book's status to ready for pick-up:

                                                      13 | 14 |
                                                      15 |
                                                      16 | Title: 17 |
                                                      18 |
                                                      19 | 20 |
                                                      21 |
                                                      22 | 23 |
                                                      24 |
                                                      25 | Author: 26 |
                                                      27 |
                                                      28 | 29 |
                                                      30 |
                                                      31 | 32 |
                                                      33 |
                                                      34 | Release year: 35 |
                                                      36 |
                                                      37 | 38 |
                                                      39 |
                                                      40 | 41 |
                                                      42 |
                                                      43 | Edition 44 |
                                                      45 |
                                                      46 | 47 |
                                                      48 |
                                                      49 | 50 |

                                                      will receive a notification.

                                                      51 | 52 |
                                                      53 |
                                                      54 |
                                                      55 | 56 | 57 | 58 | 59 |
                                                      60 |
                                                      61 |
                                                      62 |
                                                      63 | 64 |
                                                      65 |
                                                      66 |
                                                      67 | 68 |
                                                      69 | 70 | 71 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/error-pages/400-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                                      11 |

                                                      Oops, something went wrong!

                                                      12 | 13 |

                                                      Please try again later!

                                                      14 | 15 | (Bad request error 400) 16 |
                                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/error-pages/403-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                                      11 |

                                                      Oops, something went wrong!

                                                      12 | 13 |

                                                      You don't have the authority to visit this page, please try another one.

                                                      14 | 15 | (Forbidden page error 403) 16 |
                                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/error-pages/404-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                                      11 |

                                                      Oops, something went wrong!

                                                      12 | 13 |

                                                      We can't find the page you are trying to visit, please try another one!

                                                      14 | 15 | (Not found error 404) 16 |
                                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/error-pages/408-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                                      11 |

                                                      Oops, something went wrong!

                                                      12 | 13 |

                                                      Please try again.

                                                      14 | 15 | (Request timeout error 408) 16 |
                                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/error-pages/500-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                                      11 |

                                                      Oops, something went wrong!

                                                      12 | 13 |

                                                      Please try again.

                                                      14 | 15 | (Internal server error 500) 16 |
                                                      17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/error-pages/502-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                                      11 |

                                                      Oops, something went wrong!

                                                      12 | 13 |

                                                      Please try again later.

                                                      14 | 15 | (Bad gateway error 502) 16 |
                                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/error-pages/503-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                                      11 |

                                                      Oops, something went wrong!

                                                      12 | 13 |

                                                      Our server is too busy at the moment, please try again later.

                                                      14 | 15 | (Service unavailable error 503) 16 |
                                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/error-pages/504-error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Error 6 | 7 | 8 | 9 | 10 |
                                                      11 |

                                                      Oops, something went wrong!

                                                      12 | 13 |

                                                      A problem occurred on our server, please try again later.

                                                      14 | 15 | (Gateway timeout error 504) 16 |
                                                      17 | 18 | 19 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/page-layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 26 | 27 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/security/account-created.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Account created 6 | 7 | 8 | 9 | 10 | 11 | 12 |
                                                      13 |
                                                      14 |

                                                      Account created!

                                                      15 |
                                                      16 | 17 |
                                                      18 |
                                                      19 |
                                                      20 | 21 | 22 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/security/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Login 6 | 7 | 8 | 9 | 10 |
                                                      11 |
                                                      12 |
                                                      13 | 14 |
                                                      15 | Invalid username and password. 16 |
                                                      17 | 18 |
                                                      19 | You have been logged out. 20 |
                                                      21 | 22 |
                                                      23 |
                                                      24 | 25 |
                                                      26 |
                                                      27 | 28 |
                                                      29 |
                                                      30 | 31 |
                                                      32 |
                                                      33 | 34 |
                                                      35 |
                                                      36 | 37 |
                                                      38 |
                                                      39 | 40 |
                                                      41 | 42 |
                                                      43 | 44 |
                                                      45 | 46 |
                                                      47 |
                                                      48 | 49 | 50 | 51 |
                                                      52 |
                                                      53 | 54 | 55 |
                                                      56 |
                                                      57 | 58 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/security/logout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Logout 6 | 7 | 8 | 9 |
                                                      10 | 11 |
                                                      12 |
                                                      13 |

                                                      Are you sure you want to log out?

                                                      14 | 15 |
                                                      16 |
                                                      17 | 18 | 19 |
                                                      20 | 21 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/user/user-FAQ.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FAQ 6 | 7 | 8 | 9 |
                                                        10 | 11 |
                                                        12 |

                                                        FAQ

                                                        13 | 14 |

                                                        Can't find your answer here? Please reach out to us by 15 | sending an email to customerservice@library.com.

                                                        16 | 17 |

                                                        For how long can I borrow a book?

                                                        18 |

                                                        Books can be borrowed for 21 days. This period can be extended by one week at a time, with a maximum of three weeks. Extending is free of charge 19 | and can only be done if no one else made a reservation for that particular book. The status of your books 20 | can be checked on your personal library account on our website.

                                                        21 | 22 |

                                                        How can I reserve a book?

                                                        23 |

                                                        Search for the book via your personal library account on our website and click the "Reserve book" button. A reservations is valid for 7 days and costs $1,- per book. 24 | If the book is not picked-up after 7 days, the reservation will automatically be canceled.

                                                        25 | 26 |

                                                        What happens if I can't return a book on time?

                                                        27 | A fine of $0,20 per book is charged per day. When keeping a book in your possession that should have been returned, reservations 28 | cannot be made and new orders cannot be picked up. 29 | 30 |

                                                        What happens if I lose a book?

                                                        31 |

                                                        Please contact our customer service as soon as possible. The library will charge a small price for the book, depending 32 | on its value.

                                                        33 |
                                                        34 | 35 | 36 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/user/user-book-can-not-be-extended.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Return date can not be extended 6 | 7 | 8 | 9 | 10 |
                                                        11 |

                                                        Return date can not be extended

                                                        12 | 13 |

                                                        The return date of the book you are trying to extend, cannot be extended. Possible reasons are: 14 |

                                                        15 | - The maximum period of use is reached.
                                                        16 | - The return date is already extended by 3 weeks.
                                                        17 | - Someone else reserved the book.

                                                        18 | 19 | Please make sure to return this book on time to the library. 20 |

                                                        21 | 22 | 23 |
                                                        24 |
                                                        25 | 26 |
                                                        27 |
                                                        28 | 29 |
                                                        30 | 31 | 32 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/user/user-book-extended.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Book extended 6 | 7 | 8 | 9 | 10 |
                                                        11 | 12 |

                                                        Book extended!

                                                        13 |
                                                        14 | 15 |
                                                        16 |
                                                        17 | 18 |
                                                        19 |
                                                        20 |
                                                        21 | 22 | 23 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/user/user-do-payment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Payment 6 | 7 | 8 | 9 |
                                                        10 |

                                                        Payment

                                                        11 | Payment icon... 12 | 13 |
                                                        14 |
                                                        15 | Book: 16 |
                                                        17 |
                                                        18 | 19 |
                                                        20 |
                                                        21 | 22 |
                                                        23 |
                                                        24 | Extend Period: 25 |
                                                        26 |
                                                        27 | 28 |
                                                        29 |
                                                        30 | 31 |
                                                        32 |
                                                        33 | Fine: 34 |
                                                        35 |
                                                        36 | 37 |
                                                        38 |
                                                        39 |
                                                        40 | 41 |
                                                        42 |
                                                        43 |
                                                        44 | 45 | 46 | 47 | 48 | 49 |
                                                        50 |
                                                        51 | 52 |
                                                        53 |
                                                        54 | 55 |
                                                        56 |
                                                        57 |
                                                        58 | 59 |
                                                        60 | 61 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/user/user-home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Home 6 | 7 | 8 | 9 |
                                                          10 | 11 |
                                                          12 |

                                                          13 |
                                                          14 | 15 |
                                                          16 | 17 |

                                                          Notifications

                                                          18 | 19 |
                                                          20 |

                                                          There are no notifications.

                                                          21 |
                                                          22 | 23 |
                                                          24 |
                                                          25 |
                                                          26 | 27 |
                                                          28 |
                                                          29 | 30 |
                                                          31 |
                                                          32 |
                                                          33 | 34 |
                                                          35 |

                                                          WARNING

                                                          36 |

                                                          The return date of one or more books has expired. If possible, extend the return date or return the book(s) to the library as soon as possible to prevent higher fines. 37 | Until all overdue books are returned to the library, no new reservations can be made.

                                                          38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
                                                          TitleAuthorFine
                                                          52 | 53 | 54 |
                                                          55 | 56 | 57 |
                                                          58 | 59 | 60 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/user/user-pay-fine.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Pay fine 6 | 7 | 8 | 9 | 10 | 11 |
                                                          12 | 13 |

                                                          Extend book

                                                          14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
                                                          TitleAuthor
                                                          25 |

                                                          26 | You are trying to extend the return date of a book that should have been returned to the library on . 27 | Since it wasn't extended or returned on time, a fine has built-up of $ . The return date for the book 28 | can be extended when the fine is paid. The original return date will be extended by week(s). 29 |

                                                          30 | 31 |
                                                          32 |
                                                          33 |
                                                          34 | 35 | 36 | 37 | 38 |
                                                          39 |
                                                          40 |
                                                          41 |
                                                          42 | 43 |
                                                          44 |
                                                          45 |
                                                          46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/user/user-pay-reservation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Pay Reservation 6 | 7 | 8 | 9 | 10 |
                                                          11 |

                                                          Pay reservation

                                                          12 | Payment icons... 13 | 14 |
                                                          15 |
                                                          16 | Total costs: 17 |
                                                          18 |
                                                          19 | 20 |
                                                          21 |
                                                          22 | 23 |
                                                          24 |
                                                          25 |
                                                          26 | 27 | 28 | 29 |
                                                          30 |
                                                          31 |
                                                          32 | 33 |
                                                          34 | 35 | 36 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/user/user-your-books.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Your Books 6 | 7 | 8 | 9 |
                                                            10 | 11 |
                                                            12 |

                                                            Your Books

                                                            13 | 14 |

                                                            You don't have any books in use.

                                                            15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 46 | 47 |
                                                            TitleAuthorRelease YearEditionReturn DateFineTimes ExtendedExtend
                                                            38 |
                                                            39 | 40 | 41 | 42 | 43 | 44 |
                                                            45 |
                                                            48 |
                                                            49 | 50 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/classes/templates/user/user-your-reservations.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Your Reservations 6 | 7 | 8 | 9 |
                                                              10 |
                                                              11 | 12 |

                                                              Your Reservations

                                                              13 | 14 |

                                                              You don't have any book reservations.

                                                              15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
                                                              TitleAuthorRelease YearEditionReserved FromReserved Until
                                                              34 | 35 |
                                                              36 | 37 | 38 | -------------------------------------------------------------------------------- /Project 02 - Library Application/target/test-classes/com/libraryapp/LibraryApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MartijnReede/Spring-Boot-Applications/82f0033a432b78080b71bf53780733e20a97e88b/Project 02 - Library Application/target/test-classes/com/libraryapp/LibraryApplicationTests.class -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Spring-Boot-Applications 2 | Spring Boot Applications 3 | --------------------------------------------------------------------------------