Skip to content

Commit

Permalink
Some smaller changes for berndmoos/zumulttgdp#29
Browse files Browse the repository at this point in the history
  • Loading branch information
berndmoos committed Jun 10, 2024
1 parent dd4f406 commit 500b2e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/zumult/backend/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class Configuration {

// new for #174
private static String isoTei2HtmlStylesheet;
private static String isoTei2HtmlAnnotationsStylesheet;
// new for #175
private static String event2HtmlStylesheet;
private static String speechEvent2HtmlStylesheet;
Expand Down Expand Up @@ -164,6 +165,14 @@ public static String getIsoTei2HTMLStylesheet(){
}
return Constants.ISOTEI2HTML_STYLESHEET2;
}

public static String getIsoTei2HTMLAnnotationsStylesheet() {
if (isoTei2HtmlAnnotationsStylesheet!=null){
return isoTei2HtmlAnnotationsStylesheet;
}
return Constants.ISOTEI2HTML_ANNOTATIONS_STYLESHEET;
}


// new for #175
public static String getEvent2HTMLStylesheet(){
Expand Down Expand Up @@ -231,6 +240,7 @@ static void read(){

// new for #174
isoTei2HtmlStylesheet = config.getString("backend.isotei2html-xsl");
isoTei2HtmlAnnotationsStylesheet = config.getString("backend.isotei2html-annotations-xsl");
// new for #175
event2HtmlStylesheet = config.getString("backend.event2html-xsl");
speechEvent2HtmlStylesheet = config.getString("backend.speechevent2html-xsl");
Expand Down Expand Up @@ -275,6 +285,7 @@ static void read(){
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
}
}



}
7 changes: 5 additions & 2 deletions src/main/java/org/zumult/webservices/ZumultDataServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ private void getAnnotations(HttpServletRequest request, HttpServletResponse resp
String startAnnotationBlockID = request.getParameter("startAnnotationBlockID");
String endAnnotationBlockID = request.getParameter("endAnnotationBlockID");

System.out.println("getAnnotations called with TRANSCRIPT ID=" + transcriptID + " and START_ANNOTATION_BLOCK_ID=" + startAnnotationBlockID);
//System.out.println("getAnnotations called with TRANSCRIPT ID=" + transcriptID + " and START_ANNOTATION_BLOCK_ID=" + startAnnotationBlockID);

BackendInterface backend = BackendInterfaceFactory.newBackendInterface();
Transcript transcript = backend.getTranscript(transcriptID);
Expand All @@ -959,7 +959,10 @@ private void getAnnotations(HttpServletRequest request, HttpServletResponse resp
{"END_ANNOTATION_BLOCK_ID", endAnnotationBlockID},
};

String annotationHTML = new IOHelper().applyInternalStylesheetToString(Constants.ISOTEI2HTML_ANNOTATIONS_STYLESHEET, transcript.toXML(), parameters);
String xsl = Configuration.getIsoTei2HTMLAnnotationsStylesheet();

//String annotationHTML = new IOHelper().applyInternalStylesheetToString(Constants.ISOTEI2HTML_ANNOTATIONS_STYLESHEET, transcript.toXML(), parameters);
String annotationHTML = new IOHelper().applyInternalStylesheetToString(xsl, transcript.toXML(), parameters);
//System.out.println("********* ANNOTATION HTML ************\n" + annotationHTML);

response.setContentType("text/html");
Expand Down

0 comments on commit 500b2e8

Please sign in to comment.