Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
courses:cs335:spring2019:graffiti:documentation [2019/05/15 18:48] estradahammdcourses:cs335:spring2019:graffiti:documentation [2019/05/16 19:12] – [Loading Data into the Database Through EpiDocs] stalnakert
Line 1: Line 1:
 ====== Documentation ====== ====== Documentation ======
  
-Our full documentation can be found in our files and at [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/README.md|this]]+Our full documentation can be found in our files and at this [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/README.md|link]]
 ==== Development Tips ==== ==== Development Tips ====
  
Line 10: Line 10:
 The databases are postgresql, to get easy access to them just ssh into fred and then navigate to whatever version of the database Sprenkle gave you access to. For a full list of databases go into [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/documentation/graffiti_schema.sql|documentation/graffiti_schema.sql]] The databases are postgresql, to get easy access to them just ssh into fred and then navigate to whatever version of the database Sprenkle gave you access to. For a full list of databases go into [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/documentation/graffiti_schema.sql|documentation/graffiti_schema.sql]]
  
-==== Setup ====+=== Setup ===
  
-The setup process is fairly simple, in the setup folder the populate database class runs and calls a set of functions that populate the databases either directly by pulling data from csv files or indirectly by pulling data from other databases. <b>Note that populate database does not run on the startup so you'll have to call any setup functions manually for testing.</b> There's also a great guide to set up in [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/documentation/SetUpData.txt|documentation/SetUpData.txt]]+The setup process is fairly simple, in the setup folder the populate database class runs and calls a set of functions that populate the databases either directly by pulling data from csv files or indirectly by pulling data from other databases. **Note that populate database does not run on the startup so you'll have to call any setup functions manually for testing.** There's also a great guide to set up in [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/documentation/SetUpData.txt|documentation/SetUpData.txt]]
  
-==== Beans! ====+=== Beans! ===
  
 Beans are java objects that encapsulate data taken from the database. In this project, beans are used to provide quick, easy, and controlled access to data pulled from a database. They tend to not do a lot of processing and really are just used for access. Beans are java objects that encapsulate data taken from the database. In this project, beans are used to provide quick, easy, and controlled access to data pulled from a database. They tend to not do a lot of processing and really are just used for access.
  
-==== Rowmappers and DAOs ====+=== Rowmappers and DAOs ===
  
 Beans are generated by rowmappers. Rowmappers take the results from postgresql queries and turn them into beans using the constructor interface specified. Different beans are generally used for different queries and provide different interfaces. Rowmappers don't have to return beans though and can in fact just be used to map specific datatypes. Beans are generated by rowmappers. Rowmappers take the results from postgresql queries and turn them into beans using the constructor interface specified. Different beans are generally used for different queries and provide different interfaces. Rowmappers don't have to return beans though and can in fact just be used to map specific datatypes.
Line 28: Line 28:
 Web pages are all stored in the WEB-INF folder and are all jsp files. It is common to break up a page into a series of imports such that the page itself can basically be run in two lines. The imports contain all the structure of the page and allow for a consistent look. Check out [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/src/main/webapp/WEB-INF/jsp/termIndex.jsp|termIndex.jsp]] and [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/src/main/webapp/WEB-INF/jsp/termIndexList.jsp|termIndexList.jsp]] for an example. Web pages are all stored in the WEB-INF folder and are all jsp files. It is common to break up a page into a series of imports such that the page itself can basically be run in two lines. The imports contain all the structure of the page and allow for a consistent look. Check out [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/src/main/webapp/WEB-INF/jsp/termIndex.jsp|termIndex.jsp]] and [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/src/main/webapp/WEB-INF/jsp/termIndexList.jsp|termIndexList.jsp]] for an example.
  
-==== Accessing a jsp in WEB-INF ====+=== Accessing a jsp in WEB-INF ===
  
 Jsp sites are accessed through controllers. For each site that can be accessed their is an associated mapping in a controller that runs a function when the associated url is executed. These can be very short and just return the page or they can contain a lot of processing and data storage for the resulting web page. Jsp sites are accessed through controllers. For each site that can be accessed their is an associated mapping in a controller that runs a function when the associated url is executed. These can be very short and just return the page or they can contain a lot of processing and data storage for the resulting web page.
  
-==== Search ====+=== Search ===
  
 Search and pages that depend on special characters pass their values as arguments in the url rather than as elements of the url itself. This handles a whole host of errors and when used with UTF-8 encoding and the spring filter system protects against xss attacks.  Search and pages that depend on special characters pass their values as arguments in the url rather than as elements of the url itself. This handles a whole host of errors and when used with UTF-8 encoding and the spring filter system protects against xss attacks. 
Line 42: Line 42:
 The term index list does not display terms that have been blacklisted by an admin and furthermore will eventually be sorted by data on the type of index when such data is added. This will require some sort of interaction with the epidocs.  The term index list does not display terms that have been blacklisted by an admin and furthermore will eventually be sorted by data on the type of index when such data is added. This will require some sort of interaction with the epidocs. 
  
-The data all comes from the graffiti_index table. This table is generated by the [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/src/main/java/edu/wlu/graffiti/data/setup/InsertIndexEntries.java|Insert Index Entries]] class which for development purposes be called by the term index page function in the graffiti controller. There is talk of implementing this as a button that an admin could click but would advise caution because right now it erases all data in the table including whitelist preferences which might not be ideal.+The data all comes from the graffiti_index table. This table is generated by the [[https://github.com/sprenks18/CSCI335_AGP/blob/term_page/Graffiti/src/main/java/edu/wlu/graffiti/data/setup/InsertIndexEntries.java|Insert Index Entries]] class which for development purposes be called by the term index page function in the graffiti controller. There is talk of implementing this as a button that an admin could click but we would advise caution because at the moment it erases all data in the table including whitelist preferences which might not be ideal. 
 + 
 +==== Map Display in the Search Results ==== 
 + 
 +Prior to our work on this project, both the maps for Herculaneum and Pompeii would be displayed for all search results.  This included a search result which yielded no graffiti.  No the map display on the right side of the screen changes dynamically as the user filters their search.  If results from Herculaneum are included in the hits, then that map is displayed.  The same is true for Pompeii.  If the only results are from Smyrna, then no maps are displayed.  Currently, the maps are stationary and do not shift up and down depending on which are displayed.  This could be changed in the future according to the client's wishes. 
 +==== Loading Data into the Database Through EpiDocs ==== 
 + 
 +Loading the data representing the Smyrna graffiti is as easy as clicking a button.  Simply open ReadFromEpidoc.java and run it as a java application.  In the terminal window, you will see output statements detailing the progress of the import.  If there were to be an issue, these outputs are a great resource for the user.  Under the hood, ReadFromEpidoc iterates through all of the files in the smyrna_epidocs directory and parses them.  As it parses it saves key information and saves it in the database.  More specific information on parsing can be found here:  [[https://wlu.app.box.com/notes/191721659898 | EpiDoc Conventions]]
courses/cs335/spring2019/graffiti/documentation.txt · Last modified: 2019/05/17 16:30 by wenz
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0