-
Notifications
You must be signed in to change notification settings - Fork 1
Additional Documentation
Controller classes:
The controller classes act with the database in our project. For this quarter, we decided not to use a database, however, we are using json files to retrieve our data. We still need a formsubmission class in order for the users to interact with our web app.
A tutorial was utilized to start a template for our form submission. In CustomerRepository.java , the controller looks at the values we are looking for, then uses RoomRequestController.java to request mapping of our data.
FRONTEND:
We chose to use Thymeleaf templates instead of Freemarker because it allows us to live preview and edit the look of the HTML pages without actually having to launch the project after each change. This was especially helpful because we needed to constantly test the user interaction portion, as well as the HTML/CSS design for the overall web app.
The file SpringRoomRequestSubmissionApplication.java is an application that runs when the user goes to our site. The application is run and starts to interact with the backend portion of the project.
Lombok is a library that accesses getters and setters for us.
BACKEND:
Uses Selenium web browser automation for scraping. More can be found at .https://www.seleniumhq.org/. Uses HtmlUnitDriver for a headless browser. It sets the headless browser to default browser used on system (i.e. Chrome, Firefox). More documentation can be found at https://github.com/SeleniumHQ/htmlunit-driver. A parser was made to split the building and room numbers based on different cases.
Using Databases:
One of our biggest roadblocks for a while was figuring out how to store the copious amounts of data of all the buildings, classrooms, and times. Our initial plan was to use MLab to store our data, however, due to the given time of this project, we were unable to achieve and understand how to get all the data on the server in a timely manner.
An attempt was made to integrate MLab with SparkJava, however, it was difficult to input all the data manually. Thus, we decided to stick with parsing the data into the json files, and accessing our information there. Although our data is stored locally in a file, we hope to someday move to MongoDB and pull data for classes in the future.
We utilized different resources such as:
- How to use spring-boot, MongoDB, and heroku.
- https://www.youtube.com/watch?v=KcbLQRJafKY
- Retrieving documents in the code http://www.thejavageek.com/2015/08/24/retrieve-documents-from-mongodb-using-java/
- Commands to use in the terminal to connect to the MLab database and input data manually through the command line https://docs.mlab.com/
- Understanding how to use MLab https://github.com/chan4est/ucsb-cs56-mongodb-mlab-tut
Future Plans:
We would like to figure out how to use MongoDB to store and retrieve our data. Change the parser to be a generalized parser for all building-room combinations in the UCSB course curriculum.