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:
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release inception-29.5
  #4230 - Upgrade dependencies
  #4230 - Upgrade dependencies
  #4235 - Direct access-by-URL to sidebar curation mode sometimes does not work
  #4229 - Better project template selection
  #4229 - Better project template selection
  #4229 - Better project template selection
  #4229 - Better project template selection

% Conflicts:
%	pom.xml
  • Loading branch information
reckart committed Oct 10, 2023
2 parents 778c7ba + f9b43e9 commit f9fcbea
Show file tree
Hide file tree
Showing 46 changed files with 1,456 additions and 309 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pipeline {
}

post {
success {
always {
script {
if (params.wipeWorkspaceAfterBuild) {
echo "Wiping workspace..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.context.ApplicationEvent;

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

/**
* Fire BeforeDocumentOpenedEvent to give listeners a chance to look at or even modify the CAS
Expand All @@ -29,6 +30,7 @@
*/
public class BeforeDocumentOpenedEvent
extends ApplicationEvent
implements HybridApplicationUIEvent
{
private static final long serialVersionUID = -4644605041626140906L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ public interface DocumentService
@PreAuthorize("hasAnyRole('ROLE_ADMIN','ROLE_USER','ROLE_REMOTE')")
SourceDocument createSourceDocument(SourceDocument document);

/**
* Check if any source document exist in the project.
*
* @param project
* the project.
* @return if any source document exists.
*/
boolean existsSourceDocument(Project project);

/**
* Check if a Source document with this same name exist in the project. The caller method then
* can decide to override or throw an exception/message to the client
Expand Down
5 changes: 5 additions & 0 deletions inception/inception-app-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-project-initializers-sentencelabeling</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-project-initializers-ud</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-project-initializers-wikidatalinking</artifactId>
Expand Down Expand Up @@ -926,6 +930,7 @@
<usedDependency>de.tudarmstadt.ukp.inception.app:inception-project-initializers-basic</usedDependency>
<usedDependency>de.tudarmstadt.ukp.inception.app:inception-project-initializers-doclabeling</usedDependency>
<usedDependency>de.tudarmstadt.ukp.inception.app:inception-project-initializers-sentencelabeling</usedDependency>
<usedDependency>de.tudarmstadt.ukp.inception.app:inception-project-initializers-ud</usedDependency>
<usedDependency>de.tudarmstadt.ukp.inception.app:inception-project-initializers-wikidatalinking</usedDependency>
<!-- INCEpTION annotation editor modules - used via Spring -->
<usedDependency>de.tudarmstadt.ukp.inception.app:inception-brat-editor</usedDependency>
Expand Down
5 changes: 5 additions & 0 deletions inception/inception-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,11 @@
<artifactId>inception-project-initializers-sentencelabeling</artifactId>
<version>30.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-project-initializers-ud</artifactId>
<version>30.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-project-initializers-wikidatalinking</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions inception/inception-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>9.35</version>
<version>9.36</version>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
Expand Down Expand Up @@ -651,12 +651,12 @@
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.14.8</version>
<version>1.14.9</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>1.14.8</version>
<version>1.14.9</version>
</dependency>
<dependency>
<groupId>org.wicketstuff</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument;
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocumentState;
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocumentStateTransition;
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument_;
import de.tudarmstadt.ukp.clarin.webanno.security.model.User;
import de.tudarmstadt.ukp.clarin.webanno.support.logging.BaseLoggers;
import de.tudarmstadt.ukp.inception.annotation.storage.CasStorageSession;
Expand Down Expand Up @@ -321,6 +322,21 @@ public boolean existsCas(AnnotationDocument aAnnotationDocument) throws IOExcept
return existsCas(aAnnotationDocument.getDocument(), aAnnotationDocument.getUser());
}

@Override
@Transactional
public boolean existsSourceDocument(Project aProject)
{
Validate.notNull(aProject, "Project must be specified");

var cb = entityManager.getCriteriaBuilder();
var query = cb.createQuery(Long.class);
var doc = query.from(SourceDocument.class);

query.select(cb.count(doc)).where(cb.equal(doc.get(SourceDocument_.project), aProject));

return entityManager.createQuery(query).getSingleResult() > 0;
}

@Override
@Transactional
public boolean existsSourceDocument(Project aProject, String aFileName)
Expand Down
5 changes: 5 additions & 0 deletions inception/inception-project-initializers-basic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
<artifactId>inception-project-initializers</artifactId>
</dependency>

<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-core</artifactId>
</dependency>

<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@
package de.tudarmstadt.ukp.inception.project.initializers.basic;

import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

import org.apache.wicket.request.resource.PackageResourceReference;
import org.apache.wicket.request.resource.ResourceReference;
import org.springframework.context.ApplicationContext;

import de.tudarmstadt.ukp.clarin.webanno.api.project.ProjectInitializer;
Expand All @@ -37,6 +41,9 @@
public class BasicProjectInitializer
implements QuickProjectInitializer
{
private static final PackageResourceReference THUMBNAIL = new PackageResourceReference(
MethodHandles.lookup().lookupClass(), "thumbnail.svg");

private final ApplicationContext context;

public BasicProjectInitializer(ApplicationContext aContext)
Expand All @@ -50,6 +57,18 @@ public String getName()
return "Basic annotation (span/relation)";
}

@Override
public Optional<String> getDescription()
{
return Optional.of("Create annotations on words and connect them using relations.");
}

@Override
public Optional<ResourceReference> getThumbnail()
{
return Optional.of(THUMBNAIL);
}

@Override
public boolean alreadyApplied(Project aProject)
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import java.io.IOException;
import java.util.List;
import java.util.Optional;

import de.tudarmstadt.ukp.clarin.webanno.api.project.ProjectInitializer;
import de.tudarmstadt.ukp.clarin.webanno.model.Project;
Expand Down Expand Up @@ -64,7 +65,7 @@ public BasicDocumentLabelingProjectInitializer(PreferencesService aPreferencesSe
@Override
public String getName()
{
return "Basic document labeling";
return "Document classification";
}

@Override
Expand Down Expand Up @@ -114,4 +115,10 @@ public void configure(Project aProject) throws IOException
matrixWorkloadExtension.writeTraits(traits, aProject);
workloadManagementService.saveConfiguration(manager);
}

@Override
public Optional<String> getDescription()
{
return Optional.of("Create document-classification annotations.");
}
}
Loading

0 comments on commit f9fcbea

Please sign in to comment.