@Override public String getAttachFeatureName() { return layer.getAttachFeature() == null ? null : layer.getAttachFeature().getName(); }
@Override public String getAttachFeatureName() { return getLayer().getAttachFeature() == null ? null : getLayer().getAttachFeature().getName(); }
@Override public String getAttachFeatureName() { return getLayer().getAttachFeature() == null ? null : getLayer().getAttachFeature().getName(); }
@Override protected void onConfigure() { super.onConfigure(); AnnotationLayer layer = LayerDetailForm.this.getModelObject(); // Makes no sense for relation layers or layers that attach to tokens setVisible(!isBlank(layer.getType()) && !RELATION_TYPE.equals(layer.getType()) && !CHAIN_TYPE.equals(layer.getType()) && layer.getAttachFeature() == null); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotationLayer layer = LayerDetailForm.this.getModelObject(); // Makes no sense for layers that attach to tokens setVisible(!isBlank(layer.getType()) && layer.getAttachFeature() == null && !CHAIN_TYPE.equals(layer.getType())); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotationLayer layer = LayerDetailForm.this.getModelObject(); // Makes no sense for relation layers or layers that attach to tokens setVisible(!isBlank(layer.getType()) && !RELATION_TYPE.equals(layer.getType()) && !CHAIN_TYPE.equals(layer.getType()) && layer.getAttachFeature() == null); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotationLayer layer = LayerDetailForm.this.getModelObject(); // Makes no sense for layers that attach to tokens setVisible(!isBlank(layer.getType()) && layer.getAttachFeature() == null && !CHAIN_TYPE.equals(layer.getType())); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotationLayer layer = LayerDetailForm.this.getModelObject(); // Makes no sense for relation layers or layers that attach to tokens setVisible(!isBlank(layer.getType()) && !RELATION_TYPE.equals(layer.getType()) && !CHAIN_TYPE.equals(layer.getType()) && layer.getAttachFeature() == null); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotationLayer layer = LayerDetailForm.this.getModelObject(); // Makes no sense for layers that attach to tokens setVisible(!isBlank(layer.getType()) && layer.getAttachFeature() == null && !CHAIN_TYPE.equals(layer.getType())); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotationLayer layer = LayerDetailForm.this.getModelObject(); // Makes no sense for layers that attach to tokens setVisible(!isBlank(layer.getType()) && layer.getAttachFeature() == null && !CHAIN_TYPE.equals(layer.getType())); } });
@Override protected void onConfigure() { super.onConfigure(); AnnotationLayer layer = LayerDetailForm.this.getModelObject(); // Makes no sense for relation layers or layers that attach to tokens setVisible(!isBlank(layer.getType()) && !RELATION_TYPE.equals(layer.getType()) && !CHAIN_TYPE.equals(layer.getType()) && layer.getAttachFeature() == null); } });
if (layer.getAttachFeature() != null) { layerToExLayers.get(layer).setAttachFeature( new ExportedAnnotationFeatureReference(layer.getAttachFeature()));
if (layer.getAttachFeature() != null) { layerToExLayers.get(layer).setAttachFeature( new ExportedAnnotationFeatureReference(layer.getAttachFeature()));
private void fix(Project aProject, Class<? extends TOP> aLayer, String aLayerType, AnnotationLayer aTokenLayer, String aFeature) { if (annotationSchemaService.existsLayer(aLayer.getName(), aLayerType, aProject)) { AnnotationLayer layer = annotationSchemaService.getLayer(aLayer.getName(), aProject); if (layer.getAttachFeature() == null) { layer.setAttachFeature(annotationSchemaService.getFeature(aFeature, aTokenLayer)); log.info("DATABASE UPGRADE PERFORMED: Fixed attach-feature of layer " + "[{}] ({}) in project [{}] ({})", layer.getUiName(), layer.getId(), aProject.getName(), aProject.getId()); } } } }
private void fix(Project aProject, Class<? extends TOP> aLayer, String aLayerType, AnnotationLayer aTokenLayer, String aFeature) { if (annotationSchemaService.existsLayer(aLayer.getName(), aLayerType, aProject)) { AnnotationLayer layer = annotationSchemaService.getLayer(aLayer.getName(), aProject); if (layer.getAttachFeature() == null) { layer.setAttachFeature(annotationSchemaService.getFeature(aFeature, aTokenLayer)); log.info("DATABASE UPGRADE PERFORMED: Fixed attach-feature of layer " + "[{}] ({}) in project [{}] ({})", layer.getUiName(), layer.getId(), aProject.getName(), aProject.getId()); } } } }
&& layer.getAttachFeature() != null)) { continue; AnnotationFS anno = getFeature(attach, layer.getAttachFeature().getName(), AnnotationFS.class); if (anno != null && nonIndexed.containsKey(anno)) {
private Set<AnnotationFS> getAttachedSpans(AnnotationFS aFs, AnnotationLayer aLayer) { CAS cas = aFs.getCAS(); Set<AnnotationFS> attachedSpans = new HashSet<>(); TypeAdapter adapter = annotationService.getAdapter(aLayer); if (adapter instanceof SpanAdapter && aLayer.getAttachType() != null) { Type spanType = CasUtil.getType(cas, aLayer.getAttachType().getName()); Feature attachFeature = spanType.getFeatureByBaseName(aLayer.getAttachFeature() .getName()); for (AnnotationFS attachedFs : selectAt(cas, spanType, aFs.getBegin(), aFs.getEnd())) { if (isSame(attachedFs.getFeatureValue(attachFeature), aFs)) { attachedSpans.add(attachedFs); } } } return attachedSpans; }
@Override public CreateRelationAnnotationRequest onCreate(RelationAdapter aAdapter, CreateRelationAnnotationRequest aRequest) { if (aAdapter.getLayer().getAttachFeature() == null) { return aRequest; } // FIXME The code below appears to be broken - it basically only works because the only // case were we use the attach-feature is with the Dependency/Token layers and it works // because tokens cannot stack. "selectCovered" below would need to be replaced with // an actual lookup of the annotation pointed to by the attach-feature. final CAS cas = aRequest.getJcas().getCas(); final Type attachType = getType(cas, aAdapter.getLayer().getAttachType().getName()); AnnotationFS originFS = aRequest.getOriginFs(); AnnotationFS targetFS = aRequest.getTargetFs(); targetFS = selectCovered(cas, attachType, targetFS.getBegin(), targetFS.getEnd()).get(0); originFS = selectCovered(cas, attachType, originFS.getBegin(), originFS.getEnd()).get(0); return aRequest.changeRelation(originFS, targetFS); }
@Override public CreateRelationAnnotationRequest onCreate(RelationAdapter aAdapter, CreateRelationAnnotationRequest aRequest) { if (aAdapter.getLayer().getAttachFeature() == null) { return aRequest; } // FIXME The code below appears to be broken - it basically only works because the only // case were we use the attach-feature is with the Dependency/Token layers and it works // because tokens cannot stack. "selectCovered" below would need to be replaced with // an actual lookup of the annotation pointed to by the attach-feature. final CAS cas = aRequest.getJcas().getCas(); final Type attachType = getType(cas, aAdapter.getLayer().getAttachType().getName()); AnnotationFS originFS = aRequest.getOriginFs(); AnnotationFS targetFS = aRequest.getTargetFs(); targetFS = selectCovered(cas, attachType, targetFS.getBegin(), targetFS.getEnd()).get(0); originFS = selectCovered(cas, attachType, originFS.getBegin(), originFS.getEnd()).get(0); return aRequest.changeRelation(originFS, targetFS); }
"Governor", aLayer.getAttachFeature() == null ? null : aLayer .getAttachFeature().getName(), aLayer.getAttachType().getName());