Create a Spring Boot project. You will need Lombok, Spring Web, Thymeleaf, H2 database, Java Mail...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a Spring Boot project. You will need Lombok, Spring Web, Thymeleaf, H2 database, Java Mail Sender, Spring Security and Spring Data JDBC as dependencies. Make sure that the project is named Final Exam_FirstName_LastName where FirstName is replaced with your first name, and LastName is replaced with your last name. Configure your database to work with the h2 in memory database. You should have a root page which is mapped to localhost:8080. Your home page should have a link to each part. Each part should have a hyperlink back to your root page. Part 2: (5 marks) Cat Paws is a store that sells food, toys, and accessories for cats. Create an Item object that contains the following fields. • ID: Auto generated when added into the database • Name (String) • Price (double) • Quantity (int) In an SQL file, create a table for the Cat Items where columns match the fields. It is advised to use INT or DOUBLE for your numerical values. Create 10 dummy records to be generated when the program starts. Create an add Item HTML page that will add Items to the database. After adding Items your program should return to the add Item page. Your program will be tested with Integers for quantity, and decimal values with 2 decimal places for price. Part 3 (2 marks) Display all Item in an HTML page. This should be done in a well formatted HTML table with column headings for each field. Part 4 (3 marks edit, 2 marks delete) Modify part 3 so that each item has an edit and delete hyperlink. Part 5 (4 marks) Implement security to your application. For full marks your security must retrieve users from your database. Have a role Boss and a role Worker. Have a default user named "Jon" with password "123" and role Boss, and a different default user named "Tod" with password "123" and role Worker. Role Boss should have access to the following: • Add Item • Edit Item Delete Item Search Item (Part 6 if implemented) • Email (Part 10 if implemented) Role Worker should have access to the following: • Search Item (Part 6 if implemented) • Email (Part 10 if implemented Everyone should be able to access the following without logging in View • Root page ● Registration (part 8 if implemented) Choose 3 of the following sections to complete. You must also upload a text file called choices.txt indicating which parts of 6-10 I will be marking. If no file is uploaded then a grade of 0 will be given to parts 6-10. You have an extra 30 minutes after the exam is finished to upload this text file. Part 6 (4 marks) Create a search page that allows you to search items by: Name • Price range (Min to Max) • Quantity range (Min to Max) Part 7 (4 marks) Create 6 Junit test cases for your application. These test cases should test various parts of your application, and should include at least 2 test cases related to security when the boss is logged in, and at least 1 test case related to security when the worker is logged in. Part 8 (4 marks) Create a registration page to register new users with role Boss or Worker. When registering a new employee there should be a choice for either boss or worker but not both. This registration page should be linked to the login page. Part 9 (4 marks) Create a RestController that has the following URL's that perform the following: Post Mapping for localhost:8080/Item that adds a new item to your Item table. Get Mapping for localhost:8080/Item that returns a list of all Item in the store Get Mapping for localhost:8080/Item/{id} that returns the item with the specified index, or null Put Mapping for localhost:8080/Item/{id} that reduces the specified Item quantity by 1. Return the string "SOLD" if successful. If the Item quantity is zero, do not reduce the quantity by 1 but instead return a message stating "SOLD OUT". If the piece of Item does not exist, return a message "Out of Stock". ● Part 10 (4 marks) Create a page with a form action that takes in an email. This email will be the destination of the email. Your program should send a well formatted HTML page as a body. The body should be a table with the same information as part 3. Create a Spring Boot project. You will need Lombok, Spring Web, Thymeleaf, H2 database, Java Mail Sender, Spring Security and Spring Data JDBC as dependencies. Make sure that the project is named Final Exam_FirstName_LastName where FirstName is replaced with your first name, and LastName is replaced with your last name. Configure your database to work with the h2 in memory database. You should have a root page which is mapped to localhost:8080. Your home page should have a link to each part. Each part should have a hyperlink back to your root page. Part 2: (5 marks) Cat Paws is a store that sells food, toys, and accessories for cats. Create an Item object that contains the following fields. • ID: Auto generated when added into the database • Name (String) • Price (double) • Quantity (int) In an SQL file, create a table for the Cat Items where columns match the fields. It is advised to use INT or DOUBLE for your numerical values. Create 10 dummy records to be generated when the program starts. Create an add Item HTML page that will add Items to the database. After adding Items your program should return to the add Item page. Your program will be tested with Integers for quantity, and decimal values with 2 decimal places for price. Part 3 (2 marks) Display all Item in an HTML page. This should be done in a well formatted HTML table with column headings for each field. Part 4 (3 marks edit, 2 marks delete) Modify part 3 so that each item has an edit and delete hyperlink. Part 5 (4 marks) Implement security to your application. For full marks your security must retrieve users from your database. Have a role Boss and a role Worker. Have a default user named "Jon" with password "123" and role Boss, and a different default user named "Tod" with password "123" and role Worker. Role Boss should have access to the following: • Add Item • Edit Item Delete Item Search Item (Part 6 if implemented) • Email (Part 10 if implemented) Role Worker should have access to the following: • Search Item (Part 6 if implemented) • Email (Part 10 if implemented Everyone should be able to access the following without logging in View • Root page ● Registration (part 8 if implemented) Choose 3 of the following sections to complete. You must also upload a text file called choices.txt indicating which parts of 6-10 I will be marking. If no file is uploaded then a grade of 0 will be given to parts 6-10. You have an extra 30 minutes after the exam is finished to upload this text file. Part 6 (4 marks) Create a search page that allows you to search items by: Name • Price range (Min to Max) • Quantity range (Min to Max) Part 7 (4 marks) Create 6 Junit test cases for your application. These test cases should test various parts of your application, and should include at least 2 test cases related to security when the boss is logged in, and at least 1 test case related to security when the worker is logged in. Part 8 (4 marks) Create a registration page to register new users with role Boss or Worker. When registering a new employee there should be a choice for either boss or worker but not both. This registration page should be linked to the login page. Part 9 (4 marks) Create a RestController that has the following URL's that perform the following: Post Mapping for localhost:8080/Item that adds a new item to your Item table. Get Mapping for localhost:8080/Item that returns a list of all Item in the store Get Mapping for localhost:8080/Item/{id} that returns the item with the specified index, or null Put Mapping for localhost:8080/Item/{id} that reduces the specified Item quantity by 1. Return the string "SOLD" if successful. If the Item quantity is zero, do not reduce the quantity by 1 but instead return a message stating "SOLD OUT". If the piece of Item does not exist, return a message "Out of Stock". ● Part 10 (4 marks) Create a page with a form action that takes in an email. This email will be the destination of the email. Your program should send a well formatted HTML page as a body. The body should be a table with the same information as part 3.
Expert Answer:
Answer rating: 100% (QA)
The answer provided below has been developed in a clear step by step manner Step 1 Step 1 Springtime boots database JPA stand for Where to organize ma... View the full answer
Related Book For
Modern Database Management
ISBN: 978-0133544619
12th edition
Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi
Posted Date:
Students also viewed these programming questions
-
This assignment will help you get acquainted with your Java development software. Here is the Java program you will enter: // This is my first Java program. public class MyFirstProgram { public...
-
Select Microsoft Net Development Company, Java Development Company, and the PHP development company, that are doing business in Houston either offering software or IT services. Describe the companys...
-
Java Company earned net income of $85,000 during the year ended December 31, 2018. On December 15, Java declared the annual cash dividend on its 4% preferred stock (par value, $120,000) and a $0.25...
-
You are a lead auditor from ABC Auditors Pty Ltd. Your client is Cassey's Quality Cars Ltd who are a large car dealership with branches across Queensland. ABC Auditors have performed audits for past...
-
Fraud is sometimes discovered when looking at one piece of information within the context of overall data. For example, sales entered into the sys-tem after a store closes. Describe how using an...
-
A sociologist uses 10 independent variables (plus an intercept term) to predict socioeconomic status. (a) In a data set with n = 500, would R 2 = 0.07 be significant? (b) Is the sociologist entitled...
-
Northern Group, Inc., is a Wisconsin corporation that contracts with manufacturers and suppliers to develop marketing strategies and promotions to third-party retailers. In exchange for these...
-
Donated Services. Indicate whether each of the following donated services situations would require a journal entry for contribution revenue and a related expense or asset by circling Y for yes or N...
-
You have just been named Director of Data Administration of General Hardware Co. General Hardware maintains a large, central IS organization with several operational relational databases at its...
-
You talk to Sally about getting paid for the work you're doing. You suggest $25 an hour and she agrees. You are only doing this temporarily since you have some extra time so you set yourself up as a...
-
6. Determine the equation of the parabola shown in the form y = ax + bx+c d 4 2 0 -2 2 6
-
Prepare a list of questions to ask at job interviews. 1. Prepare a list of three to five general questions that apply to most employers in your field. 2. Prepare two to five specific questions for...
-
Business plans at many schools are more than classroom writing exercises. They have won regional, national, and worldwide prizes. Although some contests are part of MBA programs, other contests are...
-
Revise each of these sentences to improve you-attitude and positive emphasis. You may need to add information. 1. I got laid off at Barlons three months ago when the company downsized. 2. Your...
-
What might be problematic about these responses to interview questions? How might the answers be improved? a. Q: Tell me about yourself. A: Im really easy-going and casual. b. Q: I noticed that you...
-
As an enterprising college student, you recognized a problem as soon as you arrived on campus. Residence rooms filled with pricey digital doodads were very attractive to thieves. Some students move...
-
Dyl Pickle Inc. had credit sales of $3,500,000 last year and its days of sales outstanding were DSO = 35 days. What was your average accounts receivable balance, based on a 365-day year?
-
What are some of the features of the Unified Process (UP)?
-
Describe two properties that each candidate key must satisfy.
-
Explain in your own words what the precision (p) and scale (s) parameters for the Oracle data type NUMBER mean. DBMS you are using is Oracle. If that is not the case, feel free to modify the question...
-
Table 4-4 shows a relation called GRADE REPORT for a university. Your assignment is as follows: a. Draw a relational schema and diagram the functional dependencies in the relation. b. In what normal...
-
Two dice are rolled. The red die has been loaded. Its probabilities are \(P(1)=P(2)=P(3)=P(4)=\frac{1}{5}\) and \(P(5)=P(6)=\frac{1}{10}\). The green die is fair. Let the event \(A\) be the sum of...
-
In the game of blackjack, also known as twenty-one, the player and the dealer are dealt one card face-down and one card face-up. The object is to get as close as possible to the score 21, without...
-
After the hand, the cards are discarded, and the next hand continues with the remaining cards in the deck. The player has had an opportunity to see some of the cards in the previous hand, those that...
Study smarter with the SolutionInn App