ref #10441: adapt property path also for Taxon-/DescriptionController
authorKatja <k.luther@bgbm.org>
Fri, 15 Dec 2023 13:46:52 +0000 (14:46 +0100)
committerKatja <k.luther@bgbm.org>
Fri, 15 Dec 2023 13:46:52 +0000 (14:46 +0100)
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/DescriptionElementListController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/DescriptionPortalController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/MediaPortalController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonListController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonPortalController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonPortalListController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TermController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TermNodeController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TermPortalController.java
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/VocabularyListController.java

index 18784282b604cef9efd9734d431cc969e35947e8..8619618157f65fff60f140f5b14584916b5713c7 100644 (file)
@@ -72,7 +72,12 @@ public class DescriptionElementListController {
 
     protected static final List<String> DESCRIPTION_ELEMENT_INIT_STRATEGY = Arrays.asList(new String []{
             "$",
-            "multilanguageText"
+            "multilanguageText",
+            "stateData.modifyingText",
+            "stateData.categoricalData.$",
+            "annotations.$",
+            "annotations.type.$",
+            "annotations.type.includes.$"
     });
 
     protected List<String> getInitializationStrategy() {
@@ -150,7 +155,7 @@ public class DescriptionElementListController {
                 HttpStatusMessage.UUID_NOT_FOUND.send(response);
             }
         }
-
+        List<String> propertyPath = getInitializationStrategy();
         Pager<T> pager = service.pageDescriptionElementsForTaxon(taxon, features != null ? features.asSet() : null, type, pageSize,
                 pageIndex, getInitializationStrategy());
         return pager;
index 4ca0e87a2eed4e6e59edc8fff85757fbf82d3ab8..3fbcdd20c92260bce52f3cba0c636b7a0af0d86f 100644 (file)
@@ -87,6 +87,7 @@ public class DescriptionPortalController extends BaseController<DescriptionBase,
     protected static final List<String> ORDERED_DISTRIBUTION_INIT_STRATEGY = Arrays.asList(new String []{
             "elements.$",
             "elements.annotations",
+            "elements.annotations.includes.$",
             "elements.markers",
             "elements.sources.citation.authorship.$",
             "elements.sources.nameUsedInSource",
@@ -96,7 +97,8 @@ public class DescriptionPortalController extends BaseController<DescriptionBase,
     protected static final List<String> DISTRIBUTION_INFO_INIT_STRATEGY = Arrays.asList(new String []{
             "sources.citation.authorship.$",
             "sources.nameUsedInSource",
-            "annotations"
+            "annotations",
+            "annotations.includes.$"
     });
 
     @Autowired
index 9d8f65a254f7cc115ddae4372ee3eea4880db1ce..4cba190f41e4ac29343a0e2b3824f5921dbab856 100644 (file)
@@ -39,6 +39,9 @@ public class MediaPortalController extends MediaController
             "rights.agent",\r
             "credits.agent",\r
             "representations.parts",\r
+            "annotations.$",\r
+            "annotations.type.$",\r
+            "annotations.type.includes.$",\r
             "allDescriptions",\r
             "sources.citation.authorship",\r
             "sources.links",\r
index fa35cad8fb463a1a41989baff42ec835ae0b3963..c6f757589e34002e9cc266b0558ff2997c8b1f51 100644 (file)
@@ -97,6 +97,8 @@ public class TaxonListController extends AbstractIdentifiableListController<Taxo
         super();
         setInitializationStrategy(Arrays.asList(new String[]{
                 "$",
+                "annotations.$",
+                "annotations.type.includes.$",
                 "name.nomenclaturalSource.citation"
                 }));
     }
index e6efd5f8174241588d15534104523740df761201..311f0f94c2c453f632dadfc89a4c3fa23bfc0d5e 100644 (file)
@@ -147,7 +147,9 @@ public class TaxonPortalController extends TaxonController{
             "secSource.nameUsedInSource.nomenclaturalSource.citation.authorship",
             "secSource.nameUsedInSource.nomenclaturalSource.citation.inReference.authorship",
             "secSource.citation.authorship.$",
-            "secSource.citation.inReference.authorship.$"
+            "secSource.citation.inReference.authorship.$",
+            "annotations.$",
+            "annotations.type.includes.$"
 //            "descriptions" // TODO remove
 
             }));
@@ -383,7 +385,7 @@ public class TaxonPortalController extends TaxonController{
 //      IVocabularyService vocabularyService = null;
 //      Map<PresenceAbsenceTerm, Color> distributionStatusColors = DistributionServiceUtilities.buildStatusColorMap(
 //              statusColorsString, termService, vocabularyService);
-        
+
         TaxonPageDtoConfiguration config = new TaxonPageDtoConfiguration();
 
         config.setTaxonUuid(taxonUuid);
index 55305973eea17342e477aee728eb6530c3e3677d..b51a33ef60c1dd6cc220f4fd34b061412a1cf106 100644 (file)
@@ -29,6 +29,8 @@ public class TaxonPortalListController extends TaxonListController {
     private static final EntityInitStrategy SIMPLE_TAXON_INIT_STRATEGY = TaxonPortalController.SIMPLE_TAXON_INIT_STRATEGY.clone().extend(
             null,
             Arrays.asList(
+            "annotations.$",
+            "annotations.type.includes.$",
             "synonym.name.nomenclaturalSource.citation.authorship",
             "synonym.name.nomenclaturalSource.citation.inReference.authorship",
             "relationsFromThisTaxon.toTaxon.taxonNodes" // needed for misapplications, see Taxon.isMisapplicationOnly()
index 96428480dae3f766b07a4ecffc651a79ae29775c..75237c845a86d802ab7c5e7541a7ddc376e841fc 100644 (file)
@@ -38,13 +38,15 @@ public class TermController
         extends AbstractIdentifiableController<DefinedTermBase, ITermService> {
 
     private static final List<String> TERM_COMPARE_INIT_STRATEGY = Arrays.asList(new String []{
-            "vocabulary"
+            "vocabulary",
+            "includes"
     });
 
     @Autowired
     @Override
     public void setService(ITermService service) {
         this.service = service;
+        setInitializationStrategy(TERM_COMPARE_INIT_STRATEGY);
     }
 
     /**
index c6769f0862a803b572db5b3b1b7d68ddb96ff340..b6562eb034e78c08f68f1a12eb5d1fde5242ba18 100644 (file)
@@ -25,6 +25,7 @@ import io.swagger.annotations.Api;
 @RequestMapping(value = {"/termNode/{uuid}"})
 public class TermNodeController extends BaseController<TermNode, ITermNodeService> {
 
+
     @Override
     @Autowired
     public void setService(ITermNodeService service) {
index 4470962c709ce7c083d7d16e3aed17d22375f51a..9a10b4d6e0481f2db56ef9db45dcf2be6c3884d0 100644 (file)
@@ -29,6 +29,7 @@ public class TermPortalController extends TermController {
     private static final List<String> DEFAULT_INIT_STRATEGY = Arrays.asList(new String []{
             "$",
             "vocabulary",
+            "includes",
             "countries" // NamedArea.countries
     });
 
index 53fc7ceafb8c0df70cc37aee6a0ba3a653e83265..7639510badc21f9549bfbe7a734eddfe9f5dc800 100644 (file)
@@ -8,6 +8,9 @@
 */
 package eu.etaxonomy.cdm.remote.controller;
 
+import java.util.Arrays;
+import java.util.List;
+
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,11 +31,19 @@ import io.swagger.annotations.Api;
 public class VocabularyListController extends AbstractIdentifiableListController<TermVocabulary, IVocabularyService> {
 
     private static final Logger logger = LogManager.getLogger();
+    private static final List<String> TERM_INIT_STRATEGY = Arrays.asList(
+            new String[]{
+                "terms.$",
+                "terms.includes.$",
+                "includes"
+            });
+
 
     @Autowired
     @Override
     public void setService(IVocabularyService service) {
         this.service = service;
+        setInitializationStrategy(TERM_INIT_STRATEGY);
     }