use of de.tudarmstadt.ukp.clarin.webanno.export.model.ExportedAnnotationDocument in project webanno by webanno.
the class AnnotationDocumentExporter method importAnnotationDocuments.
/**
* Create {@link de.tudarmstadt.ukp.clarin.webanno.model.AnnotationDocument} from exported
* {@link ExportedAnnotationDocument}
*
* @param aExProject
* the imported project.
* @param aProject
* the project.
* @throws IOException
* if an I/O error occurs.
*/
private void importAnnotationDocuments(ExportedProject aExProject, Project aProject, Map<String, SourceDocument> aNameToDoc) throws IOException {
for (ExportedAnnotationDocument exAnnotationDocument : aExProject.getAnnotationDocuments()) {
AnnotationDocument annotationDocument = new AnnotationDocument();
annotationDocument.setName(exAnnotationDocument.getName());
annotationDocument.setState(exAnnotationDocument.getState());
annotationDocument.setProject(aProject);
annotationDocument.setUser(exAnnotationDocument.getUser());
annotationDocument.setTimestamp(exAnnotationDocument.getTimestamp());
annotationDocument.setDocument(aNameToDoc.get(exAnnotationDocument.getName()));
annotationDocument.setSentenceAccessed(exAnnotationDocument.getSentenceAccessed());
annotationDocument.setCreated(exAnnotationDocument.getCreated());
annotationDocument.setUpdated(exAnnotationDocument.getUpdated());
documentService.createAnnotationDocument(annotationDocument);
}
}
use of de.tudarmstadt.ukp.clarin.webanno.export.model.ExportedAnnotationDocument in project webanno by webanno.
the class AnnotationDocumentExporter method exportAnnotationDocuments.
private void exportAnnotationDocuments(ProjectExportTaskMonitor aMonitor, Project aProject, ExportedProject aExProject) {
List<ExportedAnnotationDocument> annotationDocuments = new ArrayList<>();
for (AnnotationDocument annotationDocument : documentService.listAnnotationDocuments(aProject)) {
ExportedAnnotationDocument exAnnotationDocument = new ExportedAnnotationDocument();
exAnnotationDocument.setName(annotationDocument.getName());
exAnnotationDocument.setState(annotationDocument.getState());
exAnnotationDocument.setUser(annotationDocument.getUser());
exAnnotationDocument.setTimestamp(annotationDocument.getTimestamp());
exAnnotationDocument.setSentenceAccessed(annotationDocument.getSentenceAccessed());
exAnnotationDocument.setCreated(annotationDocument.getCreated());
exAnnotationDocument.setUpdated(annotationDocument.getUpdated());
annotationDocuments.add(exAnnotationDocument);
}
aExProject.setAnnotationDocuments(annotationDocuments);
}
Aggregations