Revision c11a2278
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/SpecimenAdminPreferences.java | ||
---|---|---|
14 | 14 |
import eu.etaxonomy.cdm.api.service.IPreferenceService; |
15 | 15 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference; |
16 | 16 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey; |
17 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
|
18 | 17 |
import eu.etaxonomy.cdm.model.metadata.PreferenceSubject; |
18 |
import eu.etaxonomy.taxeditor.preference.EditorPreferencePredicate; |
|
19 | 19 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
20 | 20 |
import eu.etaxonomy.taxeditor.preference.SpecimenOrObservationPreferences; |
21 | 21 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
... | ... | |
146 | 146 |
ICdmRepository controller = CdmStore.getCurrentApplicationConfiguration(); |
147 | 147 |
if (controller != null){ |
148 | 148 |
IPreferenceService service = controller.getPreferenceService(); |
149 |
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowSpecimen); |
|
149 |
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), EditorPreferencePredicate.ShowSpecimen);
|
|
150 | 150 |
showSpecimenPref = service.find(key); |
151 | 151 |
if (showSpecimenPref != null){ |
152 | 152 |
this.isShowSpecimenRelatedIssues = Boolean.valueOf(showSpecimenPref.getValue()); |
153 | 153 |
this.allowOverrideShowSpecimenRelatedIssues = showSpecimenPref.isAllowOverride(); |
154 | 154 |
}else{ |
155 |
showSpecimenPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimen, Boolean.toString(true)); |
|
155 |
showSpecimenPref = CdmPreference.NewTaxEditorInstance(EditorPreferencePredicate.ShowSpecimen, Boolean.toString(true));
|
|
156 | 156 |
this.isShowSpecimenRelatedIssues = true; |
157 | 157 |
this.allowOverrideShowSpecimenRelatedIssues = true; |
158 | 158 |
} |
159 | 159 |
|
160 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowCollectingAreasInGeneralSection); |
|
160 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), EditorPreferencePredicate.ShowCollectingAreasInGeneralSection);
|
|
161 | 161 |
CdmPreference isShowCollectingAreaInGeneralSectionPref = service.find(key); |
162 | 162 |
if (isShowCollectingAreaInGeneralSectionPref != null){ |
163 | 163 |
this.isShowCollectingAreaInGeneralSection = Boolean.valueOf(isShowCollectingAreaInGeneralSectionPref.getValue()); |
164 | 164 |
this.allowOverrideShowCollectingAreaInGeneralSection = isShowCollectingAreaInGeneralSectionPref.isAllowOverride(); |
165 | 165 |
} |
166 | 166 |
|
167 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.DeterminationOnlyForFieldUnits); |
|
167 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), EditorPreferencePredicate.DeterminationOnlyForFieldUnits);
|
|
168 | 168 |
CdmPreference isDeterminationOnlyForFieldUnitsPref = service.find(key); |
169 | 169 |
if (isDeterminationOnlyForFieldUnitsPref != null){ |
170 | 170 |
this.isDeterminationOnlyForFieldUnits = Boolean.valueOf(isDeterminationOnlyForFieldUnitsPref.getValue()); |
171 | 171 |
this.allowOverrideDeterminationOnlyForFieldUnits = isDeterminationOnlyForFieldUnitsPref.isAllowOverride(); |
172 | 172 |
} |
173 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonAssociations); |
|
173 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), EditorPreferencePredicate.ShowTaxonAssociations);
|
|
174 | 174 |
CdmPreference isShowTaxonAssociationPref = service.find(key); |
175 | 175 |
if (isShowTaxonAssociationPref != null){ |
176 | 176 |
this.isShowTaxonAssociation = Boolean.valueOf(isShowTaxonAssociationPref.getValue()); |
177 | 177 |
this.allowOverrideShowTaxonAssociation = isShowTaxonAssociationPref.isAllowOverride(); |
178 | 178 |
} |
179 | 179 |
|
180 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowLifeForm); |
|
180 |
key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), EditorPreferencePredicate.ShowLifeForm);
|
|
181 | 181 |
CdmPreference isShowLifeFormPref = service.find(key); |
182 | 182 |
if (isShowLifeFormPref != null){ |
183 | 183 |
this.isShowLifeForm = Boolean.valueOf(isShowLifeFormPref.getValue()); |
... | ... | |
196 | 196 |
if (controller != null){ |
197 | 197 |
IPreferenceService service = controller.getPreferenceService(); |
198 | 198 |
|
199 |
CdmPreference pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowCollectingAreasInGeneralSection, Boolean.toString(this.isShowCollectingAreaInGeneralSection)); |
|
199 |
CdmPreference pref = CdmPreference.NewTaxEditorInstance(EditorPreferencePredicate.ShowCollectingAreasInGeneralSection, Boolean.toString(this.isShowCollectingAreaInGeneralSection));
|
|
200 | 200 |
pref.setAllowOverride(allowOverrideShowCollectingAreaInGeneralSection); |
201 | 201 |
service.set(pref); |
202 |
pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimen, Boolean.toString(this.isShowSpecimenRelatedIssues)); |
|
202 |
pref = CdmPreference.NewTaxEditorInstance(EditorPreferencePredicate.ShowSpecimen, Boolean.toString(this.isShowSpecimenRelatedIssues));
|
|
203 | 203 |
pref.setAllowOverride(allowOverrideShowSpecimenRelatedIssues); |
204 | 204 |
service.set(pref); |
205 | 205 |
|
206 |
pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.DeterminationOnlyForFieldUnits, Boolean.toString(this.isDeterminationOnlyForFieldUnits)); |
|
206 |
pref = CdmPreference.NewTaxEditorInstance(EditorPreferencePredicate.DeterminationOnlyForFieldUnits, Boolean.toString(this.isDeterminationOnlyForFieldUnits));
|
|
207 | 207 |
pref.setAllowOverride(allowOverrideDeterminationOnlyForFieldUnits); |
208 | 208 |
service.set(pref); |
209 | 209 |
|
210 |
pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowTaxonAssociations, Boolean.toString(this.isShowTaxonAssociation)); |
|
210 |
pref = CdmPreference.NewTaxEditorInstance(EditorPreferencePredicate.ShowTaxonAssociations, Boolean.toString(this.isShowTaxonAssociation));
|
|
211 | 211 |
pref.setAllowOverride(allowOverrideShowTaxonAssociation); |
212 | 212 |
service.set(pref); |
213 | 213 |
|
214 |
pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowLifeForm, Boolean.toString(this.isShowLifeForm)); |
|
214 |
pref = CdmPreference.NewTaxEditorInstance(EditorPreferencePredicate.ShowLifeForm, Boolean.toString(this.isShowLifeForm));
|
|
215 | 215 |
pref.setAllowOverride(allowOverrideShowLifeForm); |
216 | 216 |
service.set(pref); |
217 | 217 |
PreferencesUtil.updateDBPreferences(); |
Also available in: Unified diff
fix delete of not persisted data in bulk editor