template.setResult("---"); AnnotationLayer trainingLayer = annotationService .getLayer(exTemplate.getTrainFeature().getLayer(), aProject); AnnotationFeature trainingFeature = annotationService .getFeature(exTemplate.getTrainFeature().getName(), trainingLayer); if (exTemplate.getOtherFeatures() != null) { for (ExportedAnnotationFeatureReference other : exTemplate.getOtherFeatures()) { AnnotationLayer layer = annotationService.getLayer(other.getLayer(), aProject); AnnotationFeature feature = annotationService.getFeature(other.getName(), layer);
private void importTrainingDocuments(ExportedProject aExProject, Project aProject) throws IOException { ExportedTrainingDocument[] trainingDocuments = aExProject .getArrayProperty(TRAINING_DOCUMENTS, ExportedTrainingDocument.class); for (ExportedTrainingDocument importedTrainingDocument : trainingDocuments) { TrainingDocument trainingDocument = new TrainingDocument(); trainingDocument.setFormat(importedTrainingDocument.getFormat()); trainingDocument.setName(importedTrainingDocument.getName()); trainingDocument.setState(importedTrainingDocument.getState()); trainingDocument.setProject(aProject); trainingDocument.setTimestamp(importedTrainingDocument.getTimestamp()); trainingDocument.setSentenceAccessed(importedTrainingDocument.getSentenceAccessed()); if (importedTrainingDocument.getFeature() != null) { AnnotationLayer trainingLayer = annotationService .getLayer(importedTrainingDocument.getFeature().getLayer(), aProject); AnnotationFeature trainingFeature = annotationService .getFeature(importedTrainingDocument.getFeature().getName(), trainingLayer); trainingDocument.setFeature(trainingFeature); } automationService.createTrainingDocument(trainingDocument); } }