use of eu.transkribus.core.model.beans.EdFeature in project TranskribusCore by Transkribus.
the class TrpTxtBuilder method addTitlePage.
public static void addTitlePage(TrpDoc doc, File file) {
List<String> titleContent = new ArrayList<String>();
titleContent.add("----------------------------");
titleContent.add("Metadata section of document");
titleContent.add("----------------------------");
TrpDocMetadata docMd = doc.getMd();
titleContent.add("Title: " + docMd.getTitle());
titleContent.add("Author: " + docMd.getAuthor());
titleContent.add("Description: " + docMd.getDesc());
titleContent.add("Genre: " + docMd.getGenre());
titleContent.add("Writer: " + docMd.getWriter());
if (docMd.getScriptType() != null) {
titleContent.add("Sripttype: " + docMd.getScriptType().toString());
}
titleContent.add("Language: " + docMd.getLanguage());
titleContent.add("Number of Pages in whole Document: " + String.valueOf(docMd.getNrOfPages()));
if (docMd.getCreatedFromDate() != null) {
titleContent.add("Created From: " + docMd.getCreatedFromDate().toString());
}
if (docMd.getCreatedToDate() != null) {
titleContent.add("Created To: " + docMd.getCreatedToDate().toString());
}
titleContent.add("Editorial Declaration: ");
for (EdFeature edfeat : doc.getEdDeclList()) {
titleContent.add(edfeat.getTitle() + ": " + edfeat.getDescription() + System.lineSeparator() + edfeat.getSelectedOption().toString());
}
titleContent.add("-----------------------");
titleContent.add("End of metadata section");
titleContent.add("-----------------------");
titleContent.add(System.lineSeparator());
try {
Files.write(Paths.get(file.getAbsolutePath()), titleContent, utf8, StandardOpenOption.CREATE, StandardOpenOption.APPEND);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Aggregations