Project

General

Profile

Revision 73f4ae84

ID73f4ae846196e72d5a3e000bb017df18ca61d652
Parent bfc8c153
Child 1364ddca

Added by Andreas Kohlbecker 2 months ago

ref #9193 fixing/extending init strategy in TaxonPortalListController

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/initializer/EntityInitStrategy.java
83 83
    public List<String> getPropertyPaths() {
84 84
        return propertyPaths;
85 85
    }
86

  
87
    @Override
88
    public EntityInitStrategy clone() {
89
        return new EntityInitStrategy(this.propertyPaths);
90

  
91
    }
86 92
}
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonListController.java
53 53
import eu.etaxonomy.cdm.model.location.NamedArea;
54 54
import eu.etaxonomy.cdm.model.name.Rank;
55 55
import eu.etaxonomy.cdm.model.taxon.Classification;
56
import eu.etaxonomy.cdm.model.taxon.Synonym;
56 57
import eu.etaxonomy.cdm.model.taxon.Taxon;
57 58
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
58 59
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
......
84 85
public class TaxonListController extends AbstractIdentifiableListController<TaxonBase, ITaxonService> {
85 86

  
86 87
    private static final List<String> SIMPLE_TAXON_INIT_STRATEGY = DEFAULT_INIT_STRATEGY;
88

  
87 89
    protected List<String> getSimpleTaxonInitStrategy() {
88 90
        return SIMPLE_TAXON_INIT_STRATEGY;
89 91
    }
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonPortalController.java
132 132
            "taxonNodes.childNodes.$"
133 133
            }));
134 134

  
135
    private static final EntityInitStrategy SIMPLE_TAXON_INIT_STRATEGY = new EntityInitStrategy(Arrays.asList(new String []{
135
    public static final EntityInitStrategy SIMPLE_TAXON_INIT_STRATEGY = new EntityInitStrategy(Arrays.asList(new String []{
136 136
            "$",
137 137
            // the name
138 138
            "name.$",
139 139
            "name.rank.representations",
140 140
            "name.status.type.representations",
141 141
            "name.nomenclaturalReference.authorship",
142
            "name.nomenclaturalReference.inReference",
142
            "name.nomenclaturalReference.inReference.authorship",
143 143
            "taxonNodes.classification",
144 144
            "sec.authorship"
145 145
            }));
146 146

  
147
    private static final EntityInitStrategy SYNONYMY_INIT_STRATEGY = new EntityInitStrategy(Arrays.asList(new String []{
147
    public static final EntityInitStrategy SYNONYMY_INIT_STRATEGY = new EntityInitStrategy(Arrays.asList(new String []{
148 148
            // initialize homotypical and heterotypical groups; needs synonyms
149 149
            "synonyms.$",
150 150
            "synonyms.name.status.type.representations",
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonPortalListController.java
13 13
import org.springframework.stereotype.Controller;
14 14
import org.springframework.web.bind.annotation.RequestMapping;
15 15

  
16
import eu.etaxonomy.cdm.persistence.dao.initializer.EntityInitStrategy;
16 17
import io.swagger.annotations.Api;
17 18

  
18 19
/**
......
25 26
@RequestMapping(value = {"/portal/taxon"})
26 27
public class TaxonPortalListController extends TaxonListController {
27 28

  
28
    private static final List<String> SIMPLE_TAXON_INIT_STRATEGY = Arrays.asList(new String []{
29
            //"$",
30
            "name.$",
31
            "name.rank.representations",
32
            "name.status.type.representations",
33
            "name.nomenclaturalReference.authorship",
34
            "name.nomenclaturalReference.inReference.authorship",
35
            "taxonNodes.classification",
29
    private static final EntityInitStrategy SIMPLE_TAXON_INIT_STRATEGY = TaxonPortalController.SIMPLE_TAXON_INIT_STRATEGY.clone().extend(
30
            null,
31
            Arrays.asList(
36 32
            "synonym.name.nomenclaturalReference.authorship",
37
            "synonym.name.nomenclaturalReference.inReference.authorship",
38
            });
33
            "synonym.name.nomenclaturalReference.inReference.authorship"),
34
            false
35
            );
36

  
39 37

  
40 38
    public TaxonPortalListController() {
41 39
        super();
42
        setInitializationStrategy(SIMPLE_TAXON_INIT_STRATEGY);
40
        setInitializationStrategy(SIMPLE_TAXON_INIT_STRATEGY.getPropertyPaths());
43 41
    }
44 42

  
45 43
    @Override
46 44
    protected List<String> getSimpleTaxonInitStrategy() {
47
        return SIMPLE_TAXON_INIT_STRATEGY;
45
        return SIMPLE_TAXON_INIT_STRATEGY.getPropertyPaths();
48 46
    }
49 47

  
50 48

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)