Project

General

Profile

« Previous | Next » 

Revision 5915a355

Added by Andreas Kohlbecker about 4 years ago

avoiding LIE in SpecimenTypeDesignationWorkingsetEditorPresenter collectors field and externatlizing init stratiegies

View differences:

src/main/java/eu/etaxonomy/cdm/service/initstrategies/AgentBaseInit.java
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.service.initstrategies;
10

  
11
import java.util.Arrays;
12
import java.util.List;
13

  
14
/**
15
 * @author a.kohlbecker
16
 * @since Apr 17, 2018
17
 *
18
 */
19
public class AgentBaseInit {
20

  
21
    public static final List<String> TEAM_OR_PERSON_INIT_STRATEGY = Arrays.asList(
22
            "$",
23
            "teamMembers.$"
24
            );
25

  
26
}
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java
37 37
import eu.etaxonomy.cdm.service.CdmFilterablePagingProvider;
38 38
import eu.etaxonomy.cdm.service.CdmStore;
39 39
import eu.etaxonomy.cdm.service.ISpecimenTypeDesignationWorkingSetService;
40
import eu.etaxonomy.cdm.service.initstrategies.AgentBaseInit;
40 41
import eu.etaxonomy.cdm.vaadin.component.CdmBeanItemContainerFactory;
41 42
import eu.etaxonomy.cdm.vaadin.component.CollectionRowItemCollection;
42 43
import eu.etaxonomy.cdm.vaadin.event.EntityChangeEvent;
......
164 165

  
165 166
        CdmFilterablePagingProvider<AgentBase, TeamOrPersonBase> termOrPersonPagingProvider = new CdmFilterablePagingProvider<AgentBase, TeamOrPersonBase>(getRepo().getAgentService(), TeamOrPersonBase.class);
166 167
        CdmFilterablePagingProvider<AgentBase, Person> personPagingProvider = new CdmFilterablePagingProvider<AgentBase, Person>(getRepo().getAgentService(), Person.class);
168
        personPagingProvider.setInitStrategy(AgentBaseInit.TEAM_OR_PERSON_INIT_STRATEGY);
167 169
        getView().getCollectorField().setFilterablePersonPagingProvider(personPagingProvider, this);
168 170
        getView().getCollectorField().setFilterableTeamPagingProvider(termOrPersonPagingProvider, this);
169 171

  
src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
37 37
import eu.etaxonomy.cdm.model.reference.ReferenceType;
38 38
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
39 39
import eu.etaxonomy.cdm.service.CdmFilterablePagingProvider;
40
import eu.etaxonomy.cdm.service.initstrategies.AgentBaseInit;
40 41
import eu.etaxonomy.cdm.vaadin.component.CdmBeanItemContainerFactory;
41 42
import eu.etaxonomy.cdm.vaadin.event.EditorActionTypeFilter;
42 43
import eu.etaxonomy.cdm.vaadin.event.EntityChangeEvent;
......
71 72

  
72 73
    private static final List<String> REFERENCE_INIT_STRATEGY = Arrays.asList("authorship", "inReference.authorship", "inReference.inReference.authorship", "inReference.inReference.inReference.authorship");
73 74

  
74
    private static final List<String> TEAM_OR_PERSON_INIT_STRATEGY = Arrays.asList(
75
            "$",
76
            "teamMembers.$"
77
            );
78

  
79 75
    private static final long serialVersionUID = -3538980627079389221L;
80 76

  
81 77
    private static final Logger logger = Logger.getLogger(TaxonNameEditorPresenter.class);
......
107 103
        getView().getRankSelect().setItemCaptionPropertyId("label");
108 104

  
109 105
        CdmFilterablePagingProvider<AgentBase, TeamOrPersonBase> termOrPersonPagingProvider = new CdmFilterablePagingProvider<AgentBase, TeamOrPersonBase>(getRepo().getAgentService(), TeamOrPersonBase.class);
110
        termOrPersonPagingProvider.setInitStrategy(TEAM_OR_PERSON_INIT_STRATEGY);
106
        termOrPersonPagingProvider.setInitStrategy(AgentBaseInit.TEAM_OR_PERSON_INIT_STRATEGY);
111 107
        CdmFilterablePagingProvider<AgentBase, Person> personPagingProvider = new CdmFilterablePagingProvider<AgentBase, Person>(getRepo().getAgentService(), Person.class);
112 108

  
113 109
        getView().getCombinationAuthorshipField().setFilterableTeamPagingProvider(termOrPersonPagingProvider, this);

Also available in: Unified diff