#5366 Add preference for disabling services api timestamp check
authorCherian Mathew <c.mathew@bgbm.org>
Thu, 29 Oct 2015 09:33:21 +0000 (10:33 +0100)
committerCherian Mathew <c.mathew@bgbm.org>
Thu, 29 Oct 2015 09:35:49 +0000 (10:35 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicEditorGeneralPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java

index 5e9432541ac74e65e983e505ac5cf0629cfc0e4e..51af3ddba7437d16e0fb8b2c22044c82ecc4d48a 100644 (file)
@@ -127,6 +127,8 @@ public interface IPreferenceKeys {
 
        public static final String SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS = "eu.etaxonomy.taxeditor.navigation.search.openResultInSeparateWindows";
 
+       public static final String DISABLE_SERVICES_API_TIMESTAMP_CHECK = "eu.etaxonomy.taxeditor.cdmlib.remoting.disableServicesApiTimestampCheck";
+
        public static final String ADD_TYPES_TO_ALL_NAMES = "eu.etaxonomy.taxeditor.store.addTypeToAllNames";
 
     public static final String DETERMINATION_ONLY_FOR_FIELD_UNITS = "eu.etaxonomy.taxeditor.specimen.determinationOnlyOnFieldUnitLevel";
index cae829782409e61fa6bb5b1322e280d6342512a8..9ec409300f05a58bd20e7606ee0eda7a3fe769f5 100644 (file)
@@ -60,6 +60,9 @@ public class TaxonomicEditorGeneralPreferences extends
                addField(new BooleanFieldEditor(IPreferenceKeys.SEARCH_OPEN_RESULTS_IN_SEPARATE_WINDOWS,
                        "Open search results in separate windows",
                        getFieldEditorParent()));
+             addField(new BooleanFieldEditor(IPreferenceKeys.DISABLE_SERVICES_API_TIMESTAMP_CHECK,
+                       "Disable services api timestamp check",
+                       getFieldEditorParent()));
        }
 
        /*
index bddb7a0f34ae25778b6189847a83ce8fa862b74d..4d088a4f3b912fef618696a214697691922df449 100644 (file)
@@ -50,6 +50,8 @@ import org.osgi.service.prefs.Preferences;
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.remoting.server.CDMServerException;
 import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
 import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfo;
@@ -645,8 +647,12 @@ public class RemotingLoginDialog extends Dialog {
                 if(available) {
                     txtServerCDMVersion.setText(selectedCsii.getCdmRemoteSource(selectedCdmInstance, getPort()).getDbSchemaVersion());
                     int compareDbSchemaVersion = selectedCsii.compareDbSchemaVersion(selectedCdmInstance, getPort());
-                    int compareCdmlibServicesVersion = selectedCsii.compareCdmlibServicesVersion();
-
+                    int compareCdmlibServicesVersion = 0;
+                    boolean disableServicesApiTimestampCheck =
+                            PreferencesUtil.getPreferenceStore().getBoolean((IPreferenceKeys.DISABLE_SERVICES_API_TIMESTAMP_CHECK));
+                    if(!disableServicesApiTimestampCheck) {
+                        compareCdmlibServicesVersion = selectedCsii.compareCdmlibServicesVersion();
+                    }
                     if(compareDbSchemaVersion > 0 || compareCdmlibServicesVersion > 0) {
                         status =  STATUS_NOT_COMPATIBLE;
                         available = false;
@@ -660,10 +666,7 @@ public class RemotingLoginDialog extends Dialog {
                         available = true;
                         message = "";
                     }
-
-
                 }
-
             } catch (Exception e) {
                 txtCdmInstanceStatus.setToolTipText(e.getMessage());
             } finally {