From 9657e74e8b2a92a2bb038d80d17c0f4f41879a7e Mon Sep 17 00:00:00 2001 From: Spiros Dimopulos Date: Thu, 26 Feb 2026 20:04:44 +0200 Subject: [PATCH 1/3] =?UTF-8?q?NO-JIRA:=20added=20removeing=20query=20para?= =?UTF-8?q?meters=20from=20filename=20when=20download=E2=80=A6=20(#506)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NO-JIRA: added removeing query parameters from filename when downloading file; --- .../services/common/HttpDownloadUtility.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/services/common/src/main/java/org/collectionspace/services/common/HttpDownloadUtility.java b/services/common/src/main/java/org/collectionspace/services/common/HttpDownloadUtility.java index 9e9c865ce1..fff647523a 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/HttpDownloadUtility.java +++ b/services/common/src/main/java/org/collectionspace/services/common/HttpDownloadUtility.java @@ -42,7 +42,7 @@ private static String getDestDir(String destDir) { } return null; } - + return destDir; } @@ -54,7 +54,7 @@ public static File downloadFile(String fileURL) throws IOException { if (tmpdir.endsWith(File.separator) == false) { tmpdir = tmpdir + File.separator; } - + String destDir = getDestDir(tmpdir + UUID.randomUUID() + File.separator); String filePath = downloadFile(fileURL, destDir); result = new File(filePath); @@ -62,13 +62,13 @@ public static File downloadFile(String fileURL) throws IOException { String msg = String.format("Could not download file use this URL: %s", fileURL); logger.error(msg, e); } - + return result; } - + /** * Downloads a file from a URL - * + * * @param fileURL HTTP URL of the file to be downloaded * @param saveDir path of the directory to save the file * @throws IOException @@ -81,7 +81,7 @@ private static String downloadFile(String fileURL, String saveDir) throws IOExce try { httpResponseCode = httpConn.getResponseCode(); - + // always check HTTP response code first if (httpResponseCode == HttpURLConnection.HTTP_OK) { String fileName = ""; @@ -96,8 +96,13 @@ private static String downloadFile(String fileURL, String saveDir) throws IOExce } else { // extracts file name from URL fileName = fileURL.substring(fileURL.lastIndexOf("/") + 1, fileURL.length()); + // Remove query parameters from filename + int qIndex = fileName.indexOf("?"); + if (qIndex > -1) { + fileName = fileName.substring(0, qIndex); + } } - + if (logger.isDebugEnabled()) { String contentType = httpConn.getContentType(); int contentLength = httpConn.getContentLength(); @@ -105,15 +110,15 @@ private static String downloadFile(String fileURL, String saveDir) throws IOExce logger.debug("Disposition is:" + disposition != null ? disposition : ""); logger.debug("Content type is:" + contentType != null ? contentType : ""); logger.debug("Content length is:" + contentLength); - } + } // opens input stream from the HTTP connection InputStream inputStream = httpConn.getInputStream(); String saveFilePath = saveDir + File.separator + fileName; //FIXME: File.separator NOT needed - + // opens an output stream to save into file FileOutputStream outputStream = new FileOutputStream(saveFilePath); - + try { int bytesRead = -1; byte[] buffer = new byte[BUFFER_SIZE]; From 04767c39544e698b347a541650d225386f55e5d0 Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Mon, 2 Mar 2026 10:13:07 -0700 Subject: [PATCH 2/3] DRYD-2042: Update AdvancedSearch Response for Materials and Herbarium (#508) * Add material to advanced search response * Add determinationTaxon to advanced search response --- .../advancedsearch/model/MaterialModel.java | 18 ++++++++++++++++ .../advancedsearch/model/TaxonModel.java | 16 ++++++++++++++ .../main/resources/advanced-search_common.xsd | 6 ++++++ .../mapper/CollectionObjectMapper.java | 3 +++ .../collectionobjects_naturalhistory.xsd | 21 +++++++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 services/advancedsearch/jaxb/src/main/java/org/collectionspace/services/advancedsearch/model/MaterialModel.java diff --git a/services/advancedsearch/jaxb/src/main/java/org/collectionspace/services/advancedsearch/model/MaterialModel.java b/services/advancedsearch/jaxb/src/main/java/org/collectionspace/services/advancedsearch/model/MaterialModel.java new file mode 100644 index 0000000000..55a7e80c46 --- /dev/null +++ b/services/advancedsearch/jaxb/src/main/java/org/collectionspace/services/advancedsearch/model/MaterialModel.java @@ -0,0 +1,18 @@ +package org.collectionspace.services.advancedsearch.model; + +import org.collectionspace.services.collectionobject.CollectionobjectsCommon; +import org.collectionspace.services.collectionobject.MaterialGroupList; + +public class MaterialModel { + + public static String material(CollectionobjectsCommon collectionObject) { + String material = null; + if (collectionObject != null && collectionObject.getMaterialGroupList() != null) { + MaterialGroupList materialGroup = collectionObject.getMaterialGroupList(); + if (!materialGroup.getMaterialGroup().isEmpty()) { + material = materialGroup.getMaterialGroup().get(0).getMaterial(); + } + } + return material; + } +} diff --git a/services/advancedsearch/jaxb/src/main/java/org/collectionspace/services/advancedsearch/model/TaxonModel.java b/services/advancedsearch/jaxb/src/main/java/org/collectionspace/services/advancedsearch/model/TaxonModel.java index 1be0f9c250..37448c97df 100644 --- a/services/advancedsearch/jaxb/src/main/java/org/collectionspace/services/advancedsearch/model/TaxonModel.java +++ b/services/advancedsearch/jaxb/src/main/java/org/collectionspace/services/advancedsearch/model/TaxonModel.java @@ -4,6 +4,8 @@ import org.collectionspace.services.collectionobject.CollectionobjectsCommon; import org.collectionspace.services.collectionobject.domain.naturalhistory_extension.CollectionobjectsNaturalhistory; +import org.collectionspace.services.collectionobject.domain.naturalhistory_extension.DeterminationHistoryGroup; +import org.collectionspace.services.collectionobject.domain.naturalhistory_extension.DeterminationHistoryGroupList; import org.collectionspace.services.collectionobject.domain.naturalhistory_extension.TaxonomicIdentGroup; import org.collectionspace.services.collectionobject.domain.naturalhistory_extension.TaxonomicIdentGroupList; @@ -34,4 +36,18 @@ public static String preservationForm(final CollectionobjectsCommon common) { return form; } + + public static String determinationTaxon(final CollectionobjectsNaturalhistory naturalHistory) { + String taxon = null; + if (naturalHistory != null && naturalHistory.getTaxonomicIdentGroupList() != null) { + DeterminationHistoryGroupList determinationGroupList = naturalHistory.getDeterminationHistoryGroupList(); + List determinationGroups = determinationGroupList.getDeterminationHistoryGroup(); + if (!determinationGroups.isEmpty()) { + DeterminationHistoryGroup group = determinationGroups.get(0); + taxon = group.getDeterminationTaxon(); + } + } + + return taxon; + } } diff --git a/services/advancedsearch/jaxb/src/main/resources/advanced-search_common.xsd b/services/advancedsearch/jaxb/src/main/resources/advanced-search_common.xsd index 50fb31c202..f6b28889f9 100644 --- a/services/advancedsearch/jaxb/src/main/resources/advanced-search_common.xsd +++ b/services/advancedsearch/jaxb/src/main/resources/advanced-search_common.xsd @@ -73,6 +73,12 @@ + + + + + + diff --git a/services/advancedsearch/service/src/main/java/org/collectionspace/services/advancedsearch/mapper/CollectionObjectMapper.java b/services/advancedsearch/service/src/main/java/org/collectionspace/services/advancedsearch/mapper/CollectionObjectMapper.java index 4dd3622e4c..08c0311f9a 100644 --- a/services/advancedsearch/service/src/main/java/org/collectionspace/services/advancedsearch/mapper/CollectionObjectMapper.java +++ b/services/advancedsearch/service/src/main/java/org/collectionspace/services/advancedsearch/mapper/CollectionObjectMapper.java @@ -17,6 +17,7 @@ import org.collectionspace.services.advancedsearch.model.BriefDescriptionListModel; import org.collectionspace.services.advancedsearch.model.ContentConceptListModel; import org.collectionspace.services.advancedsearch.model.FieldCollectionModel; +import org.collectionspace.services.advancedsearch.model.MaterialModel; import org.collectionspace.services.advancedsearch.model.NAGPRACategoryModel; import org.collectionspace.services.advancedsearch.model.ObjectNameListModel; import org.collectionspace.services.advancedsearch.model.ObjectProductionModel; @@ -139,6 +140,7 @@ public AdvancedsearchListItem asListItem(final CSDocumentModelResponse response, }); item.setForm(TaxonModel.preservationForm(collectionObject)); + item.setMaterial(MaterialModel.material(collectionObject)); // from media resource if (!blobInfo.isEmpty()) { @@ -151,6 +153,7 @@ public AdvancedsearchListItem asListItem(final CSDocumentModelResponse response, if (naturalHistory != null) { item.setTaxon(TaxonModel.taxon(naturalHistory)); + item.setDeterminationTaxon(TaxonModel.determinationTaxon(naturalHistory)); } if (objectsNAGPRA != null) { diff --git a/services/collectionobject/jaxb/src/main/resources/collectionobjects_naturalhistory.xsd b/services/collectionobject/jaxb/src/main/resources/collectionobjects_naturalhistory.xsd index a501ca71e7..6830cc5424 100644 --- a/services/collectionobject/jaxb/src/main/resources/collectionobjects_naturalhistory.xsd +++ b/services/collectionobject/jaxb/src/main/resources/collectionobjects_naturalhistory.xsd @@ -42,6 +42,7 @@ + @@ -70,6 +71,26 @@ + + + + + + + + + + + + + + + + + + From fe6eb6ebda10814e4a546659bb911eb1da59a016 Mon Sep 17 00:00:00 2001 From: Spiros Dimopulos Date: Fri, 6 Mar 2026 00:07:58 +0200 Subject: [PATCH 3/3] Prepare 8.3.0-RC.3 (#510) * NO-JIRA: Prepare 8.3.0-RC.3 * NO-JIRA: updated changelog --- CHANGELOG.md | 1 + build.properties | 4 ++-- cspace-ui/materials/build.properties | 2 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c63b78b78..d93ac4ddb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Add contentPlaces, materialTechniqueDescription to ES mappings * Add blob alt text to media responses * Remove cspace_english namespace search +* Media Handling: Remove any query parameters from file name created, after uploading external media files ### Bug Fixes diff --git a/build.properties b/build.properties index c4d2a8b259..f3ea522288 100644 --- a/build.properties +++ b/build.properties @@ -9,7 +9,7 @@ host=127.0.0.1 # # Release version info # -release.version=8.3.0-RC.2 +release.version=8.3.0-RC.3 cspace.release=${release.version} cspace.instance.id=${env.CSPACE_INSTANCE_ID} @@ -27,7 +27,7 @@ cspace.im.root= # UI settings cspace.ui.package.name=cspace-ui cspace.ui.library.name=cspaceUI -cspace.ui.version=10.2.0-rc2.0 +cspace.ui.version=10.2.0-rc3.0 cspace.ui.build.branch=develop cspace.ui.build.node.ver=20 service.ui.library.name=${cspace.ui.library.name}-service diff --git a/cspace-ui/materials/build.properties b/cspace-ui/materials/build.properties index 99ee150440..b3e3d3b5db 100644 --- a/cspace-ui/materials/build.properties +++ b/cspace-ui/materials/build.properties @@ -3,7 +3,7 @@ tenant.ui.basename=/cspace/${tenant.shortname} tenant.ui.profile.plugin.package.name=cspace-ui-plugin-profile-materials tenant.ui.profile.plugin.library.name=cspaceUIPluginProfileMaterials -tenant.ui.profile.plugin.version=4.1.0 +tenant.ui.profile.plugin.version=4.1.1 tenant.ui.profile.plugin.build.branch=main # If not set, defaults to /gateway/${tenant.shortname} on the current host. diff --git a/pom.xml b/pom.xml index 43a608f2ec..bca0e4f30e 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ services - 8.3.0-RC.2 + 8.3.0-RC.3 UTF-8 ${revision} ${revision}