Revision 2a7c9630
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NomenclaturalCodePreferences.java | ||
---|---|---|
94 | 94 |
String value = getPreferenceStore().getString(IPreferenceKeys.PREFERRED_NOMENCLATURAL_CODE_KEY); |
95 | 95 |
CdmPreference pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.NomenclaturalCode, value); |
96 | 96 |
ICdmApplicationConfiguration controller = CdmStore.getCurrentApplicationConfiguration(); |
97 |
if (controller == null){ |
|
98 |
return false; |
|
99 |
} |
|
97 | 100 |
IPreferenceService service = controller.getPreferenceService(); |
98 | 101 |
service.set(pref); |
99 | 102 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java | ||
---|---|---|
114 | 114 |
controller = CdmStore.getCurrentApplicationConfiguration(); |
115 | 115 |
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.NomenclaturalCode); |
116 | 116 |
CdmPreference preference = null; |
117 |
if (controller == null){ |
|
118 |
return; |
|
119 |
} |
|
117 | 120 |
if (preferredCode == null){ |
118 | 121 |
preference = controller.getPreferenceService().find(key); |
119 | 122 |
if (preference == null){ |
Also available in: Unified diff
ref #5969: check for db connection before ty to read the preferred nomenclatural code