Project

General

Profile

« Previous | Next » 

Revision 43dfebed

Added by Andreas Kohlbecker about 6 years ago

fixing LIEs related to adding removing basionyms in TaxonNameEditor

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
110 110
                "basionymAuthorship",
111 111
                "exBasionymAuthorship",
112 112

  
113
                "basionyms.rank",
114
                "basionyms.nomenclaturalReference.authorship",
115
                "basionyms.nomenclaturalReference.inReference",
113
                // basionyms: relationsToThisName.fromName
114
                "relationsToThisName.type",
115
                "relationsToThisName.fromName.rank",
116
                "relationsToThisName.fromName.nomenclaturalReference.authorship",
117
                "relationsToThisName.fromName.nomenclaturalReference.inReference",
118
                "relationsToThisName.fromName.relationsToThisName",
119
                "relationsToThisName.fromName.relationsFromThisName",
120

  
121
                "relationsFromThisName",
122
                //"relationsToThisName",
123
                "homotypicalGroup.typifiedNames"
116 124

  
117 125
                }
118 126
        );
......
149 157

  
150 158
    @Override
151 159
    protected TaxonName handleTransientProperties(TaxonName bean) {
160

  
152 161
        logger.trace(this._toString() + ".onEditorSaveEvent - handling transient properties");
153 162
        List<TaxonName> newBasionymNames = getView().getBasionymCombobox().getValueFromNestedFields();
154 163
        Set<TaxonName> oldBasionyms = bean.getBasionyms();
155 164
        boolean updateBasionyms = false;
156
        for(TaxonName newB : newBasionymNames){
157 165

  
166
        for(TaxonName newB : newBasionymNames){
158 167
            updateBasionyms = updateBasionyms || !oldBasionyms.contains(newB);
159 168
        }
169

  
160 170
        for(TaxonName oldB : oldBasionyms){
161 171
            updateBasionyms = updateBasionyms || !newBasionymNames.contains(oldB);
162 172
        }
173

  
163 174
        if(updateBasionyms){
164 175
            bean.removeBasionyms();
165 176
            for(TaxonName basionymName :newBasionymNames){
166 177
                if(basionymName != null){
167 178
                    if(basionymName .getUuid() != null){
168 179
                        // reload
169
                        basionymName = getRepo().getNameService().load(basionymName.getUuid());
180
                        basionymName = getRepo().getNameService().load(basionymName.getUuid(), Arrays.asList("$", "relationsFromThisName", "homotypicalGroup.typifiedNames"));
170 181
                    }
171 182
                    bean.addBasionym(basionymName);
172 183
                }

Also available in: Unified diff