Skip to content
Snippets Groups Projects
Commit cab58b15 authored by Winnie's avatar Winnie
Browse files

Merge

parents ed1d2018 e8406ba7
No related branches found
No related tags found
No related merge requests found
Showing
with 175 additions and 53 deletions
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="json-simple-1.1.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="json-simple-1.1.1.jar"/>
<classpathentry kind="lib" path="tomcat/lib/servlet-api.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
......@@ -9,4 +9,4 @@
*.csv
*.ser
.idea/
*.class
server:
cp -rf bin/* tomcat/webapps/Trawl/WEB-INF/classes
start: server
tomcat/bin/startup.sh
stop:
tomcat/bin/shutdown.sh
\ No newline at end of file
TOMCAT_DIR = tomcat/webapps/Trawl
BIN_DIR = tomcat/webapps/Trawl/bin
server: $(BIN_DIR)/TrawlExpert.class $(BIN_DIR)/../WEB-INF/classes/com/example/web/Director.class
javac -d $(TOMCAT_DIR)/WEB-INF/classes/ -classpath tomcat/lib/servlet-api.jar $(TOMCAT_DIR)/src/com/example/listener/StartUpContext.java
start:
tomcat/bin/startup.sh
stop:
tomcat/bin/shutdown.sh
$(BIN_DIR)/TrawlExpert.class: $(BIN_DIR)/data/BioTree.class $(BIN_DIR)/data/DataStore.class $(BIN_DIR)/data/Date.class $(BIN_DIR)/data/FileProcessor.class $(BIN_DIR)/data/Record.class $(BIN_DIR)/data/TaxonNode.class $(BIN_DIR)/data/TaxonType.class $(BIN_DIR)/data/WormsAPI.class $(BIN_DIR)/search/BasicSearch.class $(BIN_DIR)/search/BST.class $(BIN_DIR)/search/Histogram.class $(BIN_DIR)/sort/Bound.class $(BIN_DIR)/sort/GeneralCompare.class $(BIN_DIR)/sort/GeneralRange.class $(BIN_DIR)/sort/KDT.class $(BIN_DIR)/sort/MergeSort.class $(BIN_DIR)/sort/RangeHelper.class
javac -d $(TOMCAT_DIR)/WEB-INF/classes/ -classpath $(TOMCAT_DIR)/lib/servlet-api.jar:$(BIN_DIR):bin:json-simple-1.1.1.jar $(TOMCAT_DIR)/src/com/example/model/TrawlExpert.java
$(BIN_DIR)/data/BioTree.class: src/data/BioTree.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/data/BioTree.java
$(BIN_DIR)/data/DataStore.class: src/data/DataStore.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/data/DataStore.java
$(BIN_DIR)/data/Date.class: src/Data/date.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/data/Date.java
$(BIN_DIR)/data/FileProcessor.class: src/data/FileProcessor.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/data/FileProcessor.java
$(BIN_DIR)/data/Record.class: src/data/Record.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/data/Record.java
$(BIN_DIR)/data/TaxonNode.class: src/data/TaxonNode.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/data/TaxonNode.java
$(BIN_DIR)/data/TaxonType.class: src/data/TaxonType.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/data/TaxonType.java
$(BIN_DIR)/data/WormsAPI.class: src/data/WormsAPI.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/data/WormsAPI.java
$(BIN_DIR)/search/BasicSearch.class: src/search/BasicSearch.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/search/BasicSearch.java
$(BIN_DIR)/search/BST.class: src/search/BST.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/search/BST.java
$(BIN_DIR)/search/Histogram.class: src/search/Histogram.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/search/Histogram.java
$(BIN_DIR)/sort/Bound.class: src/sort/Bound.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/sort/Bound.java
$(BIN_DIR)/sort/GeneralCompare.class: src/sort/GeneralCompare.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/sort/GeneralCompare.java
$(BIN_DIR)/sort/GeneralRange.class: src/sort/GeneralRange.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/sort/GeneralRange.java
$(BIN_DIR)/sort/KDT.class: src/sort/KDT.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/sort/KDT.java
$(BIN_DIR)/sort/MergeSort.class: src/sort/MergeSort.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/sort/MergeSort.java
$(BIN_DIR)/sort/RangeHelper.class: src/sort/RangeHelper.java
javac -d $(BIN_DIR) -classpath bin::json-simple-1.1.1.jar src/sort/RangeHelper.java
$(BIN_DIR)/../WEB-INF/classes/com/example/web/Director.class: $(BIN_DIR)/com/example/web/Director.java
javac -d $(TOMCAT_DIR)/WEB-INF/classes -classpath src/tomcat/lib/servlet-api.jar:$(BIN_DIR) $(BIN_DIR)/com/example/web/Director.java
\ No newline at end of file
server: /TrawlExpert.java
javac -classpath
import org.json.simple.parser.ParseException;
import data.BioTree;
import data.DataStore;
import data.FileProcessor;
import data.Record;
import search.BasicSearch;
import sort.KDT;
public class TrawlExpert {
public TrawlExpert() {
//load data
try {
BioTree.init("data/biotree/");
DataStore.records = new KDT<Record>("data/kdt.ser");
} catch (Exception e0) {
try {
BioTree.init();
FileProcessor.initProcessing();
} catch (NumberFormatException | ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
BioTree.write("data/biotree/");
DataStore.records.writeToFile("data/kdt.ser");
};
BasicSearch.init();
}
}
package model;
import org.json.simple.parser.ParseException;
import data.BioTree;
import data.DataStore;
import data.FileProcessor;
import data.Record;
import search.BasicSearch;
import sort.KDT;
public class TrawlExpert {
public TrawlExpert() {
//load data
DataStore.records = new KDT<Record>("data/kdt.ser");
try {
BioTree.init("data/biotree/");
DataStore.records = new KDT<Record>("data/kdt.ser");
} catch (Exception e0) {
try {
BioTree.init();
FileProcessor.initProcessing();
} catch (NumberFormatException | ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
BioTree.write("data/biotree/");
DataStore.records.writeToFile("data/kdt.ser");
};
}
public Iterable<Integer> listAllSpecies(){
return BioTree.getNonEmptyChildren(2);
}
}
package com.example.model;
import java.util.*;
public class TrawlExpert {
public List getBrands(String phylum) {
List brands = new ArrayList();
if (phylum.equals("Arthropoda")) {
brands.add("Some arthropoda data");
brands.add("Some more Arthropoda data");
}
else {
brands.add("This aint arthropoda");
brands.add("Under construction");
}
return brands;
}
}
// For Testing on Java's Console
// public static void main(String[]args){
// String color = "amber";
// System.out.println(brand.get(0));
package com.example.model;
import java.util.*;
public class TrawlExpert {
public List getBrands(String phylum) {
List brands = new ArrayList();
if (phylum.equals("Arthropoda")) {
brands.add("Some arthropoda data");
brands.add("Some more Arthropoda data");
}
else {
brands.add("This aint arthropoda");
brands.add("Under construction");
}
return brands;
}
}
// For Testing on Java's Console
// public static void main(String[]args){
// String color = "amber";
// System.out.println(brand.get(0));
// }
\ No newline at end of file
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
package com.example.web;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
//import com.example.model.TrawlExpert; // notice this
import com.example.model.*; // notice this
public class Director extends HttpServlet {
public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException {
String c = request.getParameter("phylum");
TrawlExpert t = new TrawlExpert();
List result = t.getBrands(c);
request.setAttribute("styles", result);
RequestDispatcher view = request.getRequestDispatcher("result.jsp");
view.forward(request, response);
}
}
\ No newline at end of file
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment