Skip to content

Commit

Permalink
Merge branch 'main' into refactoring/Upgrade-to-Spring-Boot-3
Browse files Browse the repository at this point in the history
* main: (212 commits)
  No issue. Pull CSS out of HTML file and into a separate CSS file.
  #3831 - Better support a direct-access workflow
  #3831 - Better support a direct-access workflow
  #3831 - Better support a direct-access workflow
  No issue: Avoid hard crash if selection points to a non-existing feature structure.
  No issue: Formatting
  No issue: Fix endless recursion.
  No issue. Make some constants accessible.
  #3571 - Update dependencies
  #3571 - Update dependencies
  #3826 - Update dependencies
  #3783 - Ability to sort projects by created date
  #3826 - Update dependencies
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release inception-27.0-beta-4
  #3822 - Order of matches found in knowledge base search is not correct
  #3822 - Order of matches found in knowledge base search is not correct
  #3822 - Order of matches found in knowledge base search is not correct
  No issue. Reduce memory usage of test and display memory usage while test is running.
  #3793 - Ability to trigger sidebar curation mode via URL parameter
  ...

% Conflicts:
%	inception/inception-app-webapp/src/main/java/de/tudarmstadt/ukp/inception/app/config/InceptionSecurityWebUIBuiltInAutoConfiguration.java
%	inception/inception-app-webapp/src/main/java/de/tudarmstadt/ukp/inception/app/config/InceptionSecurityWebUIPreAuthenticatedAutoConfiguration.java
%	inception/inception-app-webapp/src/main/java/de/tudarmstadt/ukp/inception/app/config/InceptionServletContextInitializer.java
%	inception/inception-diam-editor/src/main/java/de/tudarmstadt/ukp/inception/experimental/editor/diamdebugeditor/DiamDebugEditorComponent.java
%	inception/inception-html-editor/pom.xml
%	inception/inception-security/src/main/java/de/tudarmstadt/ukp/clarin/webanno/security/config/SecurityAutoConfiguration.java
%	inception/inception-security/src/main/java/de/tudarmstadt/ukp/clarin/webanno/security/preauth/ShibbolethRequestHeaderAuthenticationFilter.java
%	inception/inception-support/src/main/java/de/tudarmstadt/ukp/inception/support/vue/VueBehavior.java
%	inception/inception-tutorial/src/main/java/de/tudarmstadt/ukp/inception/tutorial/TutorialFooterPanel.java
%	inception/inception-ui-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/annotation/config/AnnotationUIAutoConfiguration.java
%	inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/login/LoginPage.java
%	inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/page/ProjectPageBase.java
%	inception/inception-ui-curation/src/main/java/de/tudarmstadt/ukp/inception/ui/curation/sidebar/config/CurationSidebarAutoConfiguration.java
%	inception/inception-websocket/pom.xml
%	inception/inception-websocket/src/main/java/de/tudarmstadt/ukp/inception/websocket/footer/LoggedEventFooterPanel.java
%	inception/pom.xml
  • Loading branch information
reckart committed Feb 26, 2023
2 parents 4ae2c10 + f1ce910 commit 512dcff
Show file tree
Hide file tree
Showing 623 changed files with 37,965 additions and 73,048 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ post-process annotations:

- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/inception-project/inception/blob/master/notebooks/annotations_as_one_sentence_and_label_per_line.ipynb) Export annotations as one sentence per line
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/inception-project/inception/blob/master/notebooks/using_pretokenized_and_preannotated_text.ipynb) Use pre-tokenized and pre-annotated documents in INCEpTION
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/inception-project/inception/blob/master/notebooks/annotated_word_files_to_cas_xmi.ipynb) Convert Word files to CAS XMI for import into INCEpTION
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/inception-project/inception/blob/master/notebooks/Working_with_INCEpTION_slot_features_in_DKPro_Cassis.ipynb) Working with INCEpTION slot features in DKPro Cassis
- ... [more Python examples](https://inception-project.github.io/example-projects/python/)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import org.springframework.context.ApplicationEvent;

import de.tudarmstadt.ukp.clarin.webanno.model.Project;
import de.tudarmstadt.ukp.clarin.webanno.support.wicket.event.HybridApplicationUIEvent;

public class ActiveLearningSessionCompletedEvent
extends ApplicationEvent
implements HybridApplicationUIEvent
{
private static final long serialVersionUID = -4736560772442881663L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import org.springframework.context.ApplicationEvent;

import de.tudarmstadt.ukp.clarin.webanno.model.Project;
import de.tudarmstadt.ukp.clarin.webanno.support.wicket.event.HybridApplicationUIEvent;

public class ActiveLearningSessionStartedEvent
extends ApplicationEvent
implements HybridApplicationUIEvent
{
private static final long serialVersionUID = -4736560772442881663L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.slf4j.Logger;
Expand All @@ -78,7 +77,7 @@
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument;
import de.tudarmstadt.ukp.clarin.webanno.security.UserDao;
import de.tudarmstadt.ukp.clarin.webanno.security.model.User;
import de.tudarmstadt.ukp.clarin.webanno.support.dialog.ConfirmationDialog;
import de.tudarmstadt.ukp.clarin.webanno.support.bootstrap.BootstrapModalDialog;
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxButton;
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxLink;
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxSubmitLink;
Expand Down Expand Up @@ -155,10 +154,10 @@ public class ActiveLearningSidebar
private static final String CID_ONLY_SKIPPED_RECOMMENDATION_LABEL = "onlySkippedRecommendationLabel";
private static final String CID_LEARN_FROM_SKIPPED_RECOMMENDATION_FORM = "learnFromSkippedRecommendationForm";
private static final String CID_NO_RECOMMENDATION_LABEL = "noRecommendationLabel";
private static final String CID_SESSION_CONTROL_FORM = "sessionControlForm";
private static final String CID_START_SESSION_BUTTON = "startSession";
private static final String CID_STOP_SESSION_BUTTON = "stopSession";
private static final String CID_SELECT_LAYER = "selectLayer";
private static final String CID_SESSION_CONTROL_FORM = "sessionControlForm";
private static final String CID_REMOVE_RECORD = "removeRecord";
private static final String CID_USER_ACTION = "userAction";
private static final String CID_RECOMMENDED_ANNOTATION = "recommendedAnnotation";
Expand All @@ -181,7 +180,7 @@ public class ActiveLearningSidebar
private final WebMarkupContainer alMainContainer;

private AnnotationPage annotationPage;
private ConfirmationDialog confirmationDialog;
private BootstrapModalDialog dialog;
private FeatureEditor editor;
private Form<Void> recommendationForm;
private Form<Void> sessionControlForm;
Expand Down Expand Up @@ -234,8 +233,9 @@ public ActiveLearningSidebar(String aId, IModel<AnnotatorState> aModel,
alMainContainer.add(createLearningHistory());
add(alMainContainer);

confirmationDialog = new ConfirmationDialog(CID_CONFIRMATION_DIALOG);
add(confirmationDialog);
dialog = new BootstrapModalDialog(CID_CONFIRMATION_DIALOG);
dialog.trapFocus();
add(dialog);
}

private Label createNoRecommendersMessage()
Expand Down Expand Up @@ -1003,29 +1003,8 @@ private void actionRemoveHistoryItem(AjaxRequestTarget aTarget, LearningRecord a
setActiveLearningHighlight(aRecord);
actionShowSelectedDocument(aTarget, aRecord.getSourceDocument(),
aRecord.getOffsetBegin(), aRecord.getOffsetEnd());
confirmationDialog.setTitleModel(new StringResourceModel(
"alSidebar.history.delete.confirmation.title", this));
confirmationDialog.setContentModel(new StringResourceModel(
"alSidebar.history.delete.confirmation.content", this, null));
confirmationDialog.setConfirmAction(_t -> {
if (alStateModel.getObject().getSuggestion().isPresent()) {
setActiveLearningHighlight(alStateModel.getObject().getSuggestion().get());
}
else {
clearActiveLearningHighlight();
}
deleteAnnotationByHistory(_t, aRecord);
});
confirmationDialog.setCancelAction(_t -> {
if (alStateModel.getObject().getSuggestion().isPresent()) {
setActiveLearningHighlight(alStateModel.getObject().getSuggestion().get());
}
else {
clearActiveLearningHighlight();
}
annotationPage.actionRefreshDocument(_t);
});
confirmationDialog.show(aTarget);

openHistoryItemRemovalConfirmationDialog(aTarget, aRecord);
}
}

Expand All @@ -1039,6 +1018,35 @@ private void actionRemoveHistoryItem(AjaxRequestTarget aTarget, LearningRecord a
}
}

private void openHistoryItemRemovalConfirmationDialog(AjaxRequestTarget aTarget,
LearningRecord aRecord)
{
var dialogContent = new HistoryItemDeleteConfirmationDialogPanel(
BootstrapModalDialog.CONTENT_ID);

dialogContent.setConfirmAction(_t -> {
if (alStateModel.getObject().getSuggestion().isPresent()) {
setActiveLearningHighlight(alStateModel.getObject().getSuggestion().get());
}
else {
clearActiveLearningHighlight();
}
deleteAnnotationByHistory(_t, aRecord);
});

dialogContent.setCancelAction(_t -> {
if (alStateModel.getObject().getSuggestion().isPresent()) {
setActiveLearningHighlight(alStateModel.getObject().getSuggestion().get());
}
else {
clearActiveLearningHighlight();
}
annotationPage.actionRefreshDocument(_t);
});

dialog.open(dialogContent, aTarget);
}

private void deleteAnnotationByHistory(AjaxRequestTarget aTarget, LearningRecord aRecord)
throws IOException, AnnotationException
{
Expand Down Expand Up @@ -1374,7 +1382,7 @@ public void onPredictionsSwitched(PredictionsSwitchedEvent aEvent)
// If active learning is not active, update the sidebar in case the session auto-terminated
ActiveLearningUserState alState = alStateModel.getObject();
if (!alState.isSessionActive()) {
aEvent.getRequestHandler().add(alMainContainer);
aEvent.getRequestTarget().add(alMainContainer);
return;
}

Expand All @@ -1383,11 +1391,11 @@ public void onPredictionsSwitched(PredictionsSwitchedEvent aEvent)

// Maybe the prediction switch has made a new suggestion available for us to go to
if (alState.getSuggestion().isEmpty()) {
moveToNextSuggestion(aEvent.getRequestHandler());
moveToNextSuggestion(aEvent.getRequestTarget());
return;
}

refreshCurrentSuggestionOrMoveToNextSuggestion(aEvent.getRequestHandler());
refreshCurrentSuggestionOrMoveToNextSuggestion(aEvent.getRequestTarget());
}

private void refreshCurrentSuggestionOrMoveToNextSuggestion(AjaxRequestTarget aTarget)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
alSidebar.history.delete.confirmation.title=Confirmation
alSidebar.history.delete.confirmation.content=Do you also want to delete the corresponding \
annotation?
alSidebar.history.delete.confirmation.content=Do you also want to delete the corresponding annotation?
suggestion=Suggestion
text=Text
recommendation=Recommendation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
*/
package de.tudarmstadt.ukp.inception.active.learning.sidebar;

import org.apache.wicket.Component;
import org.apache.wicket.model.IModel;
import org.springframework.beans.factory.annotation.Autowired;

import de.agilecoders.wicket.core.markup.html.bootstrap.image.IconType;
import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesome5IconType;
import de.tudarmstadt.ukp.clarin.webanno.api.CasProvider;
import de.tudarmstadt.ukp.clarin.webanno.model.Project;
import de.tudarmstadt.ukp.clarin.webanno.ui.annotation.AnnotationPage;
Expand Down Expand Up @@ -63,9 +62,9 @@ public String getDescription()
}

@Override
public IconType getIcon()
public Component createIcon(String aId, IModel<AnnotatorState> aState)
{
return FontAwesome5IconType.robot_s;
return new ActiveLearningSidebarIcon(aId, aState);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<!--
Licensed to the Technische Universität Darmstadt under one
or more contributor license agreements. See the NOTICE file
Expand All @@ -15,11 +16,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
<body>
<wicket:panel>
<div wicket:id="vis" class="flex-content flex-v-container"/>
</wicket:panel>
</body>
</html>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<span wicket:id="icon"/>
<span wicket:id="badge" class="icon-badge"/>
</wicket:panel>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
* 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.active.learning.sidebar;

import static de.tudarmstadt.ukp.inception.active.learning.sidebar.ActiveLearningUserStateMetaData.CURRENT_AL_USER_STATE;

import java.util.Set;

import org.apache.wicket.ClassAttributeModifier;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.wicketstuff.event.annotation.OnEvent;

import de.agilecoders.wicket.core.markup.html.bootstrap.image.Icon;
import de.agilecoders.wicket.core.markup.html.bootstrap.image.IconType;
import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesome5IconType;
import de.tudarmstadt.ukp.clarin.webanno.security.UserDao;
import de.tudarmstadt.ukp.inception.active.learning.ActiveLearningService;
import de.tudarmstadt.ukp.inception.active.learning.event.ActiveLearningSessionCompletedEvent;
import de.tudarmstadt.ukp.inception.active.learning.event.ActiveLearningSessionStartedEvent;
import de.tudarmstadt.ukp.inception.rendering.editorstate.AnnotatorState;

public class ActiveLearningSidebarIcon
extends Panel
{
private static final long serialVersionUID = -1870047500327624860L;

private @SpringBean ActiveLearningService activeLearningService;
private @SpringBean UserDao userService;

public ActiveLearningSidebarIcon(String aId, IModel<AnnotatorState> aState)
{
super(aId, aState);

setOutputMarkupId(true);

queue(new Icon("icon", FontAwesome5IconType.robot_s));
queue(new Icon("badge", LoadableDetachableModel.of(this::getStateIcon))
.add(new ClassAttributeModifier()
{
private static final long serialVersionUID = 4534226094224688646L;

@Override
protected Set<String> update(Set<String> aClasses)
{
if (isSessionActive()) {
aClasses.add("text-primary");
aClasses.remove("text-muted");
}
else {
aClasses.add("text-muted");
aClasses.remove("text-primary");
}

return aClasses;
}
}));
}

@SuppressWarnings("unchecked")
public IModel<AnnotatorState> getModel()
{
return (IModel<AnnotatorState>) getDefaultModel();
}

public AnnotatorState getModelObject()
{
return (AnnotatorState) getDefaultModelObject();
}

private boolean isSessionActive()
{
var alState = getPage().getMetaData(CURRENT_AL_USER_STATE);
return alState != null && alState.isSessionActive();
}

private IconType getStateIcon()
{
if (isSessionActive()) {
return FontAwesome5IconType.play_circle_s;
}

return FontAwesome5IconType.stop_circle_s;
}

@OnEvent
public void sessionStarted(ActiveLearningSessionStartedEvent aEvent) {
aEvent.getRequestTarget().add(this);
}

@OnEvent
public void sessionStarted(ActiveLearningSessionCompletedEvent aEvent) {
aEvent.getRequestTarget().add(this);
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!DOCTYPE html>
<!--
Licensed to the Technische Universität Darmstadt under one
or more contributor license agreements. See the NOTICE file
Expand All @@ -15,10 +16,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
<body>
<wicket:panel>
</wicket:panel>
</body>
<html xmlns:wicket="http://wicket.apache.org">
<wicket:extend>
<p>
<wicket:message key="message"/>
</p>
</wicket:extend>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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.active.learning.sidebar;

import de.tudarmstadt.ukp.clarin.webanno.support.dialog.ConfirmationDialogContentPanel_ImplBase;

public class HistoryItemDeleteConfirmationDialogPanel
extends ConfirmationDialogContentPanel_ImplBase
{
private static final long serialVersionUID = 7050666954726883326L;

public HistoryItemDeleteConfirmationDialogPanel(String aId)
{
super(aId);
}
}
Loading

0 comments on commit 512dcff

Please sign in to comment.