Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Boot 3x WIP #311

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gsrs-fda-substance-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<dependency>
<groupId>gov.nih.ncats</groupId>
<artifactId>clinical-trials-api</artifactId>
<version>3.1.1-SNAPSHOT</version>
<version>3.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import lombok.extern.slf4j.Slf4j;

import javax.persistence.Query;
import jakarta.persistence.Query;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Collections;
Expand Down
9 changes: 4 additions & 5 deletions gsrs-module-substance-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<properties>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
<jackson.version>2.13.4</jackson.version>
<jackson.version>2.16.0</jackson.version>
</properties>

<build>
Expand All @@ -31,8 +31,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<!-- Uncomment this for maven public release deployment
Expand Down Expand Up @@ -204,7 +204,7 @@

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
Expand Down Expand Up @@ -331,7 +331,6 @@
<groupId>gov.nih.ncats</groupId>
<artifactId>gsrs-module-substances-data-exchange</artifactId>
<version>${gsrs.substance.version}</version>
<scope>test</scope>
</dependency>
<!--dependency>
<groupId>gov.nih.ncats</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

//import org.springframework.cloud.netflix.eureka.EnableEurekaClient;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include "substances-core.conf"

include "gsrs-h2-local.conf"

include "fda-extension.conf"
#include "fda-extension.conf"
gsrs.sessionSecure=false
#uncomment this setting to change renderer to use USP render settings.
#substance.renderer.style="USP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.boot.test.mock.mockito.MockBean;

import javax.persistence.EntityManager;
import jakarta.persistence.EntityManager;
import java.io.File;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.springframework.core.io.ClassPathResource;
import org.springframework.security.test.context.support.WithMockUser;

import javax.transaction.Transactional;
import jakarta.transaction.Transactional;
import java.io.File;
import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.util.function.Consumer;
import java.util.function.Supplier;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.springframework.test.context.event.RecordApplicationEvents;
import org.springframework.transaction.support.TransactionTemplate;

import javax.persistence.EntityManager;
import jakarta.persistence.EntityManager;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.ActiveProfiles;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.lang.reflect.Field;
import java.util.*;

Expand Down
4 changes: 2 additions & 2 deletions gsrs-module-substances-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<artifactId>gsrs-module-substances-api</artifactId>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>


Expand Down
14 changes: 10 additions & 4 deletions gsrs-module-substances-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<!-- Uncomment this for maven public release deployment
Expand Down Expand Up @@ -286,12 +286,12 @@
<dependency>
<groupId>uk.ac.cam.ch.opsin</groupId>
<artifactId>opsin-core</artifactId>
<version>2.7.0</version>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand All @@ -307,6 +307,12 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.coobird</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ private static class EmbeddedTomcatCustomizer implements WebServerFactoryCustomi
@Override
public void customize(TomcatServletWebServerFactory factory) {
factory.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> {
connector.setAttribute("relaxedPathChars", "<>[\\]^`{|}");
connector.setAttribute("relaxedQueryChars", "<>[\\]^`{|}");
connector.setProperty("relaxedPathChars", "<>[\\]^`{|}");
connector.setProperty("relaxedQueryChars", "<>[\\]^`{|}");
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionTemplate;

import javax.persistence.EntityManager;
import jakarta.persistence.EntityManager;
import javax.swing.text.DefaultStyledDocument;
import java.io.IOException;
import java.io.UncheckedIOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import gsrs.validator.ValidatorConfig;
import ix.ginas.models.v1.Substance;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
public class SubstanceValidatorConfig extends DefaultValidatorConfig {

private Substance.SubstanceClass substanceClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import javax.persistence.Id;
import jakarta.persistence.Id;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicLong;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotNull;
import java.io.IOException;
import java.util.Base64;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import java.util.stream.Stream;

import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.NotBlank;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.constraints.NotBlank;

import org.freehep.graphicsio.svg.SVGGraphics2D;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gsrs.module.substance.controllers.restValidation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gsrs.module.substance.controllers.restValidation;

import javax.validation.Constraint;
import javax.validation.Payload;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.*;

@Documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import jakarta.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import ix.ginas.modelBuilders.AbstractSubstanceBuilder;
import ix.ginas.models.v1.Code;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
Expand All @@ -21,6 +22,7 @@

@Slf4j
@Data
@EqualsAndHashCode(callSuper=false)
@JsonIgnoreProperties(ignoreUnknown = true)
public class NSRSCustomCodeExtractorActionFactory extends BaseActionFactory {
private String actionName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import ix.ginas.modelBuilders.ProteinSubstanceBuilder;
import ix.ginas.models.v1.Subunit;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;
Expand All @@ -17,6 +18,7 @@

@Slf4j
@Data
@EqualsAndHashCode(callSuper=false)
public class ProteinSequenceExtractorActionFactory extends BaseActionFactory {

private String subunitDelimiter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import ix.ginas.models.v1.GinasChemicalStructure;
import ix.ginas.models.v1.Moiety;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

Expand All @@ -23,6 +24,7 @@
import static gsrs.module.substance.importers.SDFImportAdapterFactory.resolveParametersMap;

@Data
@EqualsAndHashCode(callSuper=false)
@Slf4j
public class StructureExtractorActionFactory extends BaseActionFactory {
private String actionName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import java.util.LinkedHashMap;
import java.util.Map;
import javax.annotation.Generated;
import jakarta.annotation.Generated;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class TryToCreateInverseRelationshipEvent {
private UUID originatorUUID;
private UUID relationshipIdToInvert;

@Builder.Default
private CreationMode creationMode = CreationMode.CREATE_IF_MISSING_DEEP_CHECK;

private UUID newRelationshipId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface CodeRepository extends GsrsVersionedRepository<Code, UUID> {
Long findMaxCodeByCodeSystemAndCodeLikeAndCodeLessThan(@Param("codesystem") String codeSystem, @Param("codelike") String codeLike, @Param("maxcode") Long maxCode);

//hibernate query will not convert uuid into a string so we have to concatenate it with empty string for this to work.
@Query("select s from Name s where CONCAT(s.uuid, '') like ?1%")
@Query("select s from Name s where SUBSTRING(s.uuid, 1, 8) = ?1")
List<Code> findByUuidStartingWith(String partialUUID);

List<Code> findByCodeIgnoreCase(String code);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface NameRepository extends GsrsVersionedRepository<Name, UUID> {
List<Name> findByNameIgnoreCase(String name);

//hibernate query will not convert uuid into a string so we have to concatenate it with empty string for this to work.
@Query("select s from Name s where CONCAT(s.uuid, '') like ?1%")
@Query("select s from Name s where SUBSTRING(s.uuid, 1, 8) = ?1")
List<Name> findByUuidStartingWith(String partialUUID);

@Query("select n.uuid from Name n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
public interface ReferenceRepository extends GsrsVersionedRepository<Reference, UUID> {

//hibernate query will not convert uuid into a string so we have to concatenate it with empty string for this to work.
@Query("select s from Reference s where CONCAT(s.uuid, '') like ?1%")
@Query("select s from Reference s where SUBSTRING(s.uuid, 1, 8) = ?1")
List<Reference> findByUuidStartingWith(String partialUUID);
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ default Substance findBySubstanceReference(SubstanceReference substanceReference

List<SubstanceSummary> findByNames_Name(String name);

List<SubstanceSummary> findByNames_StdNameIgnoreCase(String stdName);
//List<SubstanceSummary> findByNames_StdNameIgnoreCase(String stdName);

List<SubstanceSummary> findByCodes_CodeIgnoreCase(String code);
List<SubstanceSummary> findByCodes_CodeAndCodes_CodeSystem(String code, String codeSystem);
Expand Down Expand Up @@ -99,7 +99,7 @@ default List<Substance> findSubstanceSummaryByMoieties_Structure_Properties_Term
* @return
*/
//hibernate query will not convert uuid into a string so we have to concatenate it with empty string for this to work.
@Query("select s from Substance s where CONCAT(s.uuid, '') like ?1%")
@Query("select s from Substance s where SUBSTRING(s.uuid, 1, 8) = ?1")
List<Substance> findByUuidStartingWith(String partialUUID);
@Query("select case when count(s)> 0 then true else false end from Substance s where s.approvalID= ?1")
boolean existsByApprovalID(String approvalID);
Expand Down Expand Up @@ -170,6 +170,6 @@ default SubstanceReference toSubstanceReference(){
@Query("select s.id from Substance s")
List<UUID> getAllIds();

@Query("select s.id from Substance s where dtype='CHE'")
@Query("select s.id from ChemicalSubstance s")
List<UUID> getAllChemicalIds();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import jakarta.annotation.Generated;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.List;
import java.util.Map;

import javax.annotation.Generated;
import jakarta.annotation.Generated;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
Expand Down
Loading
Loading