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