creating adjudicators in a war computer science innovations, llc
TRANSCRIPT
![Page 1: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/1.jpg)
Creating Adjudicators in a WAR
Computer Science Innovations, LLC
![Page 2: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/2.jpg)
Setup
Make sure /cloud project is downloaded Start up eclipse and open it in cloud directory
(something like /home/scott/cloud) ssh -X [email protected] to be able to open X
sessions if doing this on cloud [Screenshot]
![Page 3: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/3.jpg)
![Page 4: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/4.jpg)
Setup (Eclipse)
Close front window and right click on left to open a New Project
[Screenshot]
![Page 5: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/5.jpg)
![Page 6: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/6.jpg)
Setup (Eclipse)
Title the project cloud and hit Finish [Screenshot]
![Page 7: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/7.jpg)
![Page 8: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/8.jpg)
Setup (Eclipse)
Screen should look like below [Screenshot]
![Page 9: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/9.jpg)
![Page 10: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/10.jpg)
Setup (Eclipse)
Click Yes to include java perspective [Screenshot]
![Page 11: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/11.jpg)
![Page 12: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/12.jpg)
![Page 13: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/13.jpg)
Setup (Eclipse)
Go to util/src/cloud/LoadRestfulWebService.java
[Screenshot]
![Page 14: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/14.jpg)
![Page 15: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/15.jpg)
LoadRestfulWebService Explained
Typical protocols
– Http, https, REST, JSON, 1-way SSL (https), 2-way SSL (https with identity assertion)
LoadRestfulWebService
– Uses RESTful service to load users, groups, and roles
– Calls cloud application and loads data into SOLR
![Page 16: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/16.jpg)
LoadRestfulWebService Explained
Main() adds roles, groups, and users AddUser(), AddRoles(), AddGroups()
– Gets properties from properties file
– Gets URI information to fill in user data• Category is 'table name'
– Sends data to servlet that writes to SOLR GetProperties()
– Gets data from load.properties
– Files are either on the web or off the classpath, load.properties is off classpath
![Page 17: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/17.jpg)
JSONUpdateServlet
Go to cloud-war/src/java/cloud/servlets/JSONUpdateServlet.java
[Screenshot]
![Page 18: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/18.jpg)
![Page 19: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/19.jpg)
JSONUpdateServlet
Takes data from URI that is sent RESTfully and writes it to SOLR
WriteToSOLR() already exists and should be used to write to SOLR
![Page 20: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/20.jpg)
Where to Start?
Cloud-functional-tests/src/TestAdd.java [Screenshot]
![Page 21: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/21.jpg)
![Page 22: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/22.jpg)
TestAdd.java
Test program that goes to SOLR, makes a request
– JUNIT test uses asserts to see if the test passes or fails. If assert line is true, test works, if not, then test does not work.
![Page 23: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/23.jpg)
Seeing if cloud works
Go to cloud/cloud/solr.solr.home/collection1/data and do an rm -rf *
Go to terminal, start tomcat with 'st' In other window, cd to /cloud/cloud and type:
ant deploy [Screenshot]
![Page 24: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/24.jpg)
![Page 25: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/25.jpg)
![Page 26: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/26.jpg)
Seeing if cloud works
In cloud/cloud do:
ant run-clear-index
ant run-load-web-service In browser go to:
localhost:8080/cloud/select?q=*:*&rows=100
[Screenshot]
![Page 27: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/27.jpg)
![Page 28: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/28.jpg)
Cloud Project Continued
You have to add a login module to cloud
– Already added in for you Files to take from adjudicator_software folder
in content.scottstreit.com/compsec
– Jaas.config goes in tomcat config directory
– RolePrincipal.java
– SolrLoginModule.java• It gets called in web.xml
– There are security constraints and login-configs in web.xml
![Page 29: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/29.jpg)
SolrLoginModule
SolrLoginModule.java• It gets called in web.xml
– There are security constraints and login-configs in web.xml
– <auth-method>BASIC</auth-method> for login-config
![Page 30: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/30.jpg)
Cloud Project Continued
You have to add a login module to cloud
– Already added in for you Files to take from adjudicator_software folder
in content.scottstreit.com/compsec
– Jaas.config goes in tomcat config directory
– RolePrincipal.java
– SolrLoginModule.java• It gets called in web.xml
– There are security constraints and login-configs in web.xml
![Page 31: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/31.jpg)
JUNIT Test Attempt
In cloud/cloud run the following:
ant run-tests [Screenshot]
![Page 32: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/32.jpg)
![Page 33: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/33.jpg)
JUNIT Test Attempt
Go to /cloud/cloud/cloud-functional-tests/classes and open the TestAdd.xml file inside the folder
[Screenshot]
![Page 34: Creating Adjudicators in a WAR Computer Science Innovations, LLC](https://reader033.vdocuments.site/reader033/viewer/2022051215/56649e725503460f94b71a63/html5/thumbnails/34.jpg)