Allow "doNotSynchronizeOntologies" to work. 20/2820/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Tue, 26 Mar 2019 13:27:55 +0000 (15:27 +0200)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Tue, 26 Mar 2019 13:27:55 +0000 (15:27 +0200)
Additionally, using the flag bypasses shared library synchronisation.

Change-Id: I384a2f878483be25c92e9644113e4d5b2ae95bca

bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchAdvisor.java
bundles/org.simantics.workbench/src/org/simantics/workbench/internal/SimanticsWorkbenchApplication.java
bundles/org.simantics/src/org/simantics/SimanticsPlatform.java

index f590b5e0e82c6dc2dc1f798259c196c8d9178ba7..6f70bc56ee3a319edf5b703ff47e84eee580e9bf 100644 (file)
@@ -408,6 +408,7 @@ public class SimanticsWorkbenchAdvisor extends WorkbenchAdvisor {
 
             if (args.contains(SimanticsArguments.DO_NOT_SYNCHRONIZE_ONTOLOGIES)) {
                 requireSynchronize = false;
+                ontologyPolicy = OntologyRecoveryPolicy.Bypass;
             }
             
             if (args.contains(SimanticsArguments.DISABLE_INDEX)) {
index 50e8aada7b3f4cd3c14acdeee796427123db7dab..e69f9066994f62d7fe41c30400ef628a6db5284e 100644 (file)
@@ -221,6 +221,7 @@ public class SimanticsWorkbenchApplication implements IApplication, IExecutableE
                 SimanticsArguments.EXPERIMENT,
                 SimanticsArguments.DISABLE_INDEX,
                 SimanticsArguments.DATABASE_ID,
+                SimanticsArguments.DO_NOT_SYNCHRONIZE_ONTOLOGIES
         };
         IArguments result = Arguments.parse(args, accepted);
         return result;
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."));