Skip to content
Merged
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 Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY . .
RUN mvn package -DskipTests

# Production stage
FROM tomcat:11.0.13-jdk17 AS fnl_base_image
FROM tomcat:11.0.20-jdk17 AS fnl_base_image

RUN apt-get update && apt-get -y upgrade

Expand Down
24 changes: 11 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<properties>
<java.version>17</java.version>
<!-- Override Spring Framework version globally for Boot -->
<spring-framework.version>6.2.11</spring-framework.version>
<spring-framework.version>6.2.17</spring-framework.version>

<spring.restdocs.version>3.0.3</spring.restdocs.version>
<snakeyaml.version>2.3</snakeyaml.version>
Expand All @@ -33,6 +33,13 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.18.6</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
Expand All @@ -46,12 +53,12 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.24.3</version>
<version>2.25.3</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.24.3</version>
<version>2.25.3</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
Expand Down Expand Up @@ -189,7 +196,7 @@
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>11.0.13</version>
<version>11.0.20</version>
</dependency>
<!-- JUnit -->
<dependency>
Expand Down Expand Up @@ -217,11 +224,6 @@
<version>1.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.15.2</version>
</dependency>
<!-- Neo4j Graphql -->
<dependency>
<groupId>org.neo4j</groupId>
Expand Down Expand Up @@ -314,10 +316,6 @@
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
Expand Down
26 changes: 15 additions & 11 deletions src/main/java/gov/nih/nci/bento_ri/model/PrivateESDataFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -751,18 +751,20 @@ private Integer numberOfPublications() throws Exception {
/**
* Gets the details for a single Dataset record
*
* @param dataset_source_id The ID of the Dataset
* @param params The filters applied
* @return A map of the Dataset record's properties
* @throws IOException
*/
private Map<String, Object> datasetDetails(Map<String, Object> params) throws IOException {
Map<String, Object> dataset;
String datasetId = (String) params.get("dataset_source_id");
String datasetId = (String) params.get("dataset_uuid");
List<Map<String, Object>> datasets;

final String[][] PROPERTIES = new String[][]{
new String[]{"dataset_uuid", "dataset_uuid"},
new String[]{"dataset_maximum_age_at_baseline", "dataset_maximum_age_at_baseline"},
new String[]{"dataset_minimum_age_at_baseline", "dataset_minimum_age_at_baseline"},
new String[]{"dataset_storage_distribution", "dataset_storage_distribution"},
new String[]{"dataset_title", "dataset_title"},
new String[]{"description", "description"},
new String[]{"experimental_approaches", "experimental_approaches"},
Expand Down Expand Up @@ -790,8 +792,10 @@ private Map<String, Object> datasetDetails(Map<String, Object> params) throws IO
};

Map<String, String> mapping = Map.ofEntries(
Map.entry("dataset_uuid", "dataset_uuid"),
Map.entry("dataset_maximum_age_at_baseline", "dataset_maximum_age_at_baseline"),
Map.entry("dataset_minimum_age_at_baseline", "dataset_minimum_age_at_baseline"),
Map.entry("dataset_storage_distribution", "dataset_storage_distribution"),
Map.entry("dataset_title", "dataset_title"),
Map.entry("description", "description"),
Map.entry("experimental_approaches", "experimental_approaches"),
Expand Down Expand Up @@ -819,14 +823,14 @@ private Map<String, Object> datasetDetails(Map<String, Object> params) throws IO
);

Map<String, Object> dataset_params = Map.ofEntries(
Map.entry("dataset_source_id", List.of(datasetId)),
Map.entry(ORDER_BY, "dataset_source_id"),
Map.entry("dataset_uuid", List.of(datasetId)),
Map.entry(ORDER_BY, "dataset_uuid"),
Map.entry(SORT_DIRECTION, "ASC"),
Map.entry(PAGE_SIZE, 1),
Map.entry(OFFSET, 0)
);

datasets = overview(DATASETS_END_POINT, dataset_params, PROPERTIES, "dataset_source_id", mapping, REGULAR_PARAMS, "nested_filters", "datasets");
datasets = overview(DATASETS_END_POINT, dataset_params, PROPERTIES, "dataset_uuid", mapping, REGULAR_PARAMS, "nested_filters", "datasets");

try {
dataset = datasets.get(0);
Expand All @@ -848,7 +852,7 @@ private List<Map<String, Object>> getDatasetFiles(Map<String, Object> params) th
List<Map<String, Object>> files;

final String[][] PROPERTIES = new String[][]{
new String[]{"dataset_source_id", "dataset_source_id"},
new String[]{"dataset_uuid", "dataset_uuid"},
new String[]{"file_url_repo_prefix", "file_url_repo_prefix"},
new String[]{"file_id", "file_id"},
new String[]{"file_name", "file_name"},
Expand All @@ -858,7 +862,7 @@ private List<Map<String, Object>> getDatasetFiles(Map<String, Object> params) th
};

Map<String, String> mapping = Map.ofEntries(
Map.entry("dataset_source_id", "dataset_source_id.sort"),
Map.entry("dataset_uuid", "dataset_uuid.sort"),
Map.entry("file_url_repo_prefix", "file_url_repo_prefix.sort"),
Map.entry("file_id", "file_id.sort"),
Map.entry("file_name", "file_name.sort"),
Expand All @@ -873,8 +877,8 @@ private List<Map<String, Object>> getDatasetFiles(Map<String, Object> params) th
// Rename 'accessTypes' to 'access_level'
queryParams.put("access_level.search", queryParams.remove("accessTypes"));

// Turn dataset_source_id into a list
queryParams.put("dataset_source_id.search", List.of(queryParams.remove("dataset_source_id")));
// Turn dataset_uuid into a list
queryParams.put("dataset_uuid", List.of(queryParams.remove("dataset_uuid")));

// Turn filters into lowercase
for (String key : queryParams.keySet()) {
Expand Down Expand Up @@ -917,7 +921,7 @@ private List<Map<String, Object>> getDatasetFiles(Map<String, Object> params) th
/**
* Gets the details for a single Program record
*
* @param programId The ID of the Program
* @param params The filters applied
* @return A map of the Program record's properties
* @throws IOException
*/
Expand Down Expand Up @@ -972,7 +976,7 @@ private Map<String, Object> programDetails(Map<String, Object> params) throws IO
/**
* Gets the details for a single Project record
*
* @param projectId The ID of the Project
* @param params The filters applied
* @return A map of the Project record's properties
* @throws IOException
*/
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/graphql/ins-private-es.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ type DatasetFile {
}

type DatasetDetails {
dataset_uuid: String
dataset_maximum_age_at_baseline: Int
dataset_minimum_age_at_baseline: Int
dataset_storage_distribution: String
dataset_title: String
description: String
experimental_approaches: String
Expand Down Expand Up @@ -387,8 +389,8 @@ type QueryType {
): [PublicationsOverview]

programInfo: [ProgramInfo]
datasetDetails(dataset_source_id: String): DatasetDetails
getDatasetFiles(dataset_source_id: String!, accessTypes: [String!]!): [DatasetFile]
datasetDetails(dataset_uuid: String!): DatasetDetails
getDatasetFiles(dataset_uuid: String!, accessTypes: [String!]!): [DatasetFile]
programDetails(program_id: String): ProgramDetails
projectDetails(project_id: String): ProjectDetails
subjectDetail(subject_id: String): SubjectDetail
Expand Down
Loading