Project

General

Profile

Revision 292fe199

ID292fe199f906fa842865e59390dbdba62af75dbb
Parent 6e9595e7
Child 0bd9db14

Added by Andreas Müller over 2 years ago

ref #6446, ref #6368 remove TaxonnameBase in vaadin,

View differences:

src/main/java/eu/etaxonomy/cdm/mock/Registration.java
17 17
import eu.etaxonomy.cdm.model.agent.Institution;
18 18
import eu.etaxonomy.cdm.model.common.CdmBase;
19 19
import eu.etaxonomy.cdm.model.common.User;
20
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
20
import eu.etaxonomy.cdm.model.name.TaxonName;
21 21
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
22 22

  
23 23
/**
......
39 39

  
40 40
    private Institution institution;
41 41

  
42
    private TaxonNameBase name;
42
    private TaxonName name;
43 43

  
44 44
    private Set<TypeDesignationBase> typeDesignations = new HashSet<>();
45 45

  
......
135 135
    /**
136 136
     * @return the name
137 137
     */
138
    public TaxonNameBase getName() {
138
    public TaxonName getName() {
139 139
        return name;
140 140
    }
141 141

  
142 142
    /**
143 143
     * @param name the name to set
144 144
     */
145
    public void setName(TaxonNameBase name) {
145
    public void setName(TaxonName name) {
146 146
        this.name = name;
147 147
    }
148 148

  
src/main/java/eu/etaxonomy/cdm/mock/RegistrationService.java
25 25
import eu.etaxonomy.cdm.api.application.CdmRepository;
26 26
import eu.etaxonomy.cdm.model.common.CdmBase;
27 27
import eu.etaxonomy.cdm.model.name.Rank;
28
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
28
import eu.etaxonomy.cdm.model.name.TaxonName;
29 29
import eu.etaxonomy.cdm.vaadin.model.registration.RegistrationWorkingSet;
30 30
import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationDTO;
31 31
import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationValidationException;
......
64 64
            TransactionStatus tx = repo.startTransaction(true);
65 65
            int pageIndex = 0;
66 66
            while(registrationsByUUID.size() < SIZE){
67
                List<TaxonNameBase> names = repo.getNameService().list(TaxonNameBase.class, 100, pageIndex++, null, null);
67
                List<TaxonName> names = repo.getNameService().list(TaxonName.class, 100, pageIndex++, null, null);
68 68
                if(names.isEmpty()){
69 69
                    break;
70 70
                }
71
                for(TaxonNameBase name : names){
71
                for(TaxonName name : names){
72 72
                    if(name != null && name.getRank() != null && name.getRank().isLower(Rank.SUBFAMILY())){
73 73
                        if(name.getTypeDesignations().size() > minTypeDesignationCount - 1) {
74 74

  
src/main/java/eu/etaxonomy/cdm/vaadin/component/taxon/NewTaxonBasePresenter.java
26 26
import eu.etaxonomy.cdm.api.service.pager.Pager;
27 27
import eu.etaxonomy.cdm.model.common.CdmBase;
28 28
import eu.etaxonomy.cdm.model.name.INonViralName;
29
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
29
import eu.etaxonomy.cdm.model.name.TaxonName;
30 30
import eu.etaxonomy.cdm.model.reference.Reference;
31 31
import eu.etaxonomy.cdm.model.taxon.Classification;
32 32
import eu.etaxonomy.cdm.model.taxon.Synonym;
......
81 81
    }
82 82

  
83 83
    private boolean checkIfNameExists(INonViralName nvn) {
84
        TaxonNameBase<?,?> name = TaxonNameBase.castAndDeproxy(nvn);
85
        Pager<TaxonNameBase> names = nameService.findByName(name.getClass(),
84
        TaxonName name = TaxonName.castAndDeproxy(nvn);
85
        Pager<TaxonName> names = nameService.findByName(name.getClass(),
86 86
                name.getNameCache(),
87 87
                MatchMode.EXACT,
88 88
                null,
src/main/java/eu/etaxonomy/cdm/vaadin/jscomponent/D3ConceptRelationshipTree.java
26 26
import com.vaadin.ui.JavaScriptFunction;
27 27

  
28 28
import elemental.json.JsonArray;
29
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
29
import eu.etaxonomy.cdm.model.name.TaxonName;
30 30
import eu.etaxonomy.cdm.model.taxon.Taxon;
31 31
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
32 32
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
......
92 92
                    UUID relUuid = UUID.fromString(arguments.getString(0));
93 93
                    conceptRelComposite.setSelectedTaxonRelUuid(relUuid);
94 94
                }
95
				
95

  
96 96
			}
97 97
        });
98 98
        setConceptRelationshipTree("");
......
222 222
    }
223 223

  
224 224

  
225
    public String getAbbreviatedName(TaxonNameBase tnb) {
225
    public String getAbbreviatedName(TaxonName tnb) {
226 226
        List<TaggedText> taggedTextList = tnb.getTaggedName();
227 227
        StringBuffer nameSb = new StringBuffer();
228 228
        boolean foundGenusOrUninomial = false;
src/main/java/eu/etaxonomy/cdm/vaadin/model/DbTableDTO.java
5 5

  
6 6
import eu.etaxonomy.cdm.model.common.CdmBase;
7 7
import eu.etaxonomy.cdm.model.name.Rank;
8
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
8
import eu.etaxonomy.cdm.model.name.TaxonName;
9 9
import eu.etaxonomy.cdm.model.taxon.Taxon;
10 10

  
11 11

  
......
47 47
	 * @return
48 48
	 */
49 49
	public String getFullTitleCache() {
50
		TaxonNameBase name = taxon.getName();
51
		name = CdmBase.deproxy(name, TaxonNameBase.class);
50
		TaxonName name = taxon.getName();
51
		name = CdmBase.deproxy(name);
52 52
		if(name ==  null){
53 53
			return "-";
54 54
		}
src/main/java/eu/etaxonomy/cdm/vaadin/model/registration/RegistrationWorkingSet.java
17 17

  
18 18
import eu.etaxonomy.cdm.mock.Registration;
19 19
import eu.etaxonomy.cdm.mock.RegistrationStatus;
20
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
21 20
import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationDTO;
22 21
import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationValidationException;
23 22

  
src/main/java/eu/etaxonomy/cdm/vaadin/util/converter/TypeDesignationConverter.java
21 21
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
22 22
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
23 23
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
24
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
24
import eu.etaxonomy.cdm.model.name.TaxonName;
25 25
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
26 26
import eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase;
27 27

  
......
51 51
     * @param taxonNameBase
52 52
     *
53 53
     */
54
    public TypeDesignationConverter(Collection<TypeDesignationBase> typeDesignations, TaxonNameBase taxonNameBase) {
54
    public TypeDesignationConverter(Collection<TypeDesignationBase> typeDesignations, TaxonName taxonNameBase) {
55 55
        this.typeDesignations = typeDesignations;
56 56
        orderedStrings = new HashMap<>(typeDesignations.size());
57 57
        if(taxonNameBase != null){
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationDTO.java
19 19
import eu.etaxonomy.cdm.mock.Registration;
20 20
import eu.etaxonomy.cdm.mock.RegistrationStatus;
21 21
import eu.etaxonomy.cdm.model.common.TimePeriod;
22
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
22
import eu.etaxonomy.cdm.model.name.TaxonName;
23 23
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
24 24
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
25 25
import eu.etaxonomy.cdm.model.reference.Reference;
......
41 41

  
42 42
    private Set<Registration> blockedBy = new HashSet<>();
43 43

  
44
    private TaxonNameBase<?, ?> typifiedName;
44
    private TaxonName typifiedName;
45 45

  
46 46
    private TimePeriod datePublished;
47 47

  
......
92 92
     * @return
93 93
     * @throws RegistrationValidationException
94 94
     */
95
    private TaxonNameBase<?,?> findTypifiedName() throws RegistrationValidationException {
95
    private TaxonName findTypifiedName() throws RegistrationValidationException {
96 96

  
97 97
        List<String> problems = new ArrayList<>();
98 98

  
99
        TaxonNameBase<?,?> typifiedName = null;
99
        TaxonName typifiedName = null;
100 100

  
101 101
        for(TypeDesignationBase<?> typeDesignation : reg.getTypeDesignations()){
102 102
            typeDesignation.getTypifiedNames();
......
116 116
                typifiedName = typeDesignation.getTypifiedNames().iterator().next();
117 117
            } else {
118 118
                // compare
119
                TaxonNameBase<?,?> otherTypifiedName = typeDesignation.getTypifiedNames().iterator().next();
119
                TaxonName otherTypifiedName = typeDesignation.getTypifiedNames().iterator().next();
120 120
                if(typifiedName.getId() != otherTypifiedName.getId()){
121 121
                  //TODO instead throw RegistrationValidationException()
122 122
                    problems.add("Multiple typifiedName in " + typeDesignation.toString());
src/test/java/eu/etaxonomy/cdm/vaadin/presenter/ConceptRelationshipPresenterTest.java
22 22
import eu.etaxonomy.cdm.api.application.ICdmRepository;
23 23
import eu.etaxonomy.cdm.api.service.INameService;
24 24
import eu.etaxonomy.cdm.model.common.CdmBase;
25
import eu.etaxonomy.cdm.model.name.BotanicalName;
25
import eu.etaxonomy.cdm.model.name.TaxonName;
26 26
import eu.etaxonomy.cdm.vaadin.CdmVaadinBaseTest;
27 27
import eu.etaxonomy.cdm.vaadin.component.taxon.ConceptRelationshipPresenter;
28 28
import eu.etaxonomy.cdm.vaadin.container.IdUuidName;
......
77 77
    public void testAbbreviatedNameGeneration() {
78 78
        TransactionStatus tx = app.startTransaction();
79 79
        UUID nameUuid = UUID.fromString("7ebe3f1f-c383-4611-95da-4ee633a12d3a");
80
        BotanicalName name = CdmBase.deproxy(nameService.load(nameUuid), BotanicalName.class);
80
        TaxonName name = CdmBase.deproxy(nameService.load(nameUuid));
81 81

  
82 82
        String abbreviatedName = crTree.getAbbreviatedName(name);
83 83
        Assert.assertEquals("T. × withverylongspecificepithet subsp.", abbreviatedName);
src/test/java/eu/etaxonomy/cdm/vaadin/util/converter/TypeDesignationConverterTest.java
20 20
import eu.etaxonomy.cdm.model.name.Rank;
21 21
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
22 22
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
23
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
23
import eu.etaxonomy.cdm.model.name.TaxonName;
24 24
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
25 25
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
26 26
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
......
41 41
    public void test1(){
42 42

  
43 43
        NameTypeDesignation ntd = NameTypeDesignation.NewInstance();
44
        TaxonNameBase typeName = TaxonNameFactory.NewBacterialInstance(Rank.SPECIES());
44
        TaxonName typeName = TaxonNameFactory.NewBacterialInstance(Rank.SPECIES());
45 45
        typeName.setTitleCache("Prionus coriatius L.", true);
46 46
        ntd.setTypeName(typeName);
47 47
        Reference citation = ReferenceFactory.newGeneric();

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)