]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics/src/org/simantics/SimanticsPlatform.java
Allow "doNotSynchronizeOntologies" to work.
[simantics/platform.git] / bundles / org.simantics / src / org / simantics / SimanticsPlatform.java
index a4206e7da3e677a947a6b1db5e7033f547f32eaa..2504ba62d8f9ae04f4111bfbdaafa0086409d8f1 100644 (file)
@@ -153,7 +153,7 @@ public class SimanticsPlatform implements LifecycleListener {
      * It is applied when the ontology in the database of a workspace doesn't match
      * a newer ontology in the Eclipse workspace.
      */
-    public static enum OntologyRecoveryPolicy { ThrowError, Merge, ReinstallDatabase }
+    public static enum OntologyRecoveryPolicy { ThrowError, Merge, ReinstallDatabase, Bypass}
 
     /**
      * This policy dictates how the Simantics platform startup should react if
@@ -346,7 +346,7 @@ public class SimanticsPlatform implements LifecycleListener {
                 session.getService(XSupport.class).setServiceMode(true, true);
 
                 // Throw error
-                if (ontologyPolicy == OntologyRecoveryPolicy.ThrowError) {
+                if (ontologyPolicy == OntologyRecoveryPolicy.ThrowError || ontologyPolicy == OntologyRecoveryPolicy.Bypass) {
                     StringBuilder sb = new StringBuilder("The following graphs are not installed in the database: ");
                     if (!installTGs.isEmpty()) {
                         int i = 0;
@@ -367,8 +367,12 @@ public class SimanticsPlatform implements LifecycleListener {
                         sb.append(" Database/Platform Bundle version mismatch.\n");
                     }
                     sb.append("Hint: Use -fixErrors to install the graphs.");
-                    throw new PlatformException(sb.toString());
+                    if (ontologyPolicy == OntologyRecoveryPolicy.ThrowError)
+                       throw new PlatformException(sb.toString());
+                    else
+                       log.log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, sb.toString()));
                 }
+                
                 // Reinstall database
                 if (ontologyPolicy == OntologyRecoveryPolicy.ReinstallDatabase) {
                     log.log(new Status(IStatus.INFO, Activator.PLUGIN_ID, "Reinstalling the database."));