Team Members:
- Martin You - martin.you@stonybrook.edu
- Aaron Purnawan - aaron.purnawan@stonybrook.edu
- Lena Girdhar - lena.girdhar@stonybrook.edu
- Open MySQL Workbench
- On Navigator Sidebar, under Management, click on "Data Import/Restore"
- Select Import from Self-Contained File
- Select the path to the downloaded .sql dump
- In Default Target Schema, name the database (this will be of use later)
- In the bottom, press Start Import
- Open Eclipse, and open a new Workspace
- Click on import existing projects
- Select WAR under Web
- Select the location of the .war file
- Click on finish
- Right click the CSE305 folder, Buildpath, Configure Buildpath
- Go to Libraries, click on JRE, click on edit on the right side
- Select Workspace default JRE (jre) option
- Select Finish
- Select Apply and Close
- Go to Window > Show View > Servers
- Create new server, install Tomcat v9.0
- Go to the configure build path
- In the libraries tab, click “add external jar"
- Go to the location where tomcat was installed
- Inside that folder, go to lib and select ‘servlet-api.jar’
- Click on finish
- Now you have set up the project
- Download MySQL Java connector and set it up as mentioned in the README provided by the professor
- In the /src/main/java/dao/DatabaseConnection.java lines 6, 7 and 8, replace with your login information + database name.
- Go to src/main/webapp/index.jsp, right click and click on Run As -> Run on Server to start the project.
-
In /src/main/webapp/viewAddOrder.jsp, changed line 35 to name="orderPercentage"
-
Added parameter private String date into the /src/main/java/model/Stock.java with getter and setter methods so that OrderPriceHistory can be properly displayed.
-
In /src/main/java/resources/EditCustomerController.java changed customerID to customerId in line 39. This is because the customerId was incorrectly named and thus could not be retrieved properly.
-
In /src/main/java/resources/DeleteCustomerController.java changed customerID to customerId in line 38. This is because the customerId was incorrectly named and thus could not be retrieved properly.
-
Added setters and getters into /src/main/java/model/Account.java. This is because account did not have any ways to set and get the private variables.
-
In /src/main/java/resources/GetCustomersController.java removed searchKeyword from method dao.getCustomers() in line 45. Since the keyword is null and thus makes the query retrieve no Customers.
-
In /src/main/webapp/ShowStocks.jsp added a new line after line 17, inserting Price, and line 27 (previously line 26) inserted ${cd.price}. Added prices to the show stock table.
-
Added new variable 'private String priceDate' to /src/main/java/model/Stock.java with getter and setter methods so they can be modified.
-
Changed values to begin 2000 end 2030 in /src/main/webapp/viewSalesReport.jsp to make it easier to select stock summary, as current dates set are from 2025.
-
Changed doGet() from /src/main/java/resources/GetSalesReportController.java to properly gather data and pass it to the JSP, setting the header properly.
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String year = request.getParameter("year"); String month = request.getParameter("month"); SalesDao dao = new SalesDao(); List<RevenueItem> items = dao.getSalesReport(month, year); request.setAttribute("items", items); request.setAttribute("heading", "Sales Report for " + month + "/" + year); RequestDispatcher rd = request.getRequestDispatcher("showSalesReport.jsp"); rd.forward(request, response); }
- Improved by adding prices for the Order screen, and in SHowStocks.jsp webpage, and everything that was changed apart from the /dao folder mentioned above was to make the website work properly.