Salome HOME
Refactoring continues: UserService is created instead of UserDirectory. Database...
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / SearchStudyAction.java
index 58a7718e5effa9d5f9737339b6572cf281e1bc9b..188e5f07f6e3d79eef7de7228222477d720af81b 100644 (file)
@@ -7,11 +7,11 @@ import org.hibernate.Session;
 import org.hibernate.Transaction;
 import org.splat.kernel.InvalidPropertyException;
 import org.splat.dal.bo.kernel.User;
-import org.splat.kernel.UserDirectory;
 import org.splat.dal.dao.som.Database;
 import org.splat.dal.bo.som.ProgressState;
 import org.splat.service.SearchService;
 import org.splat.service.SimulationContextService;
+import org.splat.service.UserService;
 import org.splat.service.technical.ProjectSettingsService;
 import org.splat.dal.bo.som.SimulationContext;
 import org.splat.dal.bo.som.SimulationContextType;
@@ -33,6 +33,10 @@ public class SearchStudyAction extends SearchBaseAction {
         * Injected simulation context service.
         */
        private SimulationContextService _simulationContextService;
+       /**
+        * Injected user service.
+        */
+       private UserService _userService;
 
        /**
         * Serial version ID.
@@ -47,7 +51,7 @@ public class SearchStudyAction extends SearchBaseAction {
 
     public String doInitialize () {
 //  -----------------------------
-      Session      connex  = Database.getSession();
+      Session      connex  = Database.getCurSession();
       Transaction  transax = connex.beginTransaction();
       try {
         loadFilter();
@@ -81,7 +85,7 @@ public class SearchStudyAction extends SearchBaseAction {
         if (context.size() > 0)            sprop.setSimulationContexts(context);
         int index = Integer.valueOf(author);
         if (index > 0) {
-          User him = UserDirectory.selectUser(index);
+          User him = getUserService().selectUser(index);
           sprop.setManager(him);
         }
 //    Set of the visibility
@@ -266,4 +270,20 @@ public class SearchStudyAction extends SearchBaseAction {
                        SimulationContextService simulationContextService) {
                _simulationContextService = simulationContextService;
        }
+
+       /**
+        * Get the userService.
+        * @return the userService
+        */
+       public UserService getUserService() {
+               return _userService;
+       }
+
+       /**
+        * Set the userService.
+        * @param userService the userService to set
+        */
+       public void setUserService(UserService userService) {
+               _userService = userService;
+       }
 }
\ No newline at end of file