diff --git a/pom.xml b/pom.xml index f0038ea..cd42625 100644 --- a/pom.xml +++ b/pom.xml @@ -8,9 +8,16 @@ jar ZuMultMVN - https://zumult.org/ + + + + + github-manual + https://raw.githubusercontent.com/Exmaralda-Org/exmaralda/master/src/build/webjar/ + + https://zumult.org/ - ${project.artifactId} + ${project.artifactId} src/main/resources @@ -20,8 +27,12 @@ src/main/java + + /data/corpora/** + /data/indices/** + - + org.apache.maven.plugins @@ -68,10 +79,11 @@ ojdbc6 11.2.0.4 --> + org.exmaralda - EXMARaLDA - Preview-20220623 + EXMARaLDA_WEB + 1.0.0 jar @@ -258,4 +270,4 @@ - \ No newline at end of file + diff --git a/src/main/java/org/zumult/backend/implementations/COMAFileSystem.java b/src/main/java/org/zumult/backend/implementations/COMAFileSystem.java index 167ca3f..6dc62d3 100644 --- a/src/main/java/org/zumult/backend/implementations/COMAFileSystem.java +++ b/src/main/java/org/zumult/backend/implementations/COMAFileSystem.java @@ -359,8 +359,9 @@ public IDList getTranscripts4SpeechEvent(String speechEventID) throws IOExceptio /*NodeList allTranscripts = (NodeList) xPath.evaluate("//Transcription[substring(Filename, string-length(Filename)-3)='.exb' or substring(Filename, string-length(Filename)-3)='.EXB']", communication.getDocument().getDocumentElement(), XPathConstants.NODESET);*/ + String xpath = "//Transcription[substring(Filename, string-length(Filename)-3)='.xml' or substring(Filename, string-length(Filename)-3)='.XML']"; NodeList allTranscripts = - (NodeList) xPath.evaluate("//Transcription[substring(Filename, string-length(Filename)-3)='.xml' or substring(Filename, string-length(Filename)-3)='.XML']", + (NodeList) xPath.evaluate(xpath, communication.getDocument().getDocumentElement(), XPathConstants.NODESET); for (int i=0; i - - + + + diff --git a/src/main/java/org/zumult/objects/implementations/COMACommunication.java b/src/main/java/org/zumult/objects/implementations/COMACommunication.java index adab0d4..2912584 100644 --- a/src/main/java/org/zumult/objects/implementations/COMACommunication.java +++ b/src/main/java/org/zumult/objects/implementations/COMACommunication.java @@ -113,7 +113,8 @@ public List getTopics() { public IDList getTranscripts() { IDList result = new IDList("transcript"); try { - String xPathString = "descendant::Transcription"; + //String xPathString = "descendant::Transcription"; + String xPathString = "descendant::Transcription[substring(Filename, string-length(Filename)-3)='.xml' or substring(Filename, string-length(Filename)-3)='.XML']"; NodeList transcriptionNodeList = (NodeList) xPath.evaluate(xPathString, getDocument().getDocumentElement(), XPathConstants.NODESET); for (int i=0; i getIndexPaths(SearchIndexType searchIndex) throws IOException, SearchServiceException { ArrayList result = new ArrayList<>(); + // this is for #219 + String corpQ = metadataQuery.corpusQuery.replaceAll("corpusSigle=", "").replace("\"", ""); + // Corpus: corpusSigle="INTV" + System.out.println("Corpus: " + corpQ); + String[] corps = (corpQ + "|").split("\\|"); + Set corpora = new HashSet<>(); + for (String c : corps){ + corpora.add(c.trim()); + } + //for (String indexID : Configuration.getTranscriptBasedIndexIDs()){ for (String indexID : Configuration.getSpeakerBasedIndexIDs()){ + // this is for #219 + String thisCorpus = indexID.substring(indexID.indexOf("_")+1); + if (!corpora.contains(thisCorpus)) continue; + File file = new File(Configuration.getSearchIndexPath(), indexID); result.add(file.getAbsolutePath()); } diff --git a/src/main/java/org/zumult/query/implementations/ISOTEIKWICSnippetCreator.java b/src/main/java/org/zumult/query/implementations/ISOTEIKWICSnippetCreator.java index f8c9239..d9ddbc8 100644 --- a/src/main/java/org/zumult/query/implementations/ISOTEIKWICSnippetCreator.java +++ b/src/main/java/org/zumult/query/implementations/ISOTEIKWICSnippetCreator.java @@ -95,8 +95,13 @@ public DefaultKWICSnippet apply(Document transcriptDoc, //Node firstAnnotationBlock = (Element) xPath.evaluate(xpathString, TranscriptDoc, XPathConstants.NODE); //Node firstAnnotationBlock = (Node) xPath.compile(xpathString).evaluate(transcriptDoc, XPathConstants.NODE); //Node firstAnnotationBlock = (Node) firstElem.getParentNode().getParentNode().getParentNode(); - Element firstAnnotationBlockElem = (Element) firstElem.getParentNode().getParentNode().getParentNode(); + // This is wrong if we have nested s + //Element firstAnnotationBlockElem = (Element) firstElem.getParentNode().getParentNode().getParentNode(); + + String xpathString = "ancestor::tei:"+ Constants.ELEMENT_NAME_ANNOTATION_BLOCK + "[1]"; + Element firstAnnotationBlockElem = (Element) xPath.evaluate(xpathString, firstElem, XPathConstants.NODE); String speaker = firstAnnotationBlockElem.getAttribute(Constants.ATTRIBUTE_NAME_WHO); + //System.out.println("Speaker is " + speaker); speaker = getSpeakerInitials(speaker, transcriptDoc); // get left context int index = 0; @@ -192,10 +197,13 @@ public DefaultKWICSnippet apply(Document transcriptDoc, private String getSpeakerInitials(String speaker, Document transcriptDoc){ + String xpathString = "//tei:person[@xml:id='" + speaker + "']"; + //System.out.println("Looking for " + speaker); + //Node personNode = null; try { // /tei:TEI/tei:teiHeader[1]/tei:profileDesc[1]/tei:particDesc[1]/tei:person[1] - String xpathString = "/tei:TEI/tei:teiHeader[1]/tei:profileDesc[1]/tei:particDesc[1]/tei:person[@xml:id='" + speaker + "']"; + //String xpathString = "/tei:TEI/tei:teiHeader[1]/tei:profileDesc[1]/tei:particDesc[1]/tei:person[@xml:id='" + speaker + "']"; Element personElement = (Element) xPath.compile(xpathString).evaluate(transcriptDoc, XPathConstants.NODE); if (personElement!=null){ return personElement.getAttribute("n"); diff --git a/src/main/resources/resources/MessageBundle.properties b/src/main/resources/resources/MessageBundle.properties index ff43b83..a974e23 100644 --- a/src/main/resources/resources/MessageBundle.properties +++ b/src/main/resources/resources/MessageBundle.properties @@ -14,7 +14,7 @@ DocumentsPerPage=Documents per Page Download=Download DownloadOptions=Download Options DownloadKWIC=Download KWIC -EnterYourCQP=Please enter your CQP query and choose between different search modes +EnterYourCQP=Please enter your CQP query Examples=Examples SearchInputFieldPlaceholder=Find... First=First @@ -89,7 +89,7 @@ ViewHitsAsLemmaTable=View hits as lemma table ViewHitsAsKWICOnTheQueryTab=View hits as KWIC on the Query-Tab Vocabulary=Lemma and Query Lists WordTokens=word tokens -ZuRechtSubtitle=CQP queries to the AGD corpora, using a Lucene index via MTAS +ZuRechtSubtitle=CQP queries corpora, using a Lucene index via MTAS ReferenceWordlist=Reference wordlist RefWordlist=Ref wordlist WaitWordlistLoading=Please wait -- wordlist is loading. diff --git a/src/main/resources/resources/MessageBundle_de_DE.properties b/src/main/resources/resources/MessageBundle_de_DE.properties index 672ebd8..08fd33a 100644 --- a/src/main/resources/resources/MessageBundle_de_DE.properties +++ b/src/main/resources/resources/MessageBundle_de_DE.properties @@ -2,7 +2,7 @@ Project=Projekt Home=Startseite Logout=Ausloggen -ZuRechtSubtitle=CQP-Suchanfragen in den Korpora des AGD +ZuRechtSubtitle=CQP-Suchanfragen in Korpora AvailableCorpora=Korpora Cancel=Abbrechen InPreparation=in Vorbereitung @@ -32,7 +32,7 @@ SearchBtn=Suche starten OpenPanelWithSearchOptions=Suchoptionen \u00f6ffnen IgnorePunctuation=Satzzeichen ignorieren NumberOfHitsForDownload=Anzahl der Treffer f\u00fcr Download -EnterYourCQP=Bitte geben Sie Ihren CQP-Suchausdruck ein und w\u00e4hlen Sie den Suchmodus (Transkript- vs. Sprecher-basiert) +EnterYourCQP=Bitte geben Sie Ihren CQP-Suchausdruck ein OpenHelp=Hilfe anzeigen Loading=wird geladen... LoadingPage=Bitte warten Sie. Die Seite wird geladen... diff --git a/web/images/talking.png b/web/images/talking.png new file mode 100644 index 0000000..3ff2f0f Binary files /dev/null and b/web/images/talking.png differ diff --git a/web/images/words.jpg b/web/images/words.jpg new file mode 100644 index 0000000..0b7fa49 Binary files /dev/null and b/web/images/words.jpg differ diff --git a/web/index.jsp b/web/index.jsp index 00bb548..337bc6f 100644 --- a/web/index.jsp +++ b/web/index.jsp @@ -8,6 +8,11 @@ <%@page import="java.util.Locale"%> <%@page import="java.util.ResourceBundle"%> +<%@page import="org.zumult.objects.IDList"%> +<%@page import="org.zumult.backend.BackendInterfaceFactory"%> +<%@page import="org.zumult.backend.BackendInterface"%> + + @@ -36,7 +41,6 @@ - <%@include file="WEB-INF/jspf/matomoTracking.jspf" %> @@ -69,9 +69,9 @@ - <% String pageTitle = "Korpusübersicht Archiv für Gesprochenes Deutsch"; + <% String pageTitle = "Korpusübersicht"; if ("en".equals(language)) { - pageTitle = "Corpus overview Archive for Spoken German"; + pageTitle = "Corpus overview"; } String pageName = "ZuMult"; %> @@ -83,13 +83,12 @@

<% if ("en".equals(language)) { %> - This page gives an overview of the <%= corpora.size() %> spoken language corpora of the - Archive for Spoken German - which are available online. + This page gives an overview of the <%= corpora.size() %> corpora available in this + ZuMult instance. <% } else { %> - Diese Seite gibt einen Überblick über die <%= corpora.size() %> mündlichen Korpora des - Archiv für Gesprochenes Deutsch, - die online zugänglich sind. + Diese Seite gibt einen Überblick über die <%= corpora.size() %> Korpora, die in dieser + ZuMult-Instanz + zugänglich sind. <% } %>

@@ -112,7 +111,7 @@
- ... + ... <% if (IMAGE_COPYRIGHT_MAP.containsKey(corpusID)) { %>
© <%= IMAGE_COPYRIGHT_MAP.get(corpusID) %>
<% } %> @@ -123,14 +122,6 @@
<%=acronym%>
<%=name%>

<%=description%>

- - <%= backendInterface.getEvents4Corpus(corpusID).size() %> - <% if ("en".equals(language)) { %> - Events - <% } else { %> - Ereignisse - <% } %> - <%= backendInterface.getSpeechEvents4Corpus(corpusID).size() %> <% if ("en".equals(language)) { %> diff --git a/web/jsp/speecheventstable.jsp b/web/jsp/speecheventstable.jsp index f68c72e..77b0c46 100644 --- a/web/jsp/speecheventstable.jsp +++ b/web/jsp/speecheventstable.jsp @@ -106,9 +106,10 @@ // Long dur = System.currentTimeMillis() - time; // time = System.currentTimeMillis(); SpeechEvent speechEvent = backendInterface.getSpeechEvent(speechEventID); + String firstTranscriptID = speechEvent.getTranscripts().get(0); %> - <%=speechEventID%> + <%=speechEventID%> <% for (MetadataKey metadataKey : metadataKeys){ String metadataValue = speechEvent.getMetadataValue(metadataKey); diff --git a/web/jsp/testvideo.jsp b/web/jsp/testvideo.jsp deleted file mode 100644 index 72c68fd..0000000 --- a/web/jsp/testvideo.jsp +++ /dev/null @@ -1,32 +0,0 @@ -<%-- - Document : testvideo - Created on : 16.05.2018, 11:10:43 - Author : Thomas_Schmidt ---%> - -<%@page import="org.zumult.objects.Media"%> -<%@page import="org.zumult.backend.BackendInterfaceFactory"%> -<%@page import="org.zumult.backend.BackendInterface"%> -<%@page contentType="text/html" pageEncoding="UTF-8"%> - -<% - response.setHeader("Access-Control-Allow-Origin", "*"); - %> - - - - - JSP Page - - - <% - BackendInterface backendInterface = BackendInterfaceFactory.newBackendInterface(); - Media someVideo = backendInterface.getMedia("BETV_E_00001_SE_01_V_01"); - String videoURL = someVideo.getURL(); - %> -

Hello World!

- - -