Skip to content

Commit

Permalink
Merge pull request #4031 from inception-project/refactoring/4030-Move…
Browse files Browse the repository at this point in the history
…-AnnotatorJS-code-to-different-package

#4030 - Move AnnotatorJS code to different package
  • Loading branch information
reckart authored May 29, 2023
2 parents 118cb69 + 777d906 commit 9ab916a
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,7 +34,7 @@
* Support for HTML-oriented editor component.
* <p>
* This class is exposed as a Spring Component via
* {@link HtmlAnnotationEditorSupportAutoConfiguration#htmlAnnotationEditorFactory()}.
* {@link AnnotatorJsAnnotationEditorSupportAutoConfiguration#annotatorJsHtmlAnnotationEditorFactory()}.
* </p>
*/
public class AnnotatorJsHtmlAnnotationEditorFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
de.tudarmstadt.ukp.inception.htmleditor.config.HtmlAnnotationEditorSupportAutoConfiguration
de.tudarmstadt.ukp.inception.annotatorjs.config.AnnotatorJsAnnotationEditorSupportAutoConfiguration

0 comments on commit 9ab916a

Please sign in to comment.