Salome HOME
Siman codebase is refactored. Spring beans are introduced in the context.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / SearchKnowledgeAction.java
index e71219e45384d962b42f3025ce9bfff03ec1edb1..a442c3e4c4735f6d63ba1199378daf1db99cedc4 100644 (file)
@@ -6,15 +6,16 @@ import java.util.Map;
 import org.hibernate.Session;
 import org.hibernate.Transaction;
 import org.splat.kernel.InvalidPropertyException;
-import org.splat.kernel.User;
+import org.splat.dal.bo.kernel.User;
 import org.splat.kernel.UserDirectory;
-import org.splat.som.Database;
-import org.splat.som.KnowledgeElement;
-import org.splat.som.KnowledgeElementType;
-import org.splat.som.ProgressState;
-import org.splat.som.SimulationContext;
-import org.splat.som.SimulationContextType;
-import org.splat.som.Visibility;
+import org.splat.service.SearchService;
+import org.splat.dal.dao.som.Database;
+import org.splat.dal.bo.som.KnowledgeElement;
+import org.splat.dal.bo.som.KnowledgeElementType;
+import org.splat.dal.bo.som.ProgressState;
+import org.splat.dal.bo.som.SimulationContext;
+import org.splat.dal.bo.som.SimulationContextType;
+import org.splat.dal.bo.som.Visibility;
 
 
 public class SearchKnowledgeAction extends SearchBaseAction {
@@ -26,8 +27,9 @@ public class SearchKnowledgeAction extends SearchBaseAction {
     private String                       refid      = null;   // Knowledge reference  when among ref
     private String                       words      = null;   // Full text search words
     private List<KnowledgeElementType>   types;            // Available knowledge types filter (initialized below)
+    private SearchService                _searchService;
 
-    private static final long serialVersionUID = -3104321907432838476L;
+       private static final long serialVersionUID = -3104321907432838476L;
 
 //  ==============================================================================================================================
 //  Action methods
@@ -81,7 +83,7 @@ public class SearchKnowledgeAction extends SearchBaseAction {
           sprop.setVisibility(Visibility.PRIVATE);
           sprop.setActor(user);
 
-          result = Database.selectKnowledgeElementsWhere(sprop, other);
+          result = getSearchService().selectKnowledgeElementsWhere(sprop, other);
         }
         else {
           Visibility reparea = null;
@@ -90,7 +92,7 @@ public class SearchKnowledgeAction extends SearchBaseAction {
           sprop.setVisibility(reparea);
           if (reparea == Visibility.PRIVATE) sprop.setActor(user);
 
-          result = Database.selectKnowledgeElementsWhere(sprop);
+          result = getSearchService().selectKnowledgeElementsWhere(sprop);
       }
       session.put("search.result", result);     // For redisplaying the page without re-executing the search
       return "refresh";
@@ -207,4 +209,19 @@ public class SearchKnowledgeAction extends SearchBaseAction {
 //    Initialization required by all do functions
       types = KnowledgeElement.selectTypesWhere(ProgressState.APPROVED);
        }
+    /**
+        * Get the searchService.
+        * @return the searchService
+        */
+       public SearchService getSearchService() {
+               return _searchService;
+       }
+
+       /**
+        * Set the searchService.
+        * @param searchService the searchService to set
+        */
+       public void setSearchService(SearchService searchService) {
+               _searchService = searchService;
+       }
 }
\ No newline at end of file