exLayer.getAttachType().getName(), project); AnnotationFeature attachFeature = annotationService .getFeature(exLayer.getAttachFeature().getName(), attachLayer); layer.setAttachFeature(attachFeature);
new ExportedAnnotationFeatureReference(layer.getAttachFeature()));
template.setResult("---"); AnnotationLayer trainingLayer = annotationService .getLayer(exTemplate.getTrainFeature().getLayer(), aProject); AnnotationFeature trainingFeature = annotationService .getFeature(exTemplate.getTrainFeature().getName(), trainingLayer); template.setTrainFeature(trainingFeature); Set<AnnotationFeature> otherFeatures = new HashSet<>(); if (exTemplate.getOtherFeatures() != null) { for (ExportedAnnotationFeatureReference other : exTemplate.getOtherFeatures()) { AnnotationLayer layer = annotationService.getLayer(other.getLayer(), aProject); AnnotationFeature feature = annotationService.getFeature(other.getName(), layer); otherFeatures.add(feature);
exLayer.getAttachType().getName(), project); AnnotationFeature attachFeature = annotationService .getFeature(exLayer.getAttachFeature().getName(), attachLayer); layer.setAttachFeature(attachFeature);
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); } }
new ExportedAnnotationFeatureReference(layer.getAttachFeature()));
if (exLayer.getAttachFeature() != null) { AnnotationFeature attachFeature = annotationService .getFeature(exLayer.getAttachFeature().getName(), attachLayer); layer.setAttachFeature(attachFeature);
@Override public void exportData(ProjectExportRequest aRequest, ExportedProject aExProject, File aStage) throws Exception { List<ExportedMiraTemplate> exTemplates = new ArrayList<>(); for (MiraTemplate template : automationService.listMiraTemplates(aRequest.getProject())) { ExportedMiraTemplate exTemplate = new ExportedMiraTemplate(); exTemplate.setAnnotateAndPredict(template.isAnnotateAndRepeat()); exTemplate.setAutomationStarted(template.isAutomationStarted()); exTemplate.setCurrentLayer(template.isCurrentLayer()); exTemplate.setResult(template.getResult()); exTemplate.setTrainFeature( new ExportedAnnotationFeatureReference(template.getTrainFeature())); if (template.getOtherFeatures().size() > 0) { Set<ExportedAnnotationFeatureReference> exOtherFeatures = new HashSet<>(); for (AnnotationFeature feature : template.getOtherFeatures()) { exOtherFeatures.add(new ExportedAnnotationFeatureReference(feature)); } exTemplate.setOtherFeatures(exOtherFeatures); } exTemplates.add(exTemplate); } aExProject.setProperty(MIRA_TEMPLATES, exTemplates); }
if (exLayer.getAttachFeature() != null) { AnnotationFeature attachFeature = annotationService .getFeature(exLayer.getAttachFeature().getName(), attachLayer); layer.setAttachFeature(attachFeature);
private void exportTrainingDocuments(Project aProject, ExportedProject aExProject) { List<ExportedTrainingDocument> trainDocuments = new ArrayList<>(); List<TrainingDocument> trainingDocuments = automationService .listTrainingDocuments(aProject); for (TrainingDocument trainingDocument : trainingDocuments) { ExportedTrainingDocument exDocument = new ExportedTrainingDocument(); exDocument.setFormat(trainingDocument.getFormat()); exDocument.setName(trainingDocument.getName()); exDocument.setState(trainingDocument.getState()); exDocument.setTimestamp(trainingDocument.getTimestamp()); exDocument.setSentenceAccessed(trainingDocument.getSentenceAccessed()); // During imported, we only really use the name of the feature to look up the // actual AnnotationFeature in the project if (trainingDocument.getFeature() != null) { exDocument.setFeature( new ExportedAnnotationFeatureReference(trainingDocument.getFeature())); } trainDocuments.add(exDocument); } aExProject.setProperty(TRAINING_DOCUMENTS, trainDocuments); }