Search in sources :

Example 1 with DocumentUploadDescriptor

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

the class TrpDocUploadBuilder method build.

public static DocumentUploadDescriptor build(TrpDoc doc) {
    if (doc == null) {
        throw new IllegalArgumentException("doc is null.");
    }
    if (doc.getMd().getLocalFolder() == null) {
        throw new IllegalArgumentException("doc is no localdocument.");
    }
    if (doc.getNPages() < 1) {
        throw new IllegalArgumentException("doc has no pages.");
    }
    DocumentUploadDescriptor s = new DocumentUploadDescriptor();
    s.setMd(doc.getMd());
    for (TrpPage p : doc.getPages()) {
        s.getPages().add(buildPageUploadDescriptor(p));
    }
    return s;
}
Also used : TrpPage(eu.transkribus.core.model.beans.TrpPage) DocumentUploadDescriptor(eu.transkribus.core.model.beans.DocumentUploadDescriptor)

Aggregations

DocumentUploadDescriptor (eu.transkribus.core.model.beans.DocumentUploadDescriptor)1 TrpPage (eu.transkribus.core.model.beans.TrpPage)1