diff --git a/src/main/java/org/texttechnologylab/project/gruppe_05_1/Main.java b/src/main/java/org/texttechnologylab/project/gruppe_05_1/Main.java index fc6bdfa..1c7c941 100644 --- a/src/main/java/org/texttechnologylab/project/gruppe_05_1/Main.java +++ b/src/main/java/org/texttechnologylab/project/gruppe_05_1/Main.java @@ -9,37 +9,11 @@ import org.texttechnologylab.project.gruppe_05_1.util.Logger; import org.texttechnologylab.project.gruppe_05_1.util.PPRUtils; import org.texttechnologylab.project.gruppe_05_1.xml.FileObjectFactory; import org.texttechnologylab.project.gruppe_05_1.xml.speeches.SpeechParser; -import org.xml.sax.SAXException; - -import javax.xml.parsers.ParserConfigurationException; -import java.io.IOException; import java.util.Arrays; import static java.lang.Boolean.FALSE; import static java.lang.Boolean.TRUE; -/* -import com.mongodb.client.*; -import org.bson.Document; - -import org.texttechnologylab.project.Schelp_Valentin.database.MongoDBHandler; -import org.texttechnologylab.project.Schelp_Valentin.database.MongoObjectFactory; -import org.texttechnologylab.project.Schelp_Valentin.domain.mdb.MdbDocument; -import org.texttechnologylab.project.Schelp_Valentin.domain.mdb.Mdb; -import org.texttechnologylab.project.Schelp_Valentin.domain.reden.PlenarProtokoll; -import org.texttechnologylab.project.Schelp_Valentin.html.HtmlGenerationUtils; -import org.texttechnologylab.project.Schelp_Valentin.html.SortPossibilities; -import org.texttechnologylab.project.Schelp_Valentin.util.FileUtils; -import org.texttechnologylab.project.Schelp_Valentin.util.PPRUtils; -import org.texttechnologylab.project.Schelp_Valentin.util.PropertiesUtils; -import org.texttechnologylab.project.Schelp_Valentin.util.XmlUtils; -import org.texttechnologylab.project.Schelp_Valentin.xml.FileObjectFactory; -import org.texttechnologylab.project.Schelp_Valentin.xml.reden.PlenarProtokoll_File_Impl; -import org.w3c.dom.Element; - -import java.util.*; -import java.util.stream.Collectors; - */ public class Main { public static final String RESOURCES_DIR="src/main/resources/"; @@ -123,60 +97,5 @@ public class Main { restHandler.startJavalin(); } - - - /* Auskommentiert aber nicht gelöscht, damit meine Methodik/Anwendung nachvollzogen werden kann - - - public static void main(String[] args) { - - - - - - // Plenarprotokolle lesen und in die MongoDB schreiben - Set protokollFileNames = FileUtils.listFilesInDirectory(PROTOKOLLE_DIRNAME) - .stream() - .filter(file -> file.endsWith(".xml")) - .collect(Collectors.toSet()); - ; - - String collectionName = "speeches"; - // MongoDBHandler.createCollectionIfNotExist(database, collectionName); - MongoDBHandler.createOrTrancateCollection(database, collectionName); - MongoCollection collection = database.getCollection(collectionName); - for (String filename : protokollFileNames) { - // for (String filename : Arrays.asList("1.XML", "2.XML")) { // für Testzwecke,,, - System.out.println("Plenarprotokoll wird aus " + filename + " gelesen"); - Element redenRoot = XmlUtils.getRootDocument("src/main/resources/plenarprotokolle/" + filename); - PlenarProtokoll redenDoc = new PlenarProtokoll_File_Impl().fromXmlNode(redenRoot); - MongoDBHandler.createPlenarprotokoll(collection, redenDoc); - } - - - // wichtige Datenstrukturen erzeugen: Listen, Zuordnungen - Map> pareiMdbZuordnung = PPRUtils.createMdbParteiZuordnung(mdbList); - - - // HTML-Generierung - // Vorbereitung - HtmlGenerationUtils.prepareHtmlGeneration(); - - // index.html - - /* - * Hier wird bestimmt, wie die index.html-Seite aufgebaut wird, je nach verwendete Enum aus SortPossibilities: - * - MDB_ALPHABETISCH: parteiübergreifend alphabetisch sortiert - * - nach Partei gruppiert, innerhalb der Partei alphabetisch sortiert: - * - PARTEI_MDB_ALPHABETISCH: die Parteien erscheinen in alphabetischen Reihenfolge - * - PARTEI_NACH_GROESSE: die Parteien erscheinen nach Anzahl ihrer dBs sortiert - * TODO: CLOSE COMMENT - HtmlGenerationUtils.generateIndexHtml(mdbList, pareiMdbZuordnung, SortPossibilities.MDB_ALPHABETISCH); - - HtmlGenerationUtils.generateMdbPages(mdbList); - -} - */ - }