Search in sources :

Example 16 with TrpDocMetadata

use of eu.transkribus.core.model.beans.TrpDocMetadata in project TranskribusCore by Transkribus.

the class FakeDocProvider method create.

public static TrpDoc create(boolean useLocalFiles) {
    final int docid = 1;
    // initialize pageNum here so it can be set in docMd
    nrOfPages = useLocalFiles ? localFileUrls.size() : fileKeys.size();
    // set up a TrpDoc
    TrpDoc doc = new TrpDoc();
    TrpDocMetadata md = createDocMd(docid);
    doc.setMd(md);
    // set up the pages
    // List<TrpPage> pages = new ArrayList<>(nrOfPages);
    TrpPage page;
    for (int i = 0; i < nrOfPages; i++) {
        page = createPage(docid, i, useLocalFiles);
        doc.addPage(page);
    // pages.add(page);
    }
    return doc;
}
Also used : TrpPage(eu.transkribus.core.model.beans.TrpPage) TrpDoc(eu.transkribus.core.model.beans.TrpDoc) TrpDocMetadata(eu.transkribus.core.model.beans.TrpDocMetadata)

Aggregations

TrpDocMetadata (eu.transkribus.core.model.beans.TrpDocMetadata)16 File (java.io.File)7 IOException (java.io.IOException)7 TrpDoc (eu.transkribus.core.model.beans.TrpDoc)6 TrpPage (eu.transkribus.core.model.beans.TrpPage)5 EdFeature (eu.transkribus.core.model.beans.EdFeature)4 FileNotFoundException (java.io.FileNotFoundException)3 Date (java.util.Date)3 JAXBException (javax.xml.bind.JAXBException)3 CorruptImageException (eu.transkribus.core.exceptions.CorruptImageException)2 AmdSecType (eu.transkribus.core.model.beans.mets.AmdSecType)2 MdSecType (eu.transkribus.core.model.beans.mets.MdSecType)2 Mets (eu.transkribus.core.model.beans.mets.Mets)2 Dimension (java.awt.Dimension)2 SimpleDateFormat (java.text.SimpleDateFormat)2 ArrayList (java.util.ArrayList)2 PdfContentByte (com.itextpdf.text.pdf.PdfContentByte)1 XmlFormat (eu.transkribus.core.io.formats.XmlFormat)1 MdFileFilter (eu.transkribus.core.io.util.MdFileFilter)1 PageUploadDescriptor (eu.transkribus.core.model.beans.DocumentUploadDescriptor.PageUploadDescriptor)1