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}
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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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];