]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-2042: Update AdvancedSearch Response for Materials and Herbarium (#508)
authorMichael Ritter <mikejritter@users.noreply.github.com>
Mon, 2 Mar 2026 17:13:07 +0000 (10:13 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Mar 2026 17:13:07 +0000 (10:13 -0700)
* Add material to advanced search response
* Add determinationTaxon to advanced search response

services/advancedsearch/jaxb/src/main/java/org/collectionspace/services/advancedsearch/model/MaterialModel.java [new file with mode: 0644]
services/advancedsearch/jaxb/src/main/java/org/collectionspace/services/advancedsearch/model/TaxonModel.java
services/advancedsearch/jaxb/src/main/resources/advanced-search_common.xsd
services/advancedsearch/service/src/main/java/org/collectionspace/services/advancedsearch/mapper/CollectionObjectMapper.java
services/collectionobject/jaxb/src/main/resources/collectionobjects_naturalhistory.xsd

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 (file)
index 0000000..55a7e80
--- /dev/null
@@ -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;
+    }
+}
index 1be0f9c25084c55937e2ef08adf4c3043603b1cc..37448c97dff0be565021a8db4c68c4e68fa710bd 100644 (file)
@@ -4,6 +4,8 @@ import java.util.List;
 
 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 class TaxonModel {
 
                return form;
        }
+
+       public static String determinationTaxon(final CollectionobjectsNaturalhistory naturalHistory) {
+               String taxon = null;
+               if (naturalHistory != null && naturalHistory.getTaxonomicIdentGroupList() != null) {
+                       DeterminationHistoryGroupList determinationGroupList = naturalHistory.getDeterminationHistoryGroupList();
+                       List<DeterminationHistoryGroup> determinationGroups = determinationGroupList.getDeterminationHistoryGroup();
+                       if (!determinationGroups.isEmpty()) {
+                               DeterminationHistoryGroup group = determinationGroups.get(0);
+                               taxon = group.getDeterminationTaxon();
+                       }
+               }
+
+               return taxon;
+       }
 }
index 50fb31c202134406a213a1a25f1080e53eab5d7a..f6b28889f95a0defaf6ba8a80b10eb5caa63544b 100644 (file)
                   <xs:element name="objectProductionDate" type="xs:string" nillable="true"/>
                   <xs:element name="objectProductionPlace" type="xs:string" nillable="true"/>
 
+                  <!-- for materials profile -->
+                  <xs:element name="material" type="xs:string" nillable="true"/>
+
+                  <!-- for herbarium profile -->
+                  <xs:element name="determinationTaxon" type="xs:string" nillable="true"/>
+
                   <xs:element name="contentConcepts" type="contentConcepts" nillable="true"/>
                   <xs:element name="nagpraCategories" type="nagpraCategories" nillable="true"/>
                 </xs:sequence>
index 4dd3622e4c52da4abc84c24b5ea7e4b510fcd4f7..08c0311f9aaa74180d4a8d7bb42fe6adeb129849 100644 (file)
@@ -17,6 +17,7 @@ import org.collectionspace.services.advancedsearch.model.AgentModel;
 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 class CollectionObjectMapper {
             });
 
             item.setForm(TaxonModel.preservationForm(collectionObject));
+            item.setMaterial(MaterialModel.material(collectionObject));
 
             // from media resource
             if (!blobInfo.isEmpty()) {
@@ -151,6 +153,7 @@ public class CollectionObjectMapper {
 
         if (naturalHistory != null) {
             item.setTaxon(TaxonModel.taxon(naturalHistory));
+            item.setDeterminationTaxon(TaxonModel.determinationTaxon(naturalHistory));
         }
 
         if (objectsNAGPRA != null) {
index a501ca71e7dffb90d7ae20f617059ad970eba27a..6830cc54249b77079dd7af948c39fd2673693960 100644 (file)
@@ -42,6 +42,7 @@
         <xs:element name="fieldHigherGeography" type="xs:string"/>
 
         <xs:element name="taxonomicIdentGroupList" type="taxonomicIdentGroupList"/>
+        <xs:element name="determinationHistoryGroupList" type="determinationHistoryGroupList"/>
         <xs:element name="typeSpecimenGroupList" type="typeSpecimenGroupList"/>
         <xs:element name="fieldCollElevationGroupList" type="fieldCollElevationGroupList"/>
         <xs:element name="fieldCollDepthGroupList" type="fieldCollDepthGroupList"/>
       <xs:element name="notes" type="xs:string"/>
     </xs:sequence>
   </xs:complexType>
+  <xs:complexType name="determinationHistoryGroupList">
+    <xs:sequence>
+      <xs:element name="determinationHistoryGroup" type="determinationHistoryGroup" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="determinationHistoryGroup">
+    <xs:sequence>
+      <xs:element name="determinationQualifier" type="xs:string"/>
+      <xs:element name="determinationRefPage" type="xs:string"/>
+      <xs:element name="determinationInstitution" type="xs:string"/>
+      <xs:element name="determinationTaxon" type="xs:string"/>
+      <xs:element name="determinationKind" type="xs:string"/>
+      <xs:element name="determinationReference" type="xs:string"/>
+      <xs:element name="determinationNote" type="xs:string"/>
+      <xs:element name="determinationBy" type="xs:string"/>
+      <!-- DateGroup is a structured date; omitting for now since this schema is out of date
+      <xs:element name="determinationDateGroup" type="xs:string"/>
+      -->
+    </xs:sequence>
+  </xs:complexType>
 
   <xs:complexType name="typeSpecimenGroupList">
     <xs:sequence>