ref #9932 adapt article detail/pages handling for MexicoEflora import
authorAndreas Müller <a.mueller@bgbm.org>
Mon, 14 Mar 2022 14:07:24 +0000 (15:07 +0100)
committerAndreas Müller <a.mueller@bgbm.org>
Mon, 14 Mar 2022 14:08:58 +0000 (15:08 +0100)
app-import/src/main/java/eu/etaxonomy/cdm/io/mexico/MexicoEfloraCommonNameRefImport.java
app-import/src/main/java/eu/etaxonomy/cdm/io/mexico/MexicoEfloraDistributionRefImport.java
app-import/src/main/java/eu/etaxonomy/cdm/io/mexico/MexicoEfloraFactImport.java
app-import/src/main/java/eu/etaxonomy/cdm/io/mexico/MexicoEfloraImportState.java
app-import/src/main/java/eu/etaxonomy/cdm/io/mexico/MexicoEfloraRefArticlesImport.java
app-import/src/main/java/eu/etaxonomy/cdm/io/mexico/MexicoEfloraRefOtherBooksImport.java
app-import/src/main/java/eu/etaxonomy/cdm/io/mexico/MexicoEfloraRefSerialsImport.java
app-import/src/main/java/eu/etaxonomy/cdm/io/mexico/MexicoEfloraRefWebSitesImport.java
app-import/src/main/java/eu/etaxonomy/cdm/io/mexico/MexicoEfloraReferenceImportBase.java

index 4b9d640d1010294c2132eb2eaff28a565faebdc0..1d12f046923273b09da7971c9db266af88dab7bd 100644 (file)
@@ -92,7 +92,8 @@ public class MexicoEfloraCommonNameRefImport extends MexicoEfloraImportBase {
                                CommonTaxonName commonName = commonNameMap.get(idCombi);
 
                                Reference ref = referenceMap.get(String.valueOf(idBibliografia));
-                               String detail = state.getRefDetailMap().get(idBibliografia);
+//                             String detail = state.getRefDetailMap().get(idBibliografia);
+                               String detail = null;
 
                                if (commonName != null) {
                                    DescriptionElementSource source = commonName.addPrimaryTaxonomicSource(ref, detail);
index 00d4fe7c7c4c82a0fec9af9abdababb1a34465fc..026077c2744c71e06b8aff7bc6bac546763bea4a 100644 (file)
@@ -93,8 +93,8 @@ public class MexicoEfloraDistributionRefImport extends MexicoEfloraImportBase {
                                    continue;
                                }
                                Reference ref = referenceMap.get(String.valueOf(idBibliografia));
-                               String detail = state.getRefDetailMap().get(idBibliografia);
-
+//                             String detail = state.getRefDetailMap().get(idBibliografia);
+                               String detail = null;
 
                                DescriptionElementSource source = distribution.addPrimaryTaxonomicSource(ref, detail);
                     //TODO nameUsedInSource for distribution
index 740468f9cc61bf5916b80d0b3e3ec3df20e7de36..e22b9765790fe50b6ec573a09fa78b62f1a8af08 100644 (file)
@@ -161,7 +161,8 @@ public class MexicoEfloraFactImport extends MexicoEfloraImportBase {
             CategoricalData categoricalData, int idBibliografia,
             int id) {
         Reference ref = referenceMap == null ? null : referenceMap.get(String.valueOf(idBibliografia));
-        String detail = state.getRefDetailMap().get(idBibliografia);
+//        String detail = state.getRefDetailMap().get(idBibliografia);
+        String detail = null;
 
         if (ref != null) {
             if (categoricalData != null) {
index 841e51f73bf573133bf43c749e5ceb54b7864deb..84de6449187f204da8059d4ff393869211b587f2 100644 (file)
@@ -42,7 +42,7 @@ public class MexicoEfloraImportState
        private Map<String,NamedArea> areaLabelMap = new HashMap<>();
 
        private Map<Integer,UUID> referenceUuidMap = new HashMap<>();
-       private Map<Integer,String> refDetailMap = new HashMap<>();
+//     private Map<Integer,String> refDetailMap = new HashMap<>();
 
        private Map<String,UUID> commonNameMap = new HashMap<>();
     private Map<String,UUID> distributionMap = new HashMap<>();
@@ -82,9 +82,9 @@ public class MexicoEfloraImportState
     public Map<Integer,UUID> getReferenceUuidMap() {
         return referenceUuidMap;
     }
-    public Map<Integer,String> getRefDetailMap() {
-        return refDetailMap;
-    }
+//    public Map<Integer,String> getRefDetailMap() {
+//        return refDetailMap;
+//    }
 
     public Map<String,UUID> getCommonNameMap() {
         return commonNameMap;
index 44c3cad094a8d8651405965ed241f1705c34d5c0..0a4251aeed519aecf3953c80a91717be4078236c 100644 (file)
@@ -103,16 +103,14 @@ public class MexicoEfloraRefArticlesImport extends MexicoEfloraReferenceImportBa
                     }
 
                     //concat
-                    String detail = null;
                     if (isNotBlank(concat)) {
-                        //TODO split
                         String[] split = concat.split(":");
                         String volume = split[0];
+                        ref.setVolume(volume);
                         if (split.length > 1) {
-                            //TODO correct handling of detail
-                            detail = split[1];
+                            String pages = split[1];
+                            ref.setPages(pages);
                         }
-                        ref.setVolume(volume);
                     }else {
                         logger.info(refId + ": No volume");
                     }
@@ -134,7 +132,7 @@ public class MexicoEfloraRefArticlesImport extends MexicoEfloraReferenceImportBa
                     }
 
                     //register id and make import source
-                    handleId(state, refId, ref, detail);
+                    handleId(state, refId, ref);
 
                                        partitioner.startDoSave();
                                        refsToSave.add(ref);
index dc475512979f5962e530b7e1339f826e76d2d154..06114d4fb01e5ce74612e54f94c44f7108406caa 100644 (file)
@@ -113,7 +113,7 @@ public class MexicoEfloraRefOtherBooksImport extends MexicoEfloraReferenceImport
                     }
 
                     //register id and make import source
-                    handleId(state, refId, ref, null);
+                    handleId(state, refId, ref);
 
                                        partitioner.startDoSave();
                                        refsToSave.add(ref);
index 4d354da3b1a55b7158ecd83b16a550b3160ff4bc..70aedb107c780b82750787e3fba8e46cfeb4e43b 100644 (file)
@@ -114,7 +114,7 @@ public class MexicoEfloraRefSerialsImport extends MexicoEfloraReferenceImportBas
                     }
 
                     //register id and make import source
-                    handleId(state, refId, ref, null);
+                    handleId(state, refId, ref);
 
                                        partitioner.startDoSave();
                                        refsToSave.add(ref);
index 9a7fe7648afd27f66ce9dd64a5a0457d8e543d4a..a7a2caf97970e90e5a9199091d726dedf17caed3 100644 (file)
@@ -108,7 +108,7 @@ public class MexicoEfloraRefWebSitesImport extends MexicoEfloraReferenceImportBa
                     }
 
                     //register id and make import source
-                    handleId(state, refId, ref, null);
+                    handleId(state, refId, ref);
 
                                        partitioner.startDoSave();
                                        refsToSave.add(ref);
index 594064b7de0b0dd39983e56956260e5b6eb3ab8a..26a47c04dfc29e6eb217591fb38f6626f71d7559 100644 (file)
@@ -129,9 +129,9 @@ public abstract class MexicoEfloraReferenceImportBase  extends MexicoEfloraImpor
         }
     }
 
-    protected void handleId(MexicoEfloraImportState state, int refId, Reference ref, String detail) {
+    protected void handleId(MexicoEfloraImportState state, int refId, Reference ref) {
         state.getReferenceUuidMap().put(refId, ref.getUuid());
-        state.getRefDetailMap().put(refId, detail);
+//        state.getRefDetailMap().put(refId, detail);
 
         //TODO not needed anymore once "related objects" are adapted everywhere
         Reference sourceRef = getSourceReference(state.getConfig().getSourceReference());