Skip to content
Snippets Groups Projects
Commit 358f39ae authored by Thorsten Vitt's avatar Thorsten Vitt
Browse files

Flat corpus support (currently req'd for EPUB)

parent ab48a34c
Branches
Tags
No related merge requests found
...@@ -35,6 +35,7 @@ public abstract class CorpusBasedExporter extends AbstractExporter { ...@@ -35,6 +35,7 @@ public abstract class CorpusBasedExporter extends AbstractExporter {
protected boolean readStylesheetPI = false; protected boolean readStylesheetPI = false;
private InputSupplier<? extends InputStream> sourceBuffer = null; private InputSupplier<? extends InputStream> sourceBuffer = null;
private IBufferFactory bufferFactory = new FBBAOSBufferFactory(); private IBufferFactory bufferFactory = new FBBAOSBufferFactory();
private boolean flatCorpus = false;
public CorpusBasedExporter(final ITextGridRep repository, public CorpusBasedExporter(final ITextGridRep repository,
final Request request, final String uriList) { final Request request, final String uriList) {
...@@ -128,7 +129,7 @@ protected Source loadSource(final boolean bufferRequired) ...@@ -128,7 +129,7 @@ protected Source loadSource(final boolean bufferRequired)
if (sourceType == SourceType.AGGREGATION if (sourceType == SourceType.AGGREGATION
|| sourceType == SourceType.BASKET) { || sourceType == SourceType.BASKET) {
final TEICorpusSerializer corpusSerializer = final TEICorpusSerializer corpusSerializer =
new TEICorpusSerializer(getRootObjects(), false, getSid().orNull()); new TEICorpusSerializer(getRootObjects(), isFlatCorpus(), getSid().orNull());
final OutputStream corpusBuffer = getBufferFactory().getBufferSink(); final OutputStream corpusBuffer = getBufferFactory().getBufferSink();
corpusSerializer.write(corpusBuffer); corpusSerializer.write(corpusBuffer);
corpusBuffer.close(); corpusBuffer.close();
...@@ -158,4 +159,12 @@ protected void setBufferFactory(final IBufferFactory bufferFactory) { ...@@ -158,4 +159,12 @@ protected void setBufferFactory(final IBufferFactory bufferFactory) {
this.bufferFactory = bufferFactory; this.bufferFactory = bufferFactory;
} }
public boolean isFlatCorpus() {
return flatCorpus;
}
public void setFlatCorpus(final boolean flatCorpus) {
this.flatCorpus = flatCorpus;
}
} }
\ No newline at end of file
...@@ -62,6 +62,7 @@ public EPUBSerializer(final ITextGridRep repository, ...@@ -62,6 +62,7 @@ public EPUBSerializer(final ITextGridRep repository,
this.sid = sid; this.sid = sid;
setMediaType("application/epub+zip"); setMediaType("application/epub+zip");
setFileExtension("epub"); setFileExtension("epub");
setFlatCorpus(true);
} }
public void setStylesheet(final URI stylesheet) { public void setStylesheet(final URI stylesheet) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment