Skip to content

Commit

Permalink
#4240 - Facilitate using DIAM serializer in isolation
Browse files Browse the repository at this point in the history
- Introduce new DIAM serializer and API modules
  • Loading branch information
reckart committed Oct 10, 2023
1 parent f9b43e9 commit 1417773
Show file tree
Hide file tree
Showing 38 changed files with 796 additions and 16 deletions.
4 changes: 4 additions & 0 deletions inception/inception-api-render/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.tudarmstadt.ukp.inception.schema.config;
package de.tudarmstadt.ukp.inception.rendering.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.jmx.export.annotation.ManagedAttribute;
import org.springframework.jmx.export.annotation.ManagedResource;

import de.tudarmstadt.ukp.inception.rendering.config.AnnotationEditorProperties;

/**
* <p>
* This class is exposed as a Spring Component via {@code AnnotationSchemaServiceAutoConfiguration}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
Expand All @@ -33,6 +34,8 @@
import de.tudarmstadt.ukp.inception.rendering.vmodel.serialization.VDocumentSerializerExtensionPoint;
import de.tudarmstadt.ukp.inception.rendering.vmodel.serialization.VDocumentSerializerExtensionPointImpl;

@EnableConfigurationProperties({ //
AnnotationEditorPropertiesImpl.class })
@Configuration
public class RenderingAutoConfig
{
Expand Down
10 changes: 10 additions & 0 deletions inception/inception-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,16 @@
<artifactId>inception-diam</artifactId>
<version>30.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-api-diam</artifactId>
<version>30.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-diam-compactv2</artifactId>
<version>30.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-diam-editor</artifactId>
Expand Down
292 changes: 292 additions & 0 deletions inception/inception-diam-api/LICENSE.txt

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions inception/inception-diam-api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Technische Universität Darmstadt under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The Technische Universität Darmstadt
licenses this file to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>inception-app</artifactId>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<version>30.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>inception-api-diam</artifactId>
<name>INCEpTION - DIAM - API</name>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
</dependencies>
</project>
292 changes: 292 additions & 0 deletions inception/inception-diam-compactv2/LICENSE.txt

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions inception/inception-diam-compactv2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Technische Universität Darmstadt under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The Technische Universität Darmstadt
licenses this file to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>inception-app</artifactId>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<version>30.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>inception-diam-compactv2</artifactId>
<name>INCEpTION - DIAM - Compact Serialization v2</name>
<dependencies>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-api-diam</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-api-render</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-support</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-model</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>

<dependency>
<groupId>org.dkpro.core</groupId>
<artifactId>dkpro-core-api-segmentation-asl</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer;
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.diam.editor.config.DiamAutoConfig;
import de.tudarmstadt.ukp.inception.diam.model.compactv2.config.DiamCompactV2AutoConfig;
import de.tudarmstadt.ukp.inception.rendering.config.AnnotationEditorProperties;
import de.tudarmstadt.ukp.inception.rendering.request.RenderRequest;
import de.tudarmstadt.ukp.inception.rendering.vmodel.VAnnotationMarker;
Expand All @@ -44,7 +44,7 @@

/**
* <p>
* This class is exposed as a Spring Component via {@link DiamAutoConfig#compactSerializerV2}.
* This class is exposed as a Spring Component via {@link DiamCompactV2AutoConfig#compactSerializerV2}.
* </p>
*/
public class CompactSerializerV2Impl
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Licensed to the Technische Universität Darmstadt under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The Technische Universität Darmstadt
* licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.tudarmstadt.ukp.inception.diam.model.compactv2.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import de.tudarmstadt.ukp.inception.diam.model.compactv2.CompactSerializerV2;
import de.tudarmstadt.ukp.inception.diam.model.compactv2.CompactSerializerV2Impl;
import de.tudarmstadt.ukp.inception.rendering.config.AnnotationEditorProperties;

@Configuration
public class DiamCompactV2AutoConfig
{
@Bean
public CompactSerializerV2 compactSerializerV2(AnnotationEditorProperties aProperties)
{
return new CompactSerializerV2Impl(aProperties);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
de.tudarmstadt.ukp.inception.diam.model.compactv2.config.DiamCompactV2AutoConfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer;
import de.tudarmstadt.ukp.clarin.webanno.support.JSONUtil;
import de.tudarmstadt.ukp.clarin.webanno.support.WebAnnoConst;
import de.tudarmstadt.ukp.inception.rendering.config.AnnotationEditorPropertiesImpl;
import de.tudarmstadt.ukp.inception.rendering.request.RenderRequest;
import de.tudarmstadt.ukp.inception.rendering.vmodel.VAnnotationMarker;
import de.tudarmstadt.ukp.inception.rendering.vmodel.VArc;
Expand All @@ -38,7 +39,6 @@
import de.tudarmstadt.ukp.inception.rendering.vmodel.VRange;
import de.tudarmstadt.ukp.inception.rendering.vmodel.VSpan;
import de.tudarmstadt.ukp.inception.rendering.vmodel.VTextMarker;
import de.tudarmstadt.ukp.inception.schema.config.AnnotationEditorPropertiesImpl;

public class CompactSerializerV2ImplTest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="ConsoleAppender" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %level{length=5} %logger{1} - %msg%n" />
</Console>
</Appenders>

<Loggers>
<!-- <Logger name="de.tudarmstadt.ukp.inception.diam" level="TRACE"/> -->
<!-- <Logger name="org.springframework.messaging" level="TRACE"/> -->
<!-- <Logger name="org.springframework.web.socket.messaging" level="TRACE"/> -->
<!-- If there are exceptions during authorization, increase the StompSubProtocolHandler log level! -->
<!-- <Logger name="org.springframework.web.socket.messaging.StompSubProtocolHandler" level="DEBUG"/> -->
<!-- <Logger name="de.tudarmstadt.ukp.clarin.webanno.security.ExtensiblePermissionEvaluator" level="TRACE"/> -->
<!-- <Logger name="org.springframework.security" level="TRACE" /> -->

<Root level="WARN">
<AppenderRef ref="ConsoleAppender" />
</Root>
</Loggers>
</Configuration>
4 changes: 4 additions & 0 deletions inception/inception-diam-editor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-diam</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-diam-compactv2</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-ui-annotation</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions inception/inception-diam/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-api</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-api-diam</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-api-editor</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
import de.tudarmstadt.ukp.inception.diam.editor.lazydetails.LazyDetailsLookupServiceImpl;
import de.tudarmstadt.ukp.inception.diam.model.compact.CompactSerializer;
import de.tudarmstadt.ukp.inception.diam.model.compact.CompactSerializerImpl;
import de.tudarmstadt.ukp.inception.diam.model.compactv2.CompactSerializerV2;
import de.tudarmstadt.ukp.inception.diam.model.compactv2.CompactSerializerV2Impl;
import de.tudarmstadt.ukp.inception.editor.AnnotationEditorExtensionRegistry;
import de.tudarmstadt.ukp.inception.preferences.ClientSiderUserPreferencesProviderRegistry;
import de.tudarmstadt.ukp.inception.preferences.PreferencesService;
Expand Down Expand Up @@ -163,12 +161,6 @@ public CompactSerializer compactSerializer(AnnotationEditorProperties aPropertie
return new CompactSerializerImpl(aProperties);
}

@Bean
public CompactSerializerV2 compactSerializerV2(AnnotationEditorProperties aProperties)
{
return new CompactSerializerV2Impl(aProperties);
}

@Bean
public LoadPreferences loadPreferences(UserDao aUserService,
PreferencesService aPreferencesService)
Expand Down
4 changes: 4 additions & 0 deletions inception/inception-external-editor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-diam</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-diam-compactv2</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-preferences</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@
@Configuration
@EnableConfigurationProperties({ //
StringFeatureSupportPropertiesImpl.class, //
LinkFeatureSupportPropertiesImpl.class, //
AnnotationEditorPropertiesImpl.class })
LinkFeatureSupportPropertiesImpl.class })
public class AnnotationSchemaServiceAutoConfiguration
{
private @PersistenceContext EntityManager entityManager;
Expand Down
2 changes: 2 additions & 0 deletions inception/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@
<module>inception-concept-linking</module>
<!-- Editor extensions -->
<module>inception-brat-editor</module>
<module>inception-diam-api</module>
<module>inception-diam</module>
<module>inception-diam-compactv2</module>
<module>inception-diam-editor</module>
<module>inception-external-editor</module>
<module>inception-html-editor</module>
Expand Down

0 comments on commit 1417773

Please sign in to comment.