From 7f645ee76c3cca5582b15b1bdba733555c985433 Mon Sep 17 00:00:00 2001
From: Gcolon021 <34667267+Gcolon021@users.noreply.github.com>
Date: Wed, 29 Nov 2023 11:30:54 -0500
Subject: [PATCH 1/4] [ALS-5422] Add persistence.xml to visualization resource
(#161) (#162)
The visualization resource is failing to start due to an error injecting persistence unit into CDI managed bean. It is unable to find a persistence unit named ''.
---
.../src/main/resources/META-INF/persistence.xml | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 pic-sure-resources/pic-sure-visualization-resource/src/main/resources/META-INF/persistence.xml
diff --git a/pic-sure-resources/pic-sure-visualization-resource/src/main/resources/META-INF/persistence.xml b/pic-sure-resources/pic-sure-visualization-resource/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 00000000..307ff002
--- /dev/null
+++ b/pic-sure-resources/pic-sure-visualization-resource/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
From 86275ce1e773657c56f2c9d4c15d98186d083cd2 Mon Sep 17 00:00:00 2001
From: Gcolon021 <34667267+Gcolon021@users.noreply.github.com>
Date: Fri, 8 Dec 2023 16:19:29 -0500
Subject: [PATCH 2/4] Sync new Release/0008 with Master (#168)
* [ALS-5422] Add persistence.xml to visualization resource (#161)
The visualization resource is failing to start due to an error injecting persistence unit into CDI managed bean. It is unable to find a persistence unit named ''.
* [ALS-0000] Fix aggregate resource
- Very confused as to how this was working before
* [ALS-5422] Add persistence.xml to visualization resource (#161) (#162) (#163)
The visualization resource is failing to start due to an error injecting persistence unit into CDI managed bean. It is unable to find a persistence unit named ''.
---------
Co-authored-by: Luke Sikina
---
.../hms/dbmi/avillach/AggregateDataSharingResourceRS.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/main/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRS.java b/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/main/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRS.java
index 46c5a89e..60b62b5c 100644
--- a/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/main/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRS.java
+++ b/pic-sure-resources/pic-sure-aggregate-data-sharing-resource/src/main/java/edu/harvard/hms/dbmi/avillach/AggregateDataSharingResourceRS.java
@@ -228,7 +228,8 @@ public Response querySync(QueryRequest queryRequest) {
Set allowedResultTypes = Set.of(
"COUNT", "CROSS_COUNT", "INFO_COLUMN_LISTING", "OBSERVATION_COUNT",
- "OBSERVATION_CROSS_COUNT", "CATEGORICAL_CROSS_COUNT", "CONTINUOUS_CROSS_COUNT"
+ "OBSERVATION_CROSS_COUNT", "CATEGORICAL_CROSS_COUNT", "CONTINUOUS_CROSS_COUNT",
+ "VARIANT_COUNT_FOR_QUERY", "AGGREGATE_VCF_EXCERPT", "VCF_EXCERPT"
);
if (!allowedResultTypes.contains(expectedResultType)) {
From 6adfc96db43d18f1506bfaf28373f89a2e42d555 Mon Sep 17 00:00:00 2001
From: Gcolon021 <34667267+Gcolon021@users.noreply.github.com>
Date: Fri, 15 Dec 2023 10:20:28 -0500
Subject: [PATCH 3/4] [ALS-5061] Remove HSAPIResource (#166)
[ALS-5061] Remove HSAPIResource (#166)
---
pic-sure-api-wildfly/pom.xml | 6 -
.../dbmi/avillach/HSAPIResourceIT.java | 209 -------
.../pic-sure-hsapi-resource/README.md | 58 --
.../pic-sure-hsapi-resource/pom.xml | 69 ---
.../hms/dbmi/avillach/HSAPIResourceRS.java | 225 --------
.../hms/dbmi/avillach/JAXRSConfiguration.java | 26 -
.../resources/webapp/META-INF/context.xml | 3 -
.../main/resources/webapp/WEB-INF/beans.xml | 6 -
.../wildflyConfiguration/standalone.xml | 519 ------------------
pic-sure-resources/pom.xml | 1 -
10 files changed, 1122 deletions(-)
delete mode 100644 pic-sure-api-wildfly/src/test/java/edu/harvard/dbmi/avillach/HSAPIResourceIT.java
delete mode 100644 pic-sure-resources/pic-sure-hsapi-resource/README.md
delete mode 100644 pic-sure-resources/pic-sure-hsapi-resource/pom.xml
delete mode 100644 pic-sure-resources/pic-sure-hsapi-resource/src/main/java/edu/harvard/hms/dbmi/avillach/HSAPIResourceRS.java
delete mode 100755 pic-sure-resources/pic-sure-hsapi-resource/src/main/java/edu/harvard/hms/dbmi/avillach/JAXRSConfiguration.java
delete mode 100755 pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/webapp/META-INF/context.xml
delete mode 100755 pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/webapp/WEB-INF/beans.xml
delete mode 100644 pic-sure-resources/pic-sure-hsapi-resource/src/main/resources/wildflyConfiguration/standalone.xml
diff --git a/pic-sure-api-wildfly/pom.xml b/pic-sure-api-wildfly/pom.xml
index 8b8dc576..6d0e0b58 100644
--- a/pic-sure-api-wildfly/pom.xml
+++ b/pic-sure-api-wildfly/pom.xml
@@ -35,12 +35,6 @@
classes
${project.version}
-
- edu.harvard.hms.dbmi.avillach
- pic-sure-hsapi-resource
- classes
- ${project.version}
-
edu.harvard.hms.dbmi.avillach
pic-sure-resource-api
diff --git a/pic-sure-api-wildfly/src/test/java/edu/harvard/dbmi/avillach/HSAPIResourceIT.java b/pic-sure-api-wildfly/src/test/java/edu/harvard/dbmi/avillach/HSAPIResourceIT.java
deleted file mode 100644
index b4d174af..00000000
--- a/pic-sure-api-wildfly/src/test/java/edu/harvard/dbmi/avillach/HSAPIResourceIT.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package edu.harvard.dbmi.avillach;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import edu.harvard.dbmi.avillach.domain.QueryRequest;
-import edu.harvard.dbmi.avillach.util.exception.ApplicationException;
-import edu.harvard.dbmi.avillach.util.exception.ProtocolException;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.Header;
-import org.apache.http.HttpResponse;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.*;
-import static edu.harvard.dbmi.avillach.util.HttpClientUtil.*;
-import static org.junit.Assert.*;
-
-public class HSAPIResourceIT extends BaseIT {
-
- private final String targetURL = "http://localhost:8079";
- private Header[] headers;
-
- @Test
- public void testStatus() throws UnsupportedOperationException {
- HttpResponse response = retrieveGetResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/status"), headers);
- assertEquals("Status should return a 200", 200, response.getStatusLine().getStatusCode());
- }
-
- @Test
- public void testInfo() throws UnsupportedOperationException, IOException {
- QueryRequest request = new GeneralQueryRequest();
-
- String body = objectMapper.writeValueAsString(request);
- HttpResponse response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/info"), headers, body);
- assertEquals("Request should return a 200",200, response.getStatusLine().getStatusCode());
- JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
- assertNotNull("Response should not be null", responseNode);
- assertNotNull("Response should have a name", responseNode.get("name"));
- ArrayNode queryFormats = (ArrayNode) responseNode.get("queryFormats");
- assertNotNull("Response should have data in queryFormats", queryFormats);
- assertEquals("Response should have 3 queryFormats", 3, queryFormats.size());
- JsonNode firstFormat = queryFormats.get(0);
- assertNotNull("QueryFormat should have specifications", firstFormat.get("specification"));
-
- }
-
- @Test
- public void testSearch() throws UnsupportedOperationException, IOException {
- QueryRequest queryRequest = new GeneralQueryRequest();
-
- String body = objectMapper.writeValueAsString(queryRequest);
-
- HttpResponse response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/search"), headers, body);
- assertEquals("Search should return a 501",501, response.getStatusLine().getStatusCode());
- JsonNode responseMessage = objectMapper.readTree(response.getEntity().getContent());
- assertNotNull("Response message should not be null", responseMessage);
- String errorMessage = responseMessage.get("message").asText();
- assertEquals("Error message should be 'Search is not implemented for this resource'", "Search is not implemented for this resource", errorMessage);
- }
-
- @Test
- public void testQuery() throws UnsupportedOperationException, IOException {
- QueryRequest queryRequest = new GeneralQueryRequest();
-
- String body = objectMapper.writeValueAsString(queryRequest);
-
- HttpResponse response = retrievePostResponse(composeURL(hsapiEndpointUrl,"pic-sure/hsapi/query"), headers, body);
- assertEquals("Search should return a 501",501, response.getStatusLine().getStatusCode());
- JsonNode responseMessage = objectMapper.readTree(response.getEntity().getContent());
- assertNotNull("Response message should not be null", responseMessage);
- String errorMessage = responseMessage.get("message").asText();
- assertEquals("Error message should be 'Query is not implemented in this resource. Please use query/sync'", "Query is not implemented in this resource. Please use query/sync", errorMessage);
- }
-
- //These tests will throw a 404 unless we have a valid queryId which can't really be gotten just for a test....
- /*@Test
- public void testQueryStatus() throws UnsupportedOperationException, IOException {
- }
-
- @Test
- public void testRequest() throws UnsupportedOperationException, IOException {
- }*/
-
- @Test
- public void testQuerySync() throws UnsupportedOperationException, IOException {
- Map resourceResponse = new HashMap<>();
- List