Salome HOME
Refactoring of Database, replacing SQL by DAOs calls. Methods for search by criteria...
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / SearchKnowledgeAction.java
index a442c3e4c4735f6d63ba1199378daf1db99cedc4..096b5ed4d07a23a42abe57bdfb4cb95f4a35be53 100644 (file)
@@ -9,6 +9,7 @@ import org.splat.kernel.InvalidPropertyException;
 import org.splat.dal.bo.kernel.User;
 import org.splat.kernel.UserDirectory;
 import org.splat.service.SearchService;
+import org.splat.service.SimulationContextService;
 import org.splat.dal.dao.som.Database;
 import org.splat.dal.bo.som.KnowledgeElement;
 import org.splat.dal.bo.som.KnowledgeElementType;
@@ -28,7 +29,14 @@ public class SearchKnowledgeAction extends SearchBaseAction {
     private String                       words      = null;   // Full text search words
     private List<KnowledgeElementType>   types;            // Available knowledge types filter (initialized below)
     private SearchService                _searchService;
+       /**
+        * Injected simulation context service.
+        */
+       private SimulationContextService _simulationContextService;
 
+       /**
+        * Serial version ID.
+        */
        private static final long serialVersionUID = -3104321907432838476L;
 
 //  ==============================================================================================================================
@@ -166,7 +174,7 @@ public class SearchKnowledgeAction extends SearchBaseAction {
 
        protected List<SimulationContextType> getInvolvedContexts () {
 //  ------------------------------------------------------------
-      return SimulationContext.selectAllTypes();
+      return getSimulationContextService().selectAllTypes();
        }
 
     @SuppressWarnings("unchecked")
@@ -224,4 +232,24 @@ public class SearchKnowledgeAction extends SearchBaseAction {
        public void setSearchService(SearchService searchService) {
                _searchService = searchService;
        }
+
+       /**
+        * Get the simulationContextService.
+        * 
+        * @return the simulationContextService
+        */
+       public SimulationContextService getSimulationContextService() {
+               return _simulationContextService;
+       }
+
+       /**
+        * Set the simulationContextService.
+        * 
+        * @param simulationContextService
+        *            the simulationContextService to set
+        */
+       public void setSimulationContextService(
+                       SimulationContextService simulationContextService) {
+               _simulationContextService = simulationContextService;
+       }
 }
\ No newline at end of file