Project

General

Profile

« Previous | Next » 

Revision 25b3a146

Added by Katja Luther over 3 years ago

ref #8774: save method for new characternodes

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITermNodeService.java
10 10
package eu.etaxonomy.cdm.api.service;
11 11

  
12 12
import java.util.List;
13
import java.util.Map;
13 14
import java.util.UUID;
14 15

  
15 16
import eu.etaxonomy.cdm.api.service.config.TermNodeDeletionConfigurator;
17
import eu.etaxonomy.cdm.model.description.Character;
16 18
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
17 19
import eu.etaxonomy.cdm.model.term.TermNode;
18 20
import eu.etaxonomy.cdm.model.term.TermType;
......
85 87

  
86 88
    /**
87 89
     * @param dtos
90
     * @param vocabularyUuid
88 91
     * @return
89 92
     */
90
    public UpdateResult saveCharacterNodeDtoList(List<CharacterNodeDto> dtos);
93
    UpdateResult saveNewCharacterNodeDtoMap(Map<Character, CharacterNodeDto> dtos, UUID vocabularyUuid);
94

  
95
    /**
96
     * @param dtos
97
     * @return
98
     */
99
    UpdateResult saveCharacterNodeDtoList(List<CharacterNodeDto> dtos);
100

  
101

  
102

  
91 103

  
92 104
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TermNodeServiceImpl.java
13 13
import java.util.HashSet;
14 14
import java.util.Iterator;
15 15
import java.util.List;
16
import java.util.Map;
17
import java.util.Map.Entry;
16 18
import java.util.Set;
17 19
import java.util.UUID;
18 20

  
......
249 251
        return result;
250 252
    }
251 253

  
254

  
255

  
252 256
    @Override
253 257
    public UpdateResult saveCharacterNodeDtoList(List<CharacterNodeDto> dtos){
254 258
        MergeResult<TermNode> mergeResult;
......
396 400
        return result;
397 401
    }
398 402

  
403
    @Override
404
    public UpdateResult saveNewCharacterNodeDtoMap(Map<Character, CharacterNodeDto> dtos, UUID vocabularyUuid){
405
        UpdateResult result = new UpdateResult();
406
        for (Entry<Character, CharacterNodeDto> dtoEntry: dtos.entrySet()){
407
            result.includeResult(createChildNode(dtoEntry.getValue().getParentUuid(), dtoEntry.getKey(), vocabularyUuid));
408
        }
409
        List<CharacterNodeDto> dtoList = new ArrayList<>(dtos.values());
410
        result.includeResult(saveCharacterNodeDtoList(dtoList));
411
        return result;
412

  
413
    }
414

  
415

  
399 416

  
400 417
}

Also available in: Unified diff