Revision 525bc165
Added by Katja Luther almost 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalReferenceSelectionDialog.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.text.Collator; |
4 | 4 |
import java.util.Comparator; |
5 |
import java.util.HashMap; |
|
5 | 6 |
import java.util.List; |
6 | 7 |
|
7 | 8 |
import org.apache.commons.lang.StringUtils; |
... | ... | |
55 | 56 |
pattern = author.getNomenclaturalTitle(); |
56 | 57 |
if (control!= null){ |
57 | 58 |
firstCall = false; |
58 |
model = CdmStore.getService(IReferenceService.class).getUuidAndAbbrevTitleCacheForAuthor(limitOfInitialElements, pattern, null);
|
|
59 |
model = CdmStore.getService(IReferenceService.class).getUuidAndAbbrevTitleCacheForAuthor(null, pattern, null);
|
|
59 | 60 |
|
60 | 61 |
} |
61 | 62 |
|
62 | 63 |
}else{ |
63 | 64 |
|
64 |
if (isUseIdentifier()){ |
|
65 |
List<IdentifiedEntityDTO<Reference>> list = CdmStore.getService(IReferenceService.class).listByIdentifierAbbrev(pattern, null, MatchMode.BEGINNING, limitOfInitialElements); |
|
65 |
if (isUseIdentifier() && PreferencesUtil.getBooleanValue(IPreferenceKeys.SEARCH_FOR_IDENTIFIER_AND_TITLECACHE)){
|
|
66 |
List<IdentifiedEntityDTO<Reference>> list = CdmStore.getService(IReferenceService.class).listByIdentifierAndTitleCacheAbbrev(pattern, null, MatchMode.BEGINNING, limitOfInitialElements);
|
|
66 | 67 |
if (model!= null){ |
67 | 68 |
model.clear(); |
68 | 69 |
} |
70 |
identifierMap = new HashMap(); |
|
69 | 71 |
for (IdentifiedEntityDTO dto: list){ |
72 |
if (dto.getIdentifier() != null){ |
|
73 |
identifierMap.put(dto.getCdmEntity().getUuid(), dto.getIdentifier()); |
|
74 |
} |
|
75 |
model.add(dto.getCdmEntity()); |
|
70 | 76 |
|
77 |
} |
|
78 |
}else if (isUseIdentifier() ){ |
|
79 |
List<IdentifiedEntityDTO<Reference>> list = CdmStore.getService(IReferenceService.class).listByIdentifierAbbrev(pattern, null, MatchMode.BEGINNING, limitOfInitialElements); |
|
80 |
if (model!= null){ |
|
81 |
model.clear(); |
|
82 |
} |
|
83 |
identifierMap = new HashMap(); |
|
84 |
for (IdentifiedEntityDTO dto: list){ |
|
85 |
identifierMap.put(dto.getCdmEntity().getUuid(), dto.getIdentifier()); |
|
71 | 86 |
model.add(dto.getCdmEntity()); |
72 | 87 |
} |
88 |
|
|
73 | 89 |
}else{ |
74 |
model = CdmStore.getService(IReferenceService.class).getUuidAndAbbrevTitleCache(limitOfInitialElements, pattern);
|
|
90 |
model = CdmStore.getService(IReferenceService.class).getUuidAndAbbrevTitleCache(null, pattern);
|
|
75 | 91 |
} |
76 | 92 |
|
77 | 93 |
} |
Also available in: Unified diff
add identifier and titlecache to nomenclatural reference seaarch dialog