diff --git a/inception/inception-layer-docmetadata/pom.xml b/inception/inception-layer-docmetadata/pom.xml index 3c5552b55c9..c26ace1f5e3 100644 --- a/inception/inception-layer-docmetadata/pom.xml +++ b/inception/inception-layer-docmetadata/pom.xml @@ -73,6 +73,10 @@ de.tudarmstadt.ukp.inception.app inception-recommendation-api + + de.tudarmstadt.ukp.inception.app + inception-recommendation + org.apache.uima diff --git a/inception/inception-layer-docmetadata/src/main/java/de/tudarmstadt/ukp/inception/ui/core/docanno/config/DocumentMetadataLayerSupportAutoConfiguration.java b/inception/inception-layer-docmetadata/src/main/java/de/tudarmstadt/ukp/inception/ui/core/docanno/config/DocumentMetadataLayerSupportAutoConfiguration.java index dbbf7eea046..679761f9af5 100644 --- a/inception/inception-layer-docmetadata/src/main/java/de/tudarmstadt/ukp/inception/ui/core/docanno/config/DocumentMetadataLayerSupportAutoConfiguration.java +++ b/inception/inception-layer-docmetadata/src/main/java/de/tudarmstadt/ukp/inception/ui/core/docanno/config/DocumentMetadataLayerSupportAutoConfiguration.java @@ -17,6 +17,8 @@ */ package de.tudarmstadt.ukp.inception.ui.core.docanno.config; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationEventPublisher; @@ -26,6 +28,7 @@ import de.tudarmstadt.ukp.inception.documents.api.DocumentService; import de.tudarmstadt.ukp.inception.recommendation.api.LearningRecordService; import de.tudarmstadt.ukp.inception.recommendation.api.RecommendationService; +import de.tudarmstadt.ukp.inception.recommendation.config.RecommenderServiceAutoConfiguration; import de.tudarmstadt.ukp.inception.schema.api.AnnotationSchemaService; import de.tudarmstadt.ukp.inception.schema.api.feature.FeatureSupportRegistry; import de.tudarmstadt.ukp.inception.schema.api.layer.LayerSupportRegistry; @@ -40,6 +43,7 @@ * Provides support for document-level annotations. */ @Configuration +@AutoConfigureAfter(RecommenderServiceAutoConfiguration.class) @EnableConfigurationProperties(DocumentMetadataLayerSupportPropertiesImpl.class) public class DocumentMetadataLayerSupportAutoConfiguration { @@ -85,6 +89,7 @@ public DocumentMetadataAnnotationActionUndoSupport documentMetadataAnnotationAct @Bean @ConditionalOnProperty(prefix = "documentmetadata", name = "enabled", havingValue = "true", matchIfMissing = true) + @ConditionalOnBean(RecommendationService.class) public MetadataSuggestionSupport metadataSuggestionSupport( RecommendationService aRecommendationService, LearningRecordService aLearningRecordService, diff --git a/inception/inception-recommendation/pom.xml b/inception/inception-recommendation/pom.xml index 8e0bb356ae4..29d11751bef 100644 --- a/inception/inception-recommendation/pom.xml +++ b/inception/inception-recommendation/pom.xml @@ -129,10 +129,6 @@ de.tudarmstadt.ukp.inception.app inception-support-bootstrap - - de.tudarmstadt.ukp.inception.app - inception-layer-docmetadata - org.dkpro.core diff --git a/inception/inception-recommendation/src/main/java/de/tudarmstadt/ukp/inception/recommendation/project/RecommenderEditorPanel.java b/inception/inception-recommendation/src/main/java/de/tudarmstadt/ukp/inception/recommendation/project/RecommenderEditorPanel.java index ce2a39b0110..6b43f083dbb 100644 --- a/inception/inception-recommendation/src/main/java/de/tudarmstadt/ukp/inception/recommendation/project/RecommenderEditorPanel.java +++ b/inception/inception-recommendation/src/main/java/de/tudarmstadt/ukp/inception/recommendation/project/RecommenderEditorPanel.java @@ -60,8 +60,7 @@ import de.tudarmstadt.ukp.clarin.webanno.security.UserDao; import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence; import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token; -import de.tudarmstadt.ukp.inception.annotation.layer.relation.RelationLayerSupport; -import de.tudarmstadt.ukp.inception.annotation.layer.span.SpanLayerSupport; +import de.tudarmstadt.ukp.inception.annotation.layer.chain.ChainLayerSupport; import de.tudarmstadt.ukp.inception.recommendation.api.RecommendationService; import de.tudarmstadt.ukp.inception.recommendation.api.RecommenderFactoryRegistry; import de.tudarmstadt.ukp.inception.recommendation.api.model.Recommender; @@ -73,7 +72,6 @@ import de.tudarmstadt.ukp.inception.support.lambda.LambdaModelAdapter; import de.tudarmstadt.ukp.inception.support.spring.ApplicationEventPublisherHolder; import de.tudarmstadt.ukp.inception.support.wicket.ModelChangedVisitor; -import de.tudarmstadt.ukp.inception.ui.core.docanno.layer.DocumentMetadataLayerSupport; public class RecommenderEditorPanel extends Panel @@ -408,11 +406,9 @@ protected void onModelChanged() private List listLayers() { return annotationSchemaService.listAnnotationLayer(projectModel.getObject()).stream() // - .filter(layer -> (SpanLayerSupport.TYPE.equals(layer.getType()) - || RelationLayerSupport.TYPE.equals(layer.getType()) // - || DocumentMetadataLayerSupport.TYPE.equals(layer.getType())) // - && !(Token._TypeName.equals(layer.getName()) - || Sentence._TypeName.equals(layer.getName()))) + .filter(layer -> !ChainLayerSupport.TYPE.equals(layer.getType()) && // + !Token._TypeName.equals(layer.getName()) && // + !Sentence._TypeName.equals(layer.getName())) .toList(); }