Revision 4625a011
Added by Katja Luther over 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java | ||
---|---|---|
116 | 116 |
CdmPreference preference = null; |
117 | 117 |
if (preferredCode == null){ |
118 | 118 |
preference = controller.getPreferenceService().find(key); |
119 |
int index = StringUtils.lastIndexOf(preference.getValue(), "."); |
|
120 |
UUID uuid = UUID.fromString(preference.getValue().substring(index +1, preference.getValue().length())); |
|
121 |
preferredCode = NomenclaturalCode.getByUuid(uuid); |
|
119 |
if (preference == null){ |
|
120 |
return; |
|
121 |
} else{ |
|
122 |
int index = StringUtils.lastIndexOf(preference.getValue(), "."); |
|
123 |
UUID uuid = UUID.fromString(preference.getValue().substring(index +1, preference.getValue().length())); |
|
124 |
preferredCode = NomenclaturalCode.getByUuid(uuid); |
|
125 |
} |
|
122 | 126 |
} else{ |
123 | 127 |
preference = CdmPreference.NewInstance(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.NomenclaturalCode, preferredCode.getKey()); |
124 | 128 |
controller.getPreferenceService().set(preference); |
Also available in: Unified diff
ref #5969: check if there is a NC preference in db if not use the local NC preference