]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/SearchStudyAction.java
Salome HOME
Actions menu properties are refactored, unnecessary code is removed.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / SearchStudyAction.java
index 766971abfa3fded3a78e7fbca56e3e9a08a8bbcf..37beb4bebe0f74f5a0e09c9111d26f7ec5bacc9f 100644 (file)
@@ -11,15 +11,19 @@ import org.splat.dal.bo.som.Study;
 import org.splat.dal.bo.som.Visibility;
 import org.splat.kernel.InvalidPropertyException;
 import org.splat.service.SearchService;
-import org.splat.service.SimulationContextService;
-import org.splat.service.UserService;
 import org.splat.service.technical.ProjectSettingsService;
+import org.splat.wapp.Constants;
 
 /**
  * Search studies form action.
  */
 public class SearchStudyAction extends AbstractSearchBaseAction {
 
+       /**
+        * Serial version ID.
+        */
+       private static final long serialVersionUID = -1910481357051393077L;
+
        /**
         * "Private", "Public", "All".
         */
@@ -52,37 +56,6 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
         * Injected search service.
         */
        private SearchService _searchService;
-       /**
-        * Injected simulation context service.
-        */
-       private SimulationContextService _simulationContextService;
-       /**
-        * Injected user service.
-        */
-       private UserService _userService;
-       
-       /**
-        * Value of the menu property. 
-        * It can be: none, create, open, study, knowledge, sysadmin, help.
-        */
-       private String _menuProperty;
-       
-       /**
-        * Value of the tool bar property. 
-        * It can be: none, standard, study, back.
-        */
-       private String _toolProperty;
-       
-       /**
-        * Value of the left menu property. 
-        * It can be: open, study, knowledge, scenario.
-        */
-       private String _leftMenuProperty;
-
-       /**
-        * Serial version ID.
-        */
-       private static final long serialVersionUID = -1910481357051393077L;
 
        enum UserAction {
                refreshResult, selectContextType, selectContextValue, cancelSelect, removeContext
@@ -94,6 +67,7 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
 
        /**
         * Initialize study search form.
+        * 
         * @return SUCCESS if no exception, otherwise return ERROR
         */
        public String doInitialize() {
@@ -105,25 +79,23 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
                        // Final initialization of the form
                        setCandidates();
                        setContextTypeOptions(getInvolvedContexts());
-                       
-                       setMenuProperty("open");
-                       setToolProperty("none");
-                       setLeftMenuProperty("open");
-                       initializationFullScreenContext(_menuProperty, _toolProperty, _leftMenuProperty);
+                       initializationFullScreenContext(Constants.OPEN, Constants.NONE,
+                                       Constants.OPEN);
+
                } catch (Exception error) {
                        // No need to roll back the transaction as it is read only
                        LOG.error("Reason: ", error);
-                       
-                       setMenuProperty("none");
-                       initializationScreenContext(_menuProperty);
-                       
+
+                       initializationScreenContext(Constants.NONE);
+
                        res = ERROR;
                }
                return res;
        }
 
-       /** 
+       /**
         * {@inheritDoc}
+        * 
         * @see org.splat.simer.AbstractSearchBaseAction#doSearch()
         */
        @Override
@@ -321,98 +293,8 @@ public class SearchStudyAction extends AbstractSearchBaseAction {
         * @param projectSettingsService
         *            project settings service
         */
-       public void setProjectSettings(final ProjectSettingsService projectSettingsService) {
+       public void setProjectSettings(
+                       final ProjectSettingsService projectSettingsService) {
                _projectSettings = projectSettingsService;
        }
-
-       /**
-        * Get the simulationContextService.
-        * 
-        * @return the simulationContextService
-        */
-       @Override
-       public SimulationContextService getSimulationContextService() {
-               return _simulationContextService;
-       }
-
-       /**
-        * Set the simulationContextService.
-        * 
-        * @param simulationContextService
-        *            the simulationContextService to set
-        */
-       @Override
-       public void setSimulationContextService(
-                       final SimulationContextService simulationContextService) {
-               _simulationContextService = simulationContextService;
-       }
-
-       /**
-        * Get the userService.
-        * 
-        * @return the userService
-        */
-       @Override
-       public UserService getUserService() {
-               return _userService;
-       }
-
-       /**
-        * Set the userService.
-        * 
-        * @param userService
-        *            the userService to set
-        */
-       @Override
-       public void setUserService(final UserService userService) {
-               _userService = userService;
-       }
-       
-       /**
-        * Get the menuProperty.
-        * @return the menuProperty
-        */
-       public String getMenuProperty() {
-               return _menuProperty;
-       }
-
-       /**
-        * Set the menuProperty.
-        * @param menuProperty the menuProperty to set
-        */
-       public void setMenuProperty(final String menuProperty) {
-               this._menuProperty = menuProperty;
-       }
-       
-       /**
-        * Get the toolProperty.
-        * @return the toolProperty
-        */
-       public String getToolProperty() {
-               return _toolProperty;
-       }
-
-       /**
-        * Set the toolProperty.
-        * @param toolProperty the toolProperty to set
-        */
-       public void setToolProperty(final String toolProperty) {
-               _toolProperty = toolProperty;
-       }
-       
-       /**
-        * Get the leftMenuProperty.
-        * @return the leftMenuProperty
-        */
-       public String getLeftMenuProperty() {
-               return _leftMenuProperty;
-       }
-
-       /**
-        * Set the leftMenuProperty.
-        * @param leftMenuProperty the leftMenuProperty to set
-        */
-       public void setLeftMenuProperty(final String leftMenuProperty) {
-               _leftMenuProperty = leftMenuProperty;
-       }
 }
\ No newline at end of file