]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Search functions are contributed with ontologies.
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 26 Sep 2013 14:42:28 +0000 (14:42 +0000)
committerluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 26 Sep 2013 14:42:28 +0000 (14:42 +0000)
refs #4447

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27893 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ontology/META-INF/MANIFEST.MF
org.simantics.sysdyn.ontology/graph.tg
org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph
org.simantics.sysdyn.ontology/src/org/simantics/sysdyn/SysdynResource.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java

index f4ca250c91862d1910de091a8e3fcffd60d8d866..dfa33be962975ac71ad3b6f176834b3e90e4a389 100644 (file)
@@ -18,7 +18,8 @@ Require-Bundle: org.simantics.layer0,
  org.simantics.color.ontology;bundle-version="1.0.0",
  org.simantics.simulation.ontology;bundle-version="1.0.0",
  org.simantics.silk.ontology;bundle-version="1.0.0",
- org.simantics.spreadsheet.ontology;bundle-version="1.1.0"
+ org.simantics.spreadsheet.ontology;bundle-version="1.1.0",
+ org.simantics.workbench.ontology;bundle-version="1.2.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Export-Package: org.simantics.sysdyn
 Bundle-Vendor: VTT Technical Reserarch Centre of Finland
index 93d42bb80feeec5277b605d961ed3b647e4a9b11..0ee27c2dec0a744b43c45953d589653eb722a732 100644 (file)
Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ
index 12cf962163615668183cb953848fb6164db70f21..f180d4f197b28b401b53c05609abd7dbbfcfeca0 100644 (file)
@@ -8,6 +8,7 @@ MOD = <http://www.simantics.org/Modeling-1.2>
 PROJ = <http://www.simantics.org/Project-1.2>
 JFREE = <http://www.simantics.org/JFreeChart-1.0>
 SHEET = <http://www.simantics.org/Spreadsheet-1.2>
+WORKBENCH = <http://www.simantics.org/Workbench-1.2>
  
 //#####################################################################
 // Defines ontology and attaches it to SimanticsDomain
@@ -87,6 +88,9 @@ SYSDYN.DefaultRealization <T L0X.Realization
 
 SYSDYN.ModulesSearchFunction : L0.Function
 
+SYSDYN.SearchContribution : WORKBENCH.SearchContribution
+  WORKBENCH.hasSearchFunction SYSDYN.ModulesSearchFunction
+
 //#####################################################################
 // Variables
 //#####################################################################
index 62b9513dc0927dc5b14b102283294297ee50b000..3d6ec0d0cf736c4c00b377112df2fd27b864519b 100644 (file)
@@ -553,6 +553,7 @@ public class SysdynResource {
     public final Resource Result_time;\r
     public final Resource Result_time_Inverse;\r
     public final Resource Right;\r
+    public final Resource SearchContribution;\r
     public final Resource SelectedSharedFunctionLibraries;\r
     public final Resource SensitivityAnalysisExperiment;\r
     public final Resource SensitivityAnalysisExperiment_Parameter;\r
@@ -1290,6 +1291,7 @@ public class SysdynResource {
         public static final String Result_time = "http://www.simantics.org/Sysdyn-1.1/Result/time";\r
         public static final String Result_time_Inverse = "http://www.simantics.org/Sysdyn-1.1/Result/time/Inverse";\r
         public static final String Right = "http://www.simantics.org/Sysdyn-1.1/Right";\r
+        public static final String SearchContribution = "http://www.simantics.org/Sysdyn-1.1/SearchContribution";\r
         public static final String SelectedSharedFunctionLibraries = "http://www.simantics.org/Sysdyn-1.1/SelectedSharedFunctionLibraries";\r
         public static final String SensitivityAnalysisExperiment = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment";\r
         public static final String SensitivityAnalysisExperiment_Parameter = "http://www.simantics.org/Sysdyn-1.1/SensitivityAnalysisExperiment/Parameter";\r
@@ -2037,6 +2039,7 @@ public class SysdynResource {
         Result_time = getResourceOrNull(graph, URIs.Result_time);\r
         Result_time_Inverse = getResourceOrNull(graph, URIs.Result_time_Inverse);\r
         Right = getResourceOrNull(graph, URIs.Right);\r
+        SearchContribution = getResourceOrNull(graph, URIs.SearchContribution);\r
         SelectedSharedFunctionLibraries = getResourceOrNull(graph, URIs.SelectedSharedFunctionLibraries);\r
         SensitivityAnalysisExperiment = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment);\r
         SensitivityAnalysisExperiment_Parameter = getResourceOrNull(graph, URIs.SensitivityAnalysisExperiment_Parameter);\r
index 5f00db8b671996b0ab9178901eaac21c57580838..9b55cbe91995e9f13a7e074fff2fbf88add267c8 100644 (file)
@@ -123,29 +123,7 @@ public class SysdynProject extends AbstractProjectFeature {
             //final Set<Resource> requiredActivations = new HashSet<Resource>();\r
             //requiredActivations.add(APROS.IndexActivation);\r
                        \r
-               session.syncRequest(new WriteRequest(support.getWorkspacePersistent("activations")) {\r
-                           @Override\r
-                           public void perform(WriteGraph graph) throws DatabaseException {\r
-\r
-                               final SysdynResource SR = SysdynResource.getInstance(graph);\r
-                               \r
-                    //for (Resource activation : graph.getObjects(project.get(), L0X.HasActivation))\r
-                   //     requiredActivations.remove(activation);\r
-                    //for (Resource requiredActivation : requiredActivations)\r
-                    //    if (requiredActivation != null)\r
-                    //        graph.claim(project.get(), L0X.HasActivation, null, requiredActivation);\r
-                               \r
-                                       // Initialize Modules function as workbench search function.\r
-                               graph.syncRequest(new WriteRequest(support.getWorkspacePersistent("preferences")) {\r
-                                   @Override\r
-                                   public void perform(WriteGraph graph) throws DatabaseException {\r
-                                       WorkbenchResource WB = WorkbenchResource.getInstance(graph);\r
-                                       graph.deny(project.get(), WB.HasWorkbenchSearchFunction);\r
-                                       graph.claim(project.get(), WB.HasWorkbenchSearchFunction, SR.ModulesSearchFunction);\r
-                                   }\r
-                               });\r
-                           }\r
-                       });\r
+               \r
 \r
                } catch (DatabaseException e) {\r
 \r