Commit 2ddd716b authored by thorsten.vitt's avatar thorsten.vitt
Browse files

Merge branch 'release/1.4.2'

parents d55afd10 c228aac2
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>info.textgrid.services</groupId> <groupId>info.textgrid.services</groupId>
<artifactId>aggregator</artifactId> <artifactId>aggregator</artifactId>
<version>1.4.1</version> <version>1.4.2</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>TextGrid Aggregator Service</name> <name>TextGrid Aggregator Service</name>
......
...@@ -200,13 +200,7 @@ ...@@ -200,13 +200,7 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="desc">
<xsl:comment>
<xsl:apply-templates/>
</xsl:comment>
</xsl:template>
<xsl:template name="copyrightStatement"> <xsl:template name="copyrightStatement">
<xsl:choose> <xsl:choose>
<xsl:when test="/*/teiHeader/fileDesc/publicationStmt/availability"> <xsl:when test="/*/teiHeader/fileDesc/publicationStmt/availability">
......
...@@ -32,5 +32,35 @@ ...@@ -32,5 +32,35 @@
</xsl:if> </xsl:if>
<xsl:apply-templates mode="plain"/> <xsl:apply-templates mode="plain"/>
</xsl:template> </xsl:template>
<!--
desc/title is used for headings from <lem> elements, which we suspected to be zeno.org navigation only.
The contents is usually supressed in HTML output, however we construct an artificial title from it
iff its string contents is different from the first following head for cases where the original heading
from the text has _not_ been explicitely encoded by zeno.org ...
-->
<xsl:template match="desc">
<xsl:choose>
<xsl:when test="normalize-space(.) = normalize-space(following::head[1])">
<xsl:comment>
<xsl:apply-templates/>
</xsl:comment>
</xsl:when>
<xsl:otherwise>
<xsl:comment>unsupressed desc content</xsl:comment>
<xsl:apply-templates/>
<xsl:comment>/unsupressed desc content</xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="desc/title">
<xsl:param name="Depth" select="2 + count(ancestor::div)"/>
<xsl:element name="h{if ($Depth > 6) then 6 else $Depth}">
<xsl:attribute name="class">desc</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
...@@ -39,25 +39,25 @@ ...@@ -39,25 +39,25 @@
* {@linkplain XMLUnit#setIgnoreDiffBetweenTextAndCDATA(boolean) ignoring the * {@linkplain XMLUnit#setIgnoreDiffBetweenTextAndCDATA(boolean) ignoring the
* difference between CDATA segments and text}, and * difference between CDATA segments and text}, and
* {@linkplain XMLUnit#setNormalizeWhitespace(boolean) normalizing whitespace}. * {@linkplain XMLUnit#setNormalizeWhitespace(boolean) normalizing whitespace}.
* *
* If you modified or upgraded the stylesheets and you are sure the differences are ok, * If you modified or upgraded the stylesheets and you are sure the differences are ok,
* you can run {@code mvn -Dregression.outputdir=src/test/resources test} to generate new * you can run {@code mvn -Dregression.outputdir=src/test/resources test} to generate new
* versions of the reference documents, and check them in. * versions of the reference documents, and check them in.
* *
* @author Thorsten Vitt <thorsten.vitt@uni-wuerzburg.de> * @author Thorsten Vitt <thorsten.vitt@uni-wuerzburg.de>
*/ */
public class HtmlRegressionTest extends XMLTestCase { public class HtmlRegressionTest extends XMLTestCase {
private static final String OUTPUTDIR_PROPERTY = "regression.outputdir"; private static final String OUTPUTDIR_PROPERTY = "regression.outputdir";
private ITextGridRep rep = TextGridRepProvider.getInstance(); private final ITextGridRep rep = TextGridRepProvider.getInstance();
private StylesheetManager stylesheets = new StylesheetManager(null, private final StylesheetManager stylesheets = new StylesheetManager(null,
TextGridRepProvider.getInstance()); TextGridRepProvider.getInstance());
protected void writeHtmlTo(final String uris, final OutputStream target) protected void writeHtmlTo(final String uris, final OutputStream target)
throws WebApplicationException, IOException, ObjectNotFoundFault, throws WebApplicationException, IOException, ObjectNotFoundFault,
MetadataParseFault, IoFault, ProtocolNotImplementedFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault,
AuthFault, SaxonApiException { AuthFault, SaxonApiException {
HTMLWriter htmlWriter = new HTMLWriter(rep, stylesheets, uris, null, final HTMLWriter htmlWriter = new HTMLWriter(rep, stylesheets, uris, null,
false, false, false, null, null, null, null, null); false, false, false, null, null, null, null, null);
htmlWriter.createResponse(); htmlWriter.createResponse();
htmlWriter.write(target); htmlWriter.write(target);
...@@ -72,18 +72,18 @@ public void compareHtml(final String uris, final String compareFilename) ...@@ -72,18 +72,18 @@ public void compareHtml(final String uris, final String compareFilename)
XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
XMLUnit.setNormalizeWhitespace(true); XMLUnit.setNormalizeWhitespace(true);
Optional<String> outputPath = Optional.<String> fromNullable(System final Optional<String> outputPath = Optional.<String> fromNullable(System
.getProperty(OUTPUTDIR_PROPERTY)); .getProperty(OUTPUTDIR_PROPERTY));
if (outputPath.isPresent()) { if (outputPath.isPresent()) {
File targetFile = new File(outputPath.get(), compareFilename); final File targetFile = new File(outputPath.get(), compareFilename);
FileOutputStream target = new FileOutputStream(targetFile); final FileOutputStream target = new FileOutputStream(targetFile);
System.out.println(MessageFormat.format( System.out.println(MessageFormat.format(
"### Writing the current result for {0} to {1}", uris, "### Writing the current result for {0} to {1}", uris,
targetFile)); targetFile));
writeHtmlTo(uris, target); writeHtmlTo(uris, target);
target.close(); target.close();
} else { } else {
FileBackedOutputStream target = new FileBackedOutputStream( final FileBackedOutputStream target = new FileBackedOutputStream(
1048 * 1048); 1048 * 1048);
System.out System.out
.println(MessageFormat .println(MessageFormat
...@@ -93,12 +93,12 @@ public void compareHtml(final String uris, final String compareFilename) ...@@ -93,12 +93,12 @@ public void compareHtml(final String uris, final String compareFilename)
writeHtmlTo(uris, target); writeHtmlTo(uris, target);
target.close(); target.close();
InputSource control = new InputSource(getClass().getClassLoader() final InputSource control = new InputSource(getClass().getClassLoader()
.getResourceAsStream(compareFilename)); .getResourceAsStream(compareFilename));
InputSource test = new InputSource(target.getSupplier().getInput()); final InputSource test = new InputSource(target.getSupplier().getInput());
Diff diff = new Diff(control, test); final Diff diff = new Diff(control, test);
DetailedDiff detailedDiff = new DetailedDiff(diff); final DetailedDiff detailedDiff = new DetailedDiff(diff);
assertTrue(MessageFormat.format("HTML Regression for {0} / {1}\n", uris, compareFilename) + detailedDiff.toString(), diff.identical()); assertTrue(MessageFormat.format("HTML Regression for {0} / {1}\n", uris, compareFilename) + detailedDiff.toString(), diff.identical());
} }
} }
...@@ -107,7 +107,7 @@ public void compareHtml(final String uris, final String compareFilename) ...@@ -107,7 +107,7 @@ public void compareHtml(final String uris, final String compareFilename)
public void testPoem() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException { public void testPoem() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException {
compareHtml("textgrid:mr47.0", "mr47.0.html"); compareHtml("textgrid:mr47.0", "mr47.0.html");
} }
@Test @Test
public void testDrama() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException { public void testDrama() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException {
compareHtml("textgrid:msdd.0", "msdd.0.html"); compareHtml("textgrid:msdd.0", "msdd.0.html");
...@@ -117,20 +117,25 @@ public void testDrama() throws WebApplicationException, IOException, SAXExceptio ...@@ -117,20 +117,25 @@ public void testDrama() throws WebApplicationException, IOException, SAXExceptio
public void testNovel() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException { public void testNovel() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException {
compareHtml("textgrid:mr23.0", "mr23.0.html"); compareHtml("textgrid:mr23.0", "mr23.0.html");
} }
@Test @Test
public void testPoems() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException { public void testPoems() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException {
compareHtml("textgrid:mjr3.0", "mjr3.0.html"); compareHtml("textgrid:mjr3.0", "mjr3.0.html");
} }
@Test @Test
public void testBiography() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException { public void testBiography() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException {
compareHtml("textgrid:nbvb.0", "nbvb.0.html"); compareHtml("textgrid:nbvb.0", "nbvb.0.html");
} }
@Test
public void testDescs() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException {
compareHtml("textgrid:n2kf.0", "n2kf.0.html");
}
@Test @Test
public void testLetter() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException { public void testLetter() throws WebApplicationException, IOException, SAXException, ObjectNotFoundFault, MetadataParseFault, IoFault, ProtocolNotImplementedFault, AuthFault, SaxonApiException {
compareHtml("textgrid:11sqw.0", "11sqw.0.html"); compareHtml("textgrid:11sqw.0", "11sqw.0.html");
} }
} }
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="15.2"> <project version="16.0">
<meta> <meta>
<filters directoryPatterns="" filePatterns="" positiveFilePatterns="" showHiddenFiles="false"/> <filters directoryPatterns="" filePatterns="" positiveFilePatterns="" showHiddenFiles="false"/>
<options> <options>
<serialized version="15.2" xml:space="preserve"> <serialized version="16.0" xml:space="preserve">
<map> <serializableOrderedMap>
<entry> <entry>
<String>enable.project.master.files.support</String> <String>enable.project.master.files.support</String>
<Boolean>true</Boolean> <Boolean>true</Boolean>
...@@ -14,16 +14,18 @@ ...@@ -14,16 +14,18 @@
<scenarioAssociation-array> <scenarioAssociation-array>
<scenarioAssociation> <scenarioAssociation>
<field name="url"> <field name="url">
<String>src/main/webapp/WEB-INF/stylesheets/corpus2groups.xsl</String> <String>src/main/webapp/WEB-INF/stylesheets/db2xhtml.xsl</String>
</field> </field>
<field name="scenarioIds"> <field name="scenarioIds">
<list> <list>
<String>corpus2groups</String> <String>db2xhtml</String>
<String>db2xhtml-soll-haben</String>
</list> </list>
</field> </field>
<field name="scenarioTypes"> <field name="scenarioTypes">
<list> <list>
<String>XML</String> <String>XML</String>
<String>XML</String>
</list> </list>
</field> </field>
</scenarioAssociation> </scenarioAssociation>
...@@ -44,11 +46,11 @@ ...@@ -44,11 +46,11 @@
</scenarioAssociation> </scenarioAssociation>
<scenarioAssociation> <scenarioAssociation>
<field name="url"> <field name="url">
<String>src/main/webapp/WEB-INF/stylesheets/db2xhtml.xsl</String> <String>src/main/webapp/WEB-INF/tei-stylesheets/html/html.xsl</String>
</field> </field>
<field name="scenarioIds"> <field name="scenarioIds">
<list> <list>
<String>db2xhtml</String> <String>epub – Anakreon flat</String>
</list> </list>
</field> </field>
<field name="scenarioTypes"> <field name="scenarioTypes">
...@@ -59,11 +61,11 @@ ...@@ -59,11 +61,11 @@
</scenarioAssociation> </scenarioAssociation>
<scenarioAssociation> <scenarioAssociation>
<field name="url"> <field name="url">
<String>src/main/webapp/WEB-INF/tei-stylesheets/html/html.xsl</String> <String>src/main/webapp/WEB-INF/stylesheets/corpus2groups.xsl</String>
</field> </field>
<field name="scenarioIds"> <field name="scenarioIds">
<list> <list>
<String>epub – Anakreon flat</String> <String>corpus2groups</String>
</list> </list>
</field> </field>
<field name="scenarioTypes"> <field name="scenarioTypes">
...@@ -77,6 +79,89 @@ ...@@ -77,6 +79,89 @@
<entry> <entry>
<String>scenarios</String> <String>scenarios</String>
<scenario-array> <scenario-array>
<scenario>
<field name="advancedOptionsMap">
<null/>
</field>
<field name="name">
<String>corpus2groups</String>
</field>
<field name="baseURL">
<String></String>
</field>
<field name="footerURL">
<String></String>
</field>
<field name="fOPMethod">
<String>pdf</String>
</field>
<field name="fOProcessorName">
<String>Apache FOP</String>
</field>
<field name="headerURL">
<String></String>
</field>
<field name="inputXSLURL">
<String>${pdu}/src/main/webapp/WEB-INF/stylesheets/corpus2groups.xsl</String>
</field>
<field name="inputXMLURL">
<String>${pdu}/Die_Gedichte_Anakreons.jmzg.0.xml</String>
</field>
<field name="defaultScenario">
<Boolean>false</Boolean>
</field>
<field name="isFOPPerforming">
<Boolean>false</Boolean>
</field>
<field name="type">
<String>XML</String>
</field>
<field name="saveAs">
<Boolean>true</Boolean>
</field>
<field name="openInBrowser">
<Boolean>false</Boolean>
</field>
<field name="outputFile">
<File>${pd}/target/anakreon-groups.xml</File>
</field>
<field name="openOtherLocationInBrowser">
<Boolean>false</Boolean>
</field>
<field name="locationToOpenInBrowserURL">
<null/>
</field>
<field name="openInEditor">
<Boolean>true</Boolean>
</field>
<field name="showInHTMLPane">
<Boolean>false</Boolean>
</field>
<field name="showInXMLPane">
<Boolean>true</Boolean>
</field>
<field name="showInSVGPane">
<Boolean>false</Boolean>
</field>
<field name="showInResultSetPane">
<Boolean>false</Boolean>
</field>
<field name="useXSLTInput">
<Boolean>true</Boolean>
</field>
<field name="xsltParams">
<list/>
</field>
<field name="cascadingStylesheets">
<String-array/>
</field>
<field name="xslTransformer">
<String>Saxon-PE</String>
</field>
<field name="extensionURLs">
<String-array/>
</field>
</scenario>
<scenario> <scenario>
<field name="advancedOptionsMap"> <field name="advancedOptionsMap">
<null/> <null/>
...@@ -414,7 +499,7 @@ ...@@ -414,7 +499,7 @@
<null/> <null/>
</field> </field>
<field name="name"> <field name="name">
<String>corpus2groups</String> <String>db2xhtml-soll-haben</String>
</field> </field>
<field name="baseURL"> <field name="baseURL">
<String></String> <String></String>
...@@ -432,10 +517,10 @@ ...@@ -432,10 +517,10 @@
<String></String> <String></String>
</field> </field>
<field name="inputXSLURL"> <field name="inputXSLURL">
<String>${pdu}/src/main/webapp/WEB-INF/stylesheets/corpus2groups.xsl</String> <String>${pdu}/src/main/webapp/WEB-INF/stylesheets/db2xhtml.xsl</String>
</field> </field>
<field name="inputXMLURL"> <field name="inputXMLURL">
<String>${pdu}/Die_Gedichte_Anakreons.jmzg.0.xml</String> <String>${pdu}/src/test/resources/n2kf.0.xml</String>
</field> </field>
<field name="defaultScenario"> <field name="defaultScenario">
<Boolean>false</Boolean> <Boolean>false</Boolean>
...@@ -450,10 +535,10 @@ ...@@ -450,10 +535,10 @@
<Boolean>true</Boolean> <Boolean>true</Boolean>
</field> </field>
<field name="openInBrowser"> <field name="openInBrowser">
<Boolean>false</Boolean> <Boolean>true</Boolean>
</field> </field>
<field name="outputFile"> <field name="outputFile">
<File>${pd}/target/anakreon-groups.xml</File> <File>${pdu}/src/test/resources/n2kf.0.html</File>
</field> </field>
<field name="openOtherLocationInBrowser"> <field name="openOtherLocationInBrowser">
<Boolean>false</Boolean> <Boolean>false</Boolean>
...@@ -462,10 +547,10 @@ ...@@ -462,10 +547,10 @@
<null/> <null/>
</field> </field>
<field name="openInEditor"> <field name="openInEditor">
<Boolean>true</Boolean> <Boolean>false</Boolean>
</field> </field>
<field name="showInHTMLPane"> <field name="showInHTMLPane">
<Boolean>false</Boolean> <Boolean>true</Boolean>
</field> </field>
<field name="showInXMLPane"> <field name="showInXMLPane">
<Boolean>true</Boolean> <Boolean>true</Boolean>
...@@ -494,7 +579,7 @@ ...@@ -494,7 +579,7 @@
</scenario> </scenario>
</scenario-array> </scenario-array>
</entry> </entry>
</map> </serializableOrderedMap>
</serialized> </serialized>
</options> </options>
</meta> </meta>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment