diff --git a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/AnnotatorJsHtmlAnnotationEditor.java b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/AnnotatorJsHtmlAnnotationEditor.java similarity index 92% rename from inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/AnnotatorJsHtmlAnnotationEditor.java rename to inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/AnnotatorJsHtmlAnnotationEditor.java index 865b4c63d23..a08e1aae4f9 100644 --- a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/AnnotatorJsHtmlAnnotationEditor.java +++ b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/AnnotatorJsHtmlAnnotationEditor.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.tudarmstadt.ukp.inception.htmleditor.annotatorjs; +package de.tudarmstadt.ukp.inception.annotatorjs; import static de.tudarmstadt.ukp.clarin.webanno.support.wicket.ServletContextUtils.referenceToUrl; import static java.util.Arrays.asList; @@ -29,13 +29,13 @@ import de.tudarmstadt.ukp.clarin.webanno.api.CasProvider; import de.tudarmstadt.ukp.clarin.webanno.api.DocumentService; +import de.tudarmstadt.ukp.inception.annotatorjs.resources.AnnotatorJsCssResourceReference; +import de.tudarmstadt.ukp.inception.annotatorjs.resources.AnnotatorJsJavascriptResourceReference; import de.tudarmstadt.ukp.inception.editor.AnnotationEditorFactory; import de.tudarmstadt.ukp.inception.editor.action.AnnotationActionHandler; import de.tudarmstadt.ukp.inception.editor.view.DocumentViewFactory; import de.tudarmstadt.ukp.inception.externaleditor.ExternalAnnotationEditorBase; import de.tudarmstadt.ukp.inception.externaleditor.model.AnnotationEditorProperties; -import de.tudarmstadt.ukp.inception.htmleditor.annotatorjs.resources.AnnotatorJsCssResourceReference; -import de.tudarmstadt.ukp.inception.htmleditor.annotatorjs.resources.AnnotatorJsJavascriptResourceReference; import de.tudarmstadt.ukp.inception.rendering.editorstate.AnnotatorState; public class AnnotatorJsHtmlAnnotationEditor diff --git a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/AnnotatorJsHtmlAnnotationEditorFactory.java b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/AnnotatorJsHtmlAnnotationEditorFactory.java similarity index 90% rename from inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/AnnotatorJsHtmlAnnotationEditorFactory.java rename to inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/AnnotatorJsHtmlAnnotationEditorFactory.java index 0709a52ad78..20a71fddb86 100644 --- a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/AnnotatorJsHtmlAnnotationEditorFactory.java +++ b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/AnnotatorJsHtmlAnnotationEditorFactory.java @@ -15,17 +15,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.tudarmstadt.ukp.inception.htmleditor.annotatorjs; +package de.tudarmstadt.ukp.inception.annotatorjs; import org.apache.wicket.model.IModel; import de.tudarmstadt.ukp.clarin.webanno.api.CasProvider; import de.tudarmstadt.ukp.clarin.webanno.api.annotation.paging.NoPagingStrategy; import de.tudarmstadt.ukp.clarin.webanno.model.Project; +import de.tudarmstadt.ukp.inception.annotatorjs.config.AnnotatorJsAnnotationEditorSupportAutoConfiguration; import de.tudarmstadt.ukp.inception.editor.AnnotationEditorBase; import de.tudarmstadt.ukp.inception.editor.AnnotationEditorFactoryImplBase; import de.tudarmstadt.ukp.inception.editor.action.AnnotationActionHandler; -import de.tudarmstadt.ukp.inception.htmleditor.config.HtmlAnnotationEditorSupportAutoConfiguration; import de.tudarmstadt.ukp.inception.io.html.HtmlFormatSupport; import de.tudarmstadt.ukp.inception.io.html.LegacyHtmlFormatSupport; import de.tudarmstadt.ukp.inception.rendering.editorstate.AnnotatorState; @@ -34,7 +34,7 @@ * Support for HTML-oriented editor component. *
* This class is exposed as a Spring Component via - * {@link HtmlAnnotationEditorSupportAutoConfiguration#htmlAnnotationEditorFactory()}. + * {@link AnnotatorJsAnnotationEditorSupportAutoConfiguration#annotatorJsHtmlAnnotationEditorFactory()}. *
*/ public class AnnotatorJsHtmlAnnotationEditorFactory diff --git a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/config/AnnotatorJsAnnotationEditorSupportAutoConfiguration.java b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/config/AnnotatorJsAnnotationEditorSupportAutoConfiguration.java new file mode 100644 index 00000000000..d78708ce4be --- /dev/null +++ b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/config/AnnotatorJsAnnotationEditorSupportAutoConfiguration.java @@ -0,0 +1,41 @@ +/* + * 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.annotatorjs.config; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import de.tudarmstadt.ukp.inception.annotatorjs.AnnotatorJsHtmlAnnotationEditorFactory; + +/** + * Provides support for an AnnotatorJS-based HTML-oriented annotation editor. + */ +@ConditionalOnWebApplication +@Configuration +public class AnnotatorJsAnnotationEditorSupportAutoConfiguration +{ + @ConditionalOnProperty(prefix = "ui.html-annotatorjs", name = "enabled", // + havingValue = "true", matchIfMissing = false) + @Bean + public AnnotatorJsHtmlAnnotationEditorFactory annotatorJsHtmlAnnotationEditorFactory() + { + return new AnnotatorJsHtmlAnnotationEditorFactory(); + } +} diff --git a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/resources/AnnotatorJsCssResourceReference.java b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/resources/AnnotatorJsCssResourceReference.java similarity index 95% rename from inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/resources/AnnotatorJsCssResourceReference.java rename to inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/resources/AnnotatorJsCssResourceReference.java index e2f0cf22566..2acf2788b83 100644 --- a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/resources/AnnotatorJsCssResourceReference.java +++ b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/resources/AnnotatorJsCssResourceReference.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.tudarmstadt.ukp.inception.htmleditor.annotatorjs.resources; +package de.tudarmstadt.ukp.inception.annotatorjs.resources; import org.apache.wicket.request.resource.CssResourceReference; diff --git a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/resources/AnnotatorJsJavascriptResourceReference.java b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/resources/AnnotatorJsJavascriptResourceReference.java similarity index 95% rename from inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/resources/AnnotatorJsJavascriptResourceReference.java rename to inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/resources/AnnotatorJsJavascriptResourceReference.java index 97d74b0c8a6..335de1f40bd 100644 --- a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/annotatorjs/resources/AnnotatorJsJavascriptResourceReference.java +++ b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/annotatorjs/resources/AnnotatorJsJavascriptResourceReference.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package de.tudarmstadt.ukp.inception.htmleditor.annotatorjs.resources; +package de.tudarmstadt.ukp.inception.annotatorjs.resources; import org.apache.wicket.request.resource.JavaScriptResourceReference; diff --git a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/config/HtmlAnnotationEditorSupportAutoConfiguration.java b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/config/HtmlAnnotationEditorSupportAutoConfiguration.java index 1743ca68790..30223c3884f 100644 --- a/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/config/HtmlAnnotationEditorSupportAutoConfiguration.java +++ b/inception/inception-html-editor/src/main/java/de/tudarmstadt/ukp/inception/htmleditor/config/HtmlAnnotationEditorSupportAutoConfiguration.java @@ -22,7 +22,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import de.tudarmstadt.ukp.inception.htmleditor.annotatorjs.AnnotatorJsHtmlAnnotationEditorFactory; import de.tudarmstadt.ukp.inception.htmleditor.docview.HtmlDocumentIFrameViewFactory; /** @@ -32,14 +31,6 @@ @Configuration public class HtmlAnnotationEditorSupportAutoConfiguration { - @ConditionalOnProperty(prefix = "ui.html-annotatorjs", name = "enabled", // - havingValue = "true", matchIfMissing = false) - @Bean - public AnnotatorJsHtmlAnnotationEditorFactory htmlAnnotationEditorFactory() - { - return new AnnotatorJsHtmlAnnotationEditorFactory(); - } - @ConditionalOnProperty(prefix = "ui.html.legacy-iframe-view", name = "enabled", // havingValue = "true", matchIfMissing = false) @Bean diff --git a/inception/inception-html-editor/src/main/resources/META-INF/spring.factories b/inception/inception-html-editor/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 570a3788e5c..00000000000 --- a/inception/inception-html-editor/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -de.tudarmstadt.ukp.inception.htmleditor.config.HtmlAnnotationEditorSupportAutoConfiguration diff --git a/inception/inception-html-editor/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/inception/inception-html-editor/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 00000000000..261336c504f --- /dev/null +++ b/inception/inception-html-editor/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,2 @@ +de.tudarmstadt.ukp.inception.htmleditor.config.HtmlAnnotationEditorSupportAutoConfiguration +de.tudarmstadt.ukp.inception.annotatorjs.config.AnnotatorJsAnnotationEditorSupportAutoConfiguration