6 package de.uni_hamburg.corpora.visualization;
15 import java.io.IOException;
16 import java.net.MalformedURLException;
18 import java.util.Collection;
19 import javax.xml.parsers.ParserConfigurationException;
20 import javax.xml.
transform.TransformerConfigurationException;
21 import javax.xml.transform.TransformerException;
22 import javax.xml.xpath.XPathExpressionException;
23 import org.xml.sax.SAXException;
32 static final String STYLESHEET_PATH =
"/xsl/Coma2HTML.xsl";
33 private static final String SERVICE_NAME =
"ComaHTML";
47 String corpusPrefix = coma.split(
"<Key Name=\"hzsk:corpusPrefix\">")[1].split(
"</Key>")[0];
48 String corpusVersion = coma.split(
"<Key Name=\"hzsk:corpusVersion\">")[1].split(
"</Key>")[0];
54 xt.
setParameter(
"identifier",
"spoken-corpus:" + corpusPrefix +
"-" + corpusVersion);
56 }
catch (TransformerConfigurationException ex) {
57 stats.
addException(ex, SERVICE_NAME, cd,
"Unknown TransformerConfigurationException");
58 }
catch (TransformerException ex) {
59 stats.
addException(ex, SERVICE_NAME, cd,
"Unknown TransformerException");
73 cio.write(result, targeturl);
74 }
catch (MalformedURLException ex) {
75 stats.
addException(ex, SERVICE_NAME, cd,
"Malformed URL used");
76 }
catch (IOException ex) {
77 stats.
addException(ex, SERVICE_NAME, cd,
"Unknown Input Output error");
78 }
catch (TransformerException ex) {
79 stats.
addException(SERVICE_NAME, ex,
"Transformer Exception");
80 }
catch (ParserConfigurationException ex) {
81 stats.
addException(SERVICE_NAME, ex,
"Parser Exception");
82 }
catch (SAXException ex) {
84 }
catch (XPathExpressionException ex) {
91 public Report function(
Corpus co)
throws TransformerException, TransformerConfigurationException, IOException, SAXException {
93 Collection<BasicTranscriptionData> btc = co.getBasicTranscriptionData();
95 stats.
merge(
function(bt));
103 Class cl = Class.forName(
"de.uni_hamburg.corpora.ComaData");
105 }
catch (ClassNotFoundException ex) {
112 throw new UnsupportedOperationException(
"Not supported yet.");
125 String description =
"This class creates an html overview of the corpus " 126 +
"needed for the ingest into the repository. ";
String getFilenameWithoutFileEnding()
String toSaveableString()
Collection< Class<?extends CorpusData > > getIsUsableFor()
static String InputStream2String(InputStream is)
String createFromComa(String coma)
void addException(Throwable e, String description)
Report doMain(String[] args)