if (layer.getAttachType() != null) { layerToExLayers.get(layer).setAttachType( new ExportedAnnotationLayerReference(layer.getAttachType().getName()));
ExportedAnnotationLayer exLayer = exLayersMap.get(layer.getName()); if (exLayer.getAttachType() != null) { layer.setAttachType(layersMap.get(exLayer.getAttachType().getName())); exLayer.getAttachType().getName(), project); AnnotationFeature attachFeature = annotationService .getFeature(exLayer.getAttachFeature().getName(), attachLayer);
if (layer.getAttachType() != null) { layerToExLayers.get(layer).setAttachType( new ExportedAnnotationLayerReference(layer.getAttachType().getName()));
ExportedAnnotationLayer exLayer = exLayersMap.get(layer.getName()); if (exLayer.getAttachType() != null) { layer.setAttachType(layersMap.get(exLayer.getAttachType().getName())); exLayer.getAttachType().getName(), project); AnnotationFeature attachFeature = annotationService .getFeature(exLayer.getAttachFeature().getName(), attachLayer);
private IResourceStream exportLayerJson() { try { AnnotationLayer layer = getModelObject(); List<ExportedAnnotationLayer> exLayers = new ArrayList<>(); ExportedAnnotationLayer exMainLayer = ImportUtil.exportLayerDetails(null, null, layer, annotationService); exLayers.add(exMainLayer); // If the layer is attached to another layer, then we also have to export // that, otherwise we would be missing it during re-import. if (layer.getAttachType() != null) { AnnotationLayer attachLayer = layer.getAttachType(); ExportedAnnotationLayer exAttachLayer = ImportUtil.exportLayerDetails(null, null, attachLayer, annotationService); exMainLayer.setAttachType( new ExportedAnnotationLayerReference(exAttachLayer.getName())); exLayers.add(exAttachLayer); } return new InputStreamResourceStream(new ByteArrayInputStream( JSONUtil.toPrettyJsonString(exLayers).getBytes("UTF-8"))); } catch (Exception e) { error("Unable to generate the JSON file: " + ExceptionUtils.getRootCauseMessage(e)); ProjectLayersPanel.LOG.error("Unable to generate the JSON file", e); RequestCycle.get().find(IPartialPageRequestHandler.class) .ifPresent(handler -> handler.addChildren(getPage(), IFeedback.class)); return null; } }
AnnotationLayer layer = annotationService.getLayer(exLayer.getName(), aProject); AnnotationLayer attachLayer = annotationService.getLayer(exLayer.getAttachType() .getName(), aProject); layer.setAttachType(attachLayer); if (exLayer.getAttachFeature() != null) {
private IResourceStream exportLayerJson() { try { AnnotationLayer layer = getModelObject(); List<ExportedAnnotationLayer> exLayers = new ArrayList<>(); ExportedAnnotationLayer exMainLayer = ImportUtil.exportLayerDetails(null, null, layer, annotationService); exLayers.add(exMainLayer); // If the layer is attached to another layer, then we also have to export // that, otherwise we would be missing it during re-import. if (layer.getAttachType() != null) { AnnotationLayer attachLayer = layer.getAttachType(); ExportedAnnotationLayer exAttachLayer = ImportUtil.exportLayerDetails(null, null, attachLayer, annotationService); exMainLayer.setAttachType( new ExportedAnnotationLayerReference(exAttachLayer.getName())); exLayers.add(exAttachLayer); } return new InputStreamResourceStream(new ByteArrayInputStream( JSONUtil.toPrettyJsonString(exLayers).getBytes("UTF-8"))); } catch (Exception e) { error("Unable to generate the JSON file: " + ExceptionUtils.getRootCauseMessage(e)); ProjectLayersPanel.LOG.error("Unable to generate the JSON file", e); RequestCycle.get().find(IPartialPageRequestHandler.class) .ifPresent(handler -> handler.addChildren(getPage(), IFeedback.class)); return null; } }
AnnotationLayer layer = annotationService.getLayer(exLayer.getName(), aProject); AnnotationLayer attachLayer = annotationService.getLayer(exLayer.getAttachType() .getName(), aProject); layer.setAttachType(attachLayer); if (exLayer.getAttachFeature() != null) {