- /**
- * Get the match strategy for the given class that was stored in preferences
- * or the default strategy if it was not stored in preferences
- *
- * @param clazz
- * a {@link java.lang.Class} object.
- * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
- */
- public static IMatchStrategy getMatchStrategy(Class<?> clazz) {
- String className = clazz.getName();
- if (getBooleanValue(MATCH_STRATEGY_PREFIX + className)) {
- IMatchStrategy matchStrategy = getDefaultMatchStrategy(clazz);
-
- for (String fieldName : matchStrategy.getMatchFieldPropertyNames()) {
- String matchModeName = getStringValue(
- getMatchStrategyFieldName(className, fieldName));
- MatchMode matchMode = MatchMode.valueOf(matchModeName);
- try {
- matchStrategy.setMatchMode(fieldName, matchMode);
- } catch (MatchException e) {
- MessagingUtils.error(PreferencesUtil.class, e);
- throw new RuntimeException(e);
- }
- }
-
- return matchStrategy;
- }
- return getDefaultMatchStrategy(clazz);
- }
-
- /**
- * Stores a matchStrategy into the preference store.
- *
- * @param matchStrategy
- * a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy}
- * object.
- */
- public static void setMatchStrategy(IMatchStrategy matchStrategy) {
- String className = matchStrategy.getMatchClass().getName();
- setBooleanValue(MATCH_STRATEGY_PREFIX + className, true);
-
- Set<String> matchFields = matchStrategy.getMatchFieldPropertyNames();
-
- for (String fieldName : matchFields) {
- setStringValue(
- getMatchStrategyFieldName(className, fieldName),
- matchStrategy.getMatching().getFieldMatcher(fieldName).getMatchMode().name());
- }
- }
-
- /**
- * Helper method to create the preference property for a match field.
- *
- * @param className
- * @param fieldName
- * @return
- */
- private static String getMatchStrategyFieldName(String className,
- String fieldName) {
- return MATCH_STRATEGY_PREFIX + className + "." + fieldName;
- }
-
- /**
- * Returns the default match strategy for a given class.
- *
- * @param clazz
- * a {@link java.lang.Class} object.
- * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
- */
- public static IMatchStrategy getDefaultMatchStrategy(Class clazz) {
- return DefaultMatchStrategy.NewInstance(clazz);
- }
-
- /**
- * <p>
- * getDateFormatPattern
- * </p>
- *
- * @return a {@link java.lang.String} object.
- */
- public static String getDateFormatPattern() {
- // TODO make this configurable in properties
- String pattern = "Y-M-d H:m";
- return pattern;
- }
-
- /**
- * <p>
- * addTermToPreferredTerms
- * </p>
- *
- * @param term
- * a T object.
- * @param <T>
- * a T object.
- */
- public static <T extends TermBase> void addTermToPreferredTerms(T term) {
-
- // VocabularyEnum vocabulary =
- // VocabularyEnum.getVocabularyEnum(term.getClass());
- //
- // getPreferenceStore().setValue(getPreferenceKey(term),
- // VocabularyStore.getTermVocabulary(vocabulary).getTerms().contains(term));
- //
- // firePreferencesChanged(term.getClass());
- }
-
- /**
- * Construct a unique key using the CdmBase object's uuid
- *
- * @param cdmBase
- * @return
- */
- private static String getPreferenceKey(ICdmBase cdmBase) {
- cdmBase = HibernateProxyHelper.deproxy(cdmBase);
-
- String key = cdmBase.getClass().getName().concat(".")
- .concat(cdmBase.getUuid().toString());
- if (key.contains("javassist")) {
- MessagingUtils.info("proxy");
- }
- return key;
- }
-
- /**
- * Construct a unique key using the CdmBase object's uuid
- *
- * @param cdmBase
- * @return
- */
- public static String getPreferenceKey(ISimpleTerm simpleTerm) {
- simpleTerm = HibernateProxyHelper.deproxy(simpleTerm);
- String key = simpleTerm.getClass().getName().concat(".")
- .concat(simpleTerm.getUuid().toString());
- if (key.contains("javassist")) {
- MessagingUtils.warn(PreferencesUtil.class,
- "Trying to persist a preference based on a proxy class.");
- }
- return key;
- }
-
-
-
- /**
- * Construct a unique key using the CdmBase object's uuid
- *
- * @param cdmBase
- * @return
- */
- public static String getPreferenceKey(IDefinedTerm definedTerm) {
- definedTerm = HibernateProxyHelper.deproxy(definedTerm);
- String key = definedTerm.getClass().getName().concat(".")
- .concat(definedTerm.getUuid().toString());
- if (key.contains("javassist")) {
- MessagingUtils.warn(PreferencesUtil.class,
- "Trying to persist a preference based on a proxy class.");
- }
- return key;
- }
-
- /**
- * Retrieves search preferences from the preference store
- *
- * @return an {@link ITaxonServiceConfigurator} to pass to search methods
- */
- public static IFindTaxaAndNamesConfigurator getSearchConfigurator() {
- IFindTaxaAndNamesConfigurator configurator = initializeSearchConfigurator();
-
- configurator.setDoTaxa(getBooleanValue(
- TAXON_SERVICE_CONFIGURATOR_TAXA));
- configurator.setDoSynonyms(getBooleanValue(
- TAXON_SERVICE_CONFIGURATOR_SYNONYMS));
- configurator.setDoNamesWithoutTaxa(getBooleanValue(
- TAXON_SERVICE_CONFIGURATOR_NAMES));
- configurator.setDoTaxaByCommonNames(getBooleanValue(
- TAXON_SERVICE_CONFIGURATOR_COMMON_NAMES));
- //configurator.setMatchMode(eu.etaxonomy.cdm.persistence.query.MatchMode.valueOf(getStringValue(TAXON_SERVICE_CONFIGURATOR_MATCH_MODE)));
-
- return configurator;
- }
-
- /**
- * create new preferences, setting all search options to true
- *
- * @return a
- * {@link eu.etaxonomy.cdm.api.service.config.ITaxonServiceConfigurator}
- * object.
- */
- public static IFindTaxaAndNamesConfigurator initializeSearchConfigurator() {
- IFindTaxaAndNamesConfigurator configurator = FindTaxaAndNamesConfiguratorImpl.NewInstance();
-
- configurator.setDoTaxa(true);
- configurator.setDoSynonyms(true);
- configurator.setDoNamesWithoutTaxa(true);
- configurator.setDoTaxaByCommonNames(true);
-
- configurator.setTaxonPropertyPath(Arrays.asList("$", "titleCache",
- "name", "name.$", "relationsFromThisTaxon.$"));
-
- configurator.setSynonymPropertyPath(Arrays.asList("$", "titleCache",
- "name", "name.$", "synonyms.relatedTo.*"));
-
- // DEFAULT VALUES
- // match mode is a simple like, actually all other match modes are kind
- // of bogus
- configurator
- .setMatchMode(eu.etaxonomy.cdm.persistence.query.MatchMode.ANYWHERE);
- // we set page number and size here as this should always be unlimited
- configurator.setPageNumber(0);
- // TODO currently limit results to 10000
- configurator.setPageSize(10000);
- setSearchConfigurator(configurator) ;
- return configurator;
- }
-
- /**
- * Store search preferences
- *
- * @param configurator
- * a
- * {@link eu.etaxonomy.cdm.api.service.config.ITaxonServiceConfigurator}
- * object.
- */
- public static void setSearchConfigurator(
- IFindTaxaAndNamesConfigurator configurator) {
- getPreferenceStore().setValue(TAXON_SERVICE_CONFIGURATOR_TAXA,
- configurator.isDoTaxa());
- getPreferenceStore().setValue(TAXON_SERVICE_CONFIGURATOR_SYNONYMS,
- configurator.isDoSynonyms());
- getPreferenceStore().setValue(TAXON_SERVICE_CONFIGURATOR_NAMES,
- configurator.isDoNamesWithoutTaxa());
- getPreferenceStore().setValue(TAXON_SERVICE_CONFIGURATOR_COMMON_NAMES,
- configurator.isDoTaxaByCommonNames());
- }
-
- /**
- * <p>
- * firePreferencesChanged
- * </p>
- *
- * @param clazz
- * a {@link java.lang.Class} object.
- */
- public static void firePreferencesChanged(Class clazz) {
- getPreferenceStore().firePropertyChangeEvent(PREFERRED_TERMS_CHANGE,
- null, clazz);
- }
-
- public static String createPreferenceString(String property){
- return prefKey(property);
-
- }
-
- /**
- * Set default values for preferences
- */
- public static void setDefaults() {
- getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_TAXA, true);
- getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_SYNONYMS,
- true);
- getPreferenceStore().setDefault(createPreferenceString(EDIT_MAP_SERVICE_ACCES_POINT),
- "http://edit.africamuseum.be/edit_wp5/v1.2/rest_gen.php");
- //FIXME : changed default for SHOULD_CONNECT_AT_STARTUP to false (ticket 3828) until resolution
- getPreferenceStore().setDefault(createPreferenceString(SHOULD_CONNECT_AT_STARTUP), false);
- getPreferenceStore().setDefault(createPreferenceString(OPENURL_ACCESS_POINT),
- "http://www.biodiversitylibrary.org/openurl");
- getPreferenceStore().setDefault(createPreferenceString(OPENURL_IMAGE_MAX_WIDTH), "1000");
- getPreferenceStore().setDefault(createPreferenceString(OPENURL_IMAGE_MAX_HEIGHT), "1000");
- //Distribution Editor:
- getPreferenceStore().setDefault(createPreferenceString(DISTRIBUTION_AREA_PREFRENCES_ACTIVE), true);
- getPreferenceStore().setDefault(createPreferenceString(CHECKLIST_AREA_DISPLAY), CHECKLIST_AREA_DISPLAY_TITLE);
- getPreferenceStore().setDefault(createPreferenceString(CHECKLIST_SYMBOL), false);
-
-
- //Name Details
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_HYBRID), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_LSID), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NAMECACHE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_RANK), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION), true);
- //Navigator preferences
- getPreferenceStore().setDefault(createPreferenceString(SORT_NODES_NATURALLY), false);
- getPreferenceStore().setDefault(createPreferenceString(SORT_NODES_ALPHABETICALLY), false);
- getPreferenceStore().setDefault(createPreferenceString(SORT_TAXA_BY_RANK_AND_NAME), true);
- //override db preferences
- getPreferenceStore().setDefault(createPreferenceString(ABCD_IMPORT_OVERRIDE), false);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_SPECIMEN_OVERRIDE), false);
- getPreferenceStore().setDefault(createPreferenceString(OVERRIDE_NAME_DETAILS), false);
- getPreferenceStore().setDefault(createPreferenceString(DISTRIBUTION_AREA_PREFRENCES_ACTIVE_OVERRIDE), false);
-
- getPreferenceStore().setDefault(createPreferenceString(FILTER_COMMON_NAME_REFERENCES), false);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_SPECIMEN), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_TAXONNODE_WIZARD), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_IN_SOURCE), true);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_ID_IN_SOURCE), true);
- getPreferenceStore().setDefault(createPreferenceString(DISABLE_MULTI_CLASSIFICATION), false);
- getPreferenceStore().setDefault(createPreferenceString(DISABLE_SEC), false);
- getPreferenceStore().setDefault(createPreferenceString(SHOW_SEC_DETAILS), true);
- }
-
- /**
- * <p>
- * checkNomenclaturalCode
- * </p>
- */
- public static void checkNomenclaturalCode() {
- // First time Editor is opened, no nomenclatural code has been set
- if (PreferencesUtil.getPreferredNomenclaturalCode(true) == null) {
- PreferencesUtil.setPreferredNomenclaturalCode(getPreferenceKey(NomenclaturalCode.ICNAFP), true);
- }
-
-
-
- }
- public static void setNomenclaturalCodePreferences(){
- ICdmRepository controller;
+ /**
+ * Get the match strategy for the given class that was stored in preferences
+ * or the default strategy if it was not stored in preferences
+ *
+ * @param clazz
+ * a {@link java.lang.Class} object.
+ * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
+ */
+ public static IMatchStrategy getMatchStrategy(Class<?> clazz) {
+ String className = clazz.getName();
+ if (getBooleanValue(MATCH_STRATEGY_PREFIX + className)) {
+ IMatchStrategy matchStrategy = getDefaultMatchStrategy(clazz);
+
+ //TODO CacheMatchers (or multiple field matchers in future) are missing here
+ for (FieldMatcher fieldMatcher : matchStrategy.getMatching().getFieldMatchers(false)) {
+ String fieldName = fieldMatcher.getPropertyName();
+ String matchModeName = getStringValue(
+ getMatchStrategyFieldName(className, fieldName));
+ MatchMode matchMode = MatchMode.valueOf(matchModeName);
+ try {
+ matchStrategy.setMatchMode(fieldName, matchMode);
+ } catch (MatchException e) {
+ MessagingUtils.error(PreferencesUtil.class, e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ return matchStrategy;
+ }
+ return getDefaultMatchStrategy(clazz);
+ }
+
+ /**
+ * Stores a matchStrategy into the preference store.
+ *
+ * @param matchStrategy
+ * a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy}
+ * object.
+ */
+ public static void setMatchStrategy(IMatchStrategy matchStrategy) {
+ String className = "ANY class"; //FIXME was: matchStrategy.getMatchClass().getName(); seems currently not in use
+ setBooleanValue(MATCH_STRATEGY_PREFIX + className, true);
+
+ List<FieldMatcher> fieldMatchers = matchStrategy.getMatching().getFieldMatchers(false);
+
+ for (FieldMatcher fieldMatcher : fieldMatchers) {
+ String fieldName = fieldMatcher.getPropertyName();
+ setStringValue(
+ getMatchStrategyFieldName(className, fieldName),
+ fieldMatcher.getMatchMode().name());
+ }
+ }
+
+ /**
+ * Helper method to create the preference property for a match field.
+ *
+ * @param className
+ * @param fieldName
+ * @return
+ */
+ private static String getMatchStrategyFieldName(String className,
+ String fieldName) {
+ return MATCH_STRATEGY_PREFIX + className + "." + fieldName;
+ }
+
+ /**
+ * Returns the default match strategy for a given class.
+ *
+ * @param clazz
+ * a {@link java.lang.Class} object.
+ * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
+ */
+ public static IMatchStrategy getDefaultMatchStrategy(Class clazz) {
+ return DefaultMatchStrategy.NewInstance(clazz);
+ }
+
+ public static String getDateFormatPattern() {
+ // TODO make this configurable in properties
+ String pattern = "Y-M-d H:m";
+ return pattern;
+ }
+
+ public static <T extends TermBase> void addTermToPreferredTerms(T term) {
+
+ // VocabularyEnum vocabulary =
+ // VocabularyEnum.getVocabularyEnum(term.getClass());
+ //
+ // getPreferenceStore().setValue(getPreferenceKey(term),
+ // VocabularyStore.getTermVocabulary(vocabulary).getTerms().contains(term));
+ //
+ // firePreferencesChanged(term.getClass());
+ }
+
+ /**
+ * Construct a unique key using the CdmBase object's uuid
+ *
+ * @param cdmBase
+ * @return
+ */
+ private static String getPreferenceKey(ICdmBase cdmBase) {
+ cdmBase = HibernateProxyHelper.deproxy(cdmBase);
+
+ String key = cdmBase.getClass().getName().concat(".")
+ .concat(cdmBase.getUuid().toString());
+ if (key.contains("javassist")) {
+ MessagingUtils.info("proxy");
+ }
+ return key;
+ }
+
+ /**
+ * Construct a unique key using the CdmBase object's uuid
+ *
+ * @param cdmBase
+ * @return
+ */
+ public static String getPreferenceKey(ISimpleTerm simpleTerm) {
+ simpleTerm = HibernateProxyHelper.deproxy(simpleTerm);
+ String key = simpleTerm.getClass().getName().concat(".")
+ .concat(simpleTerm.getUuid().toString());
+ if (key.contains("javassist")) {
+ MessagingUtils.warn(PreferencesUtil.class,
+ "Trying to persist a preference based on a proxy class.");
+ }
+ return key;
+ }
+
+
+
+ /**
+ * Construct a unique key using the CdmBase object's uuid
+ *
+ * @param cdmBase
+ * @return
+ */
+ public static String getPreferenceKey(IDefinedTerm definedTerm) {
+ definedTerm = HibernateProxyHelper.deproxy(definedTerm);
+ String key = definedTerm.getClass().getName().concat(".")
+ .concat(definedTerm.getUuid().toString());
+ if (key.contains("javassist")) {
+ MessagingUtils.warn(PreferencesUtil.class,
+ "Trying to persist a preference based on a proxy class.");
+ }
+ return key;
+ }
+
+ /**
+ * Retrieves search preferences from the preference store
+ *
+ * @return an {@link ITaxonServiceConfigurator} to pass to search methods
+ */
+ public static IFindTaxaAndNamesConfigurator getSearchConfigurator() {
+ IFindTaxaAndNamesConfigurator configurator = initializeSearchConfigurator();
+
+ configurator.setDoTaxa(getBooleanValue(
+ TAXON_SERVICE_CONFIGURATOR_TAXA));
+ configurator.setDoSynonyms(getBooleanValue(
+ TAXON_SERVICE_CONFIGURATOR_SYNONYMS));
+ configurator.setDoNamesWithoutTaxa(getBooleanValue(
+ TAXON_SERVICE_CONFIGURATOR_NAMES));
+ configurator.setDoTaxaByCommonNames(getBooleanValue(
+ TAXON_SERVICE_CONFIGURATOR_COMMON_NAMES));
+ //configurator.setMatchMode(eu.etaxonomy.cdm.persistence.query.MatchMode.valueOf(getStringValue(TAXON_SERVICE_CONFIGURATOR_MATCH_MODE)));
+
+ return configurator;
+ }
+
+ /**
+ * create new preferences, setting all search options to true
+ *
+ * @return a
+ * {@link eu.etaxonomy.cdm.api.service.config.ITaxonServiceConfigurator}
+ * object.
+ */
+ public static IFindTaxaAndNamesConfigurator initializeSearchConfigurator() {
+ IFindTaxaAndNamesConfigurator configurator = FindTaxaAndNamesConfiguratorImpl.NewInstance();
+
+ configurator.setDoTaxa(true);
+ configurator.setDoSynonyms(true);
+ configurator.setDoNamesWithoutTaxa(true);
+ configurator.setDoTaxaByCommonNames(true);
+
+ configurator.setTaxonPropertyPath(Arrays.asList("$", "titleCache",
+ "name", "name.$", "relationsFromThisTaxon.$"));
+
+ configurator.setSynonymPropertyPath(Arrays.asList("$", "titleCache",
+ "name", "name.$", "synonyms.relatedTo.*"));
+
+ // DEFAULT VALUES
+ // match mode is a simple like, actually all other match modes are kind
+ // of bogus
+ configurator
+ .setMatchMode(eu.etaxonomy.cdm.persistence.query.MatchMode.ANYWHERE);
+ // we set page number and size here as this should always be unlimited
+ configurator.setPageNumber(0);
+ // TODO currently limit results to 10000
+ configurator.setPageSize(10000);
+ //setSearchConfigurator(configurator) ;
+ return configurator;
+ }
+
+ /**
+ * Store search preferences
+ *
+ * @param configurator
+ * a
+ * {@link eu.etaxonomy.cdm.api.service.config.ITaxonServiceConfigurator}
+ * object.
+ */
+ public static void setSearchConfigurator(
+ IFindTaxaAndNamesConfigurator configurator) {
+ getPreferenceStore().setValue(TAXON_SERVICE_CONFIGURATOR_TAXA,
+ configurator.isDoTaxa());
+ getPreferenceStore().setValue(TAXON_SERVICE_CONFIGURATOR_SYNONYMS,
+ configurator.isDoSynonyms());
+ getPreferenceStore().setValue(TAXON_SERVICE_CONFIGURATOR_NAMES,
+ configurator.isDoNamesWithoutTaxa());
+ getPreferenceStore().setValue(TAXON_SERVICE_CONFIGURATOR_COMMON_NAMES,
+ configurator.isDoTaxaByCommonNames());
+ }
+
+ public static void firePreferencesChanged(Class clazz) {
+ getPreferenceStore().firePropertyChangeEvent(PREFERRED_TERMS_CHANGE,
+ null, clazz);
+ }
+
+
+ public static String createPreferenceString(String property){
+ return prefKey(property);
+
+ }
+ public static String createOverridePreferenceString(String property){
+ return prefOverrideKey(property);
+
+ }
+
+ /**
+ * Set default values for preferences
+ */
+ public static void setDefaults() {
+ getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_TAXA, true);
+ getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_SYNONYMS,
+ true);
+ getPreferenceStore().setDefault(createPreferenceString(EDIT_MAP_SERVICE_ACCES_POINT),
+ "http://edit.africamuseum.be/edit_wp5/v1.2/rest_gen.php");
+ //FIXME : changed default for SHOULD_CONNECT_AT_STARTUP to false (ticket 3828) until resolution
+ getPreferenceStore().setDefault(createPreferenceString(SHOULD_CONNECT_AT_STARTUP), false);
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.MobotOpenUrlServiceAccessPoint.getKey()),
+ "http://www.biodiversitylibrary.org/openurl");
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.MobotOpenUrlServiceMaxWidth.getKey()), "1000");
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.MobotOpenUrlServiceMaxHeight.getKey()), "1000");
+ getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_TAXA, true);
+ getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_SYNONYMS, true);
+ getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_NAMES, true);
+ getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_COMMON_NAMES, true);
+
+ //Distribution Editor:
+// getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.DistributionEditorActivated.getKey()), Boolean.valueOf(PreferencePredicate.DistributionEditorActivated.getDefaultValue().toString()));
+// getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.DisplayOfAreasInDistributionEditor.getKey()), PreferencePredicate.DisplayOfAreasInDistributionEditor.getDefaultValue().toString());
+// getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.DisplayOfStatus.getKey()), PreferencePredicate.DisplayOfStatus.getDefaultValue().toString());
+
+
+ //Name Details
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.NameDetailsView.getKey()), new NameDetailsConfigurator(false).toString());
+
+ //Navigator preferences
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.TaxonNodeOrder.getKey()), NavigatorOrderEnum.RankAndNameOrder.getKey());
+
+ //getPreferenceStore().setDefault(createPreferenceString(Prefe), true);
+
+ getPreferenceStore().setDefault(createPreferenceString(SHOW_ADVANCED_MEDIA_SECTION), false);
+
+ getPreferenceStore().setDefault(createPreferenceString(SHOW_MEDIA_PREVIEW), false);
+ //override db preferences
+ getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.AbcdImportConfig.getKey())), false);
+ getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.ShowSpecimen.getKey())), true);
+ getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.NameDetailsView.getKey())), false);
+ getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.DistributionEditorActivated.getKey())), true);
+ getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.AvailableDistributionStatus.getKey())), true);
+ getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.AvailableDistributionAreaTerms.getKey())), true);
+ getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey())), true);
+ getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.CommonNameAreaVocabularies.getKey())), false);
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.CommonNameReferencesWithMarker.getKey()), false);
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.ShowTaxonNodeWizard.getKey()), Boolean.valueOf(PreferencePredicate.ShowTaxonNodeWizard.getDefaultValue().toString()));
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.ShowNamespaceInSource.getKey()), Boolean.valueOf(PreferencePredicate.ShowNamespaceInSource.getDefaultValue().toString()));
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.ShowIdInSource.getKey()), Boolean.valueOf(PreferencePredicate.ShowIdInSource.getDefaultValue().toString()));
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.DisableMultiClassification.getKey()), Boolean.valueOf(PreferencePredicate.DisableMultiClassification.getDefaultValue().toString()));
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.ShowImportExportMenu.getKey()), Boolean.valueOf(PreferencePredicate.ShowImportExportMenu.getDefaultValue().toString()));
+ getPreferenceStore().setDefault(createPreferenceString(PreferencePredicate.ShowSpecimen.getKey()), Boolean.valueOf(PreferencePredicate.ShowSpecimen.getDefaultValue().toString()));
+
+ }
+
+ public static void checkNomenclaturalCode() {
+ // First time Editor is opened, no nomenclatural code has been set
+ if (PreferencesUtil.getPreferredNomenclaturalCode() == null) {
+ PreferencesUtil.setPreferredNomenclaturalCode(getPreferenceKey(NomenclaturalCode.ICNAFP), true);
+ }
+
+
+
+ }
+ public static void setNomenclaturalCodePreferences(){
+ ICdmRepository controller;