]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/admin/DatabaseIndexingAction.java
Salome HOME
Siman codebase is refactored. Spring beans are introduced in the context.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / admin / DatabaseIndexingAction.java
index c4297cdf7c0610618e8ff2970e9cf371c5301367..303bde8a000d3788f010d98462f737199defbb3e 100644 (file)
@@ -5,15 +5,19 @@ import java.util.Map;
 
 import org.hibernate.Session;
 import org.hibernate.Transaction;
+import org.splat.service.SearchService;
+import org.splat.service.SearchServiceImpl;
 import org.splat.simer.Action;
-import org.splat.som.Database;
-import org.splat.som.Study;
+import org.splat.dal.dao.som.Database;
+import org.splat.dal.bo.som.Study;
 
 
 public class DatabaseIndexingAction extends Action {
 
     private List<ImportedStudy> newstudies;
     private String              indices;
+       private SearchService _searchService;
+       private ImportedStudy _importedStudy;
 
     private static final long serialVersionUID = 4194268823457749655L;
 
@@ -26,7 +30,7 @@ public class DatabaseIndexingAction extends Action {
       Session      connex  = Database.getSession();
       Transaction  transax = connex.beginTransaction();
 
-      newstudies = ImportedStudy.selectAll();
+      newstudies = getImportedStudy().selectAll();
       indices    = "";
 
       transax.commit();
@@ -44,7 +48,7 @@ public class DatabaseIndexingAction extends Action {
       for (int i=0; i<ridlist.length; i++) {
        int                 index = Integer.valueOf(ridlist[i].trim());
        Study               study = Database.selectStudy(index);
-        Database.indexStudy(study);
+        getSearchService().indexStudy(study);
       }
       filter.put("owner", "all");   // Just in case of 1st study search
 
@@ -69,4 +73,36 @@ public class DatabaseIndexingAction extends Action {
 //  ---------------------------------------
       this.indices = indices;
     }
+
+       /**
+        * 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;
+       }
+
+       /**
+        * Get the importedStudy.
+        * @return the importedStudy
+        */
+       public ImportedStudy getImportedStudy() {
+               return _importedStudy;
+       }
+
+       /**
+        * Set the importedStudy.
+        * @param importedStudy the importedStudy to set
+        */
+       public void setImportedStudy(ImportedStudy importedStudy) {
+               _importedStudy = importedStudy;
+       }
 }
\ No newline at end of file