From 90bdda6cd38b97371dcf849c2f318920520d1d74 Mon Sep 17 00:00:00 2001 From: dkayiwa Date: Wed, 8 May 2024 13:15:18 +0300 Subject: [PATCH 1/4] Fix ClassNotFoundException:org.openmrs.module.attachments.extension.html.AdminList --- omod/src/main/resources/config.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/omod/src/main/resources/config.xml b/omod/src/main/resources/config.xml index 9b71780..df1bc5c 100644 --- a/omod/src/main/resources/config.xml +++ b/omod/src/main/resources/config.xml @@ -22,13 +22,6 @@ ${project.parent.groupId}.${project.parent.artifactId}.AttachmentsActivator - - - - org.openmrs.admin.list - ${project.parent.groupId}.${project.parent.artifactId}.extension.html.AdminList - - From 44195cc01a7afe109a76d5f1e83ff2c742a21c87 Mon Sep 17 00:00:00 2001 From: openmrs-bot Date: Fri, 17 May 2024 20:08:12 +0000 Subject: [PATCH 2/4] [maven-release-plugin] prepare release 3.2.0 --- api/pom.xml | 2 +- omod/pom.xml | 2 +- pom.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index a490cab..fa42a34 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,7 +5,7 @@ org.openmrs.module attachments - 3.2.0-SNAPSHOT + 3.2.0 attachments-api diff --git a/omod/pom.xml b/omod/pom.xml index 7a4e5b1..a2fb4c6 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -5,7 +5,7 @@ org.openmrs.module attachments - 3.2.0-SNAPSHOT + 3.2.0 attachments-omod diff --git a/pom.xml b/pom.xml index 2e81cbb..b80b3c3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.openmrs.module attachments - 3.2.0-SNAPSHOT + 3.2.0 pom Attachments @@ -26,7 +26,7 @@ scm:git:git@github.com:openmrs/openmrs-module-attachments.git scm:git:git@github.com:openmrs/openmrs-module-attachments.git https://github.com/openmrs/openmrs-module-attachments - HEAD + 3.2.0 From ab7617cedbed6879a5462ef1cbdc601934593d6b Mon Sep 17 00:00:00 2001 From: openmrs-bot Date: Fri, 17 May 2024 20:08:14 +0000 Subject: [PATCH 3/4] [maven-release-plugin] prepare for next development iteration --- api/pom.xml | 2 +- omod/pom.xml | 2 +- pom.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index fa42a34..0025d41 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,7 +5,7 @@ org.openmrs.module attachments - 3.2.0 + 3.3.0-SNAPSHOT attachments-api diff --git a/omod/pom.xml b/omod/pom.xml index a2fb4c6..049845a 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -5,7 +5,7 @@ org.openmrs.module attachments - 3.2.0 + 3.3.0-SNAPSHOT attachments-omod diff --git a/pom.xml b/pom.xml index b80b3c3..61f88c4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.openmrs.module attachments - 3.2.0 + 3.3.0-SNAPSHOT pom Attachments @@ -26,7 +26,7 @@ scm:git:git@github.com:openmrs/openmrs-module-attachments.git scm:git:git@github.com:openmrs/openmrs-module-attachments.git https://github.com/openmrs/openmrs-module-attachments - 3.2.0 + HEAD From 8ea586605aa576d4e81005f59dd1f41619dee890 Mon Sep 17 00:00:00 2001 From: Michael Seaton Date: Mon, 10 Jun 2024 16:06:51 -0400 Subject: [PATCH 4/4] Fix for 3.1.2.10 (#66) --- .../module/attachments/rest/AttachmentBytesResource.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/omod/src/main/java/org/openmrs/module/attachments/rest/AttachmentBytesResource.java b/omod/src/main/java/org/openmrs/module/attachments/rest/AttachmentBytesResource.java index 1398c02..7b5c2ed 100644 --- a/omod/src/main/java/org/openmrs/module/attachments/rest/AttachmentBytesResource.java +++ b/omod/src/main/java/org/openmrs/module/attachments/rest/AttachmentBytesResource.java @@ -3,6 +3,7 @@ import static org.openmrs.module.attachments.AttachmentsContext.getContentFamily; import java.io.IOException; +import java.nio.charset.StandardCharsets; import javax.servlet.http.HttpServletResponse; @@ -23,6 +24,7 @@ import org.openmrs.module.webservices.rest.web.response.ResponseException; import org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController; import org.openmrs.obs.ComplexData; +import org.openmrs.web.WebUtil; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -69,7 +71,12 @@ public void getFile(@PathVariable("uuid") String uuid, @RequestParam(required = response.addHeader("File-Ext", getExtension(attComplexData.getTitle(), mimeType)); try { - response.getOutputStream().write(attComplexData.asByteArray()); + byte[] bytes = attComplexData.asByteArray(); + if (mimeType != null && mimeType.startsWith("text")) { + String byteString = WebUtil.encodeForHtmlContent(new String(bytes, StandardCharsets.UTF_8)); + bytes = byteString.getBytes(StandardCharsets.UTF_8); + } + response.getOutputStream().write(bytes); } catch (IOException ex) { response.setStatus(500);