]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Code is cleaned.
authorrkv <rkv@opencascade.com>
Tue, 23 Oct 2012 05:49:56 +0000 (05:49 +0000)
committerrkv <rkv@opencascade.com>
Tue, 23 Oct 2012 05:49:56 +0000 (05:49 +0000)
Workspace/Siman/src/org/splat/simer/SearchBaseAction.java

index 86a35c0bddac9227309ca6f8953f468bf7677413..07c03ef6c05045dcccf0688145cb698837e2cc02 100644 (file)
@@ -5,13 +5,10 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Vector;
 
-import org.hibernate.Session;
-import org.hibernate.Transaction;
 import org.splat.kernel.InvalidPropertyException;
 import org.splat.kernel.Name;
 import org.splat.dal.bo.kernel.User;
 import org.splat.som.ApplicationRights;
-import org.splat.dal.dao.som.Database;
 import org.splat.service.SimulationContextService;
 import org.splat.service.UserService;
 import org.splat.service.technical.ProjectSettingsService;
@@ -55,7 +52,6 @@ public abstract class SearchBaseAction extends Action {
        // ==============================================================================================================================
 
        public String doSubmitForm() {
-               // -----------------------------
                // Identification of the user action
                UserAction action = UserAction.refreshResult;
                if (ctype != null && Integer.valueOf(ctype) > 0)
@@ -70,8 +66,6 @@ public abstract class SearchBaseAction extends Action {
                                action = UserAction.cancelSelect;
                }
                // Execution of the user action
-               Session connex = Database.getCurSession();
-               Transaction transax = connex.beginTransaction();
                String done;
                try {
                        saveFilter(); // Also reinitializes the form, if needed
@@ -89,7 +83,6 @@ public abstract class SearchBaseAction extends Action {
                                setContextTypeOptions(getInvolvedContexts()); // Done in other do functions, when required
                        }
                        setCandidates();
-                       transax.commit();
                        return done;
                } catch (Exception error) {
                        // No need to roll back the transaction as it is read only
@@ -100,7 +93,6 @@ public abstract class SearchBaseAction extends Action {
 
        @SuppressWarnings("unchecked")
        protected String doSelectContextType() {
-               // ---------------------------------------
                SimulationContext.Properties sprop = new SimulationContext.Properties();
 
                newtype = getSimulationContextService().selectType(
@@ -115,7 +107,6 @@ public abstract class SearchBaseAction extends Action {
        }
 
        protected String doAddContext() {
-               // --------------------------------
                SimulationContext selected = getSimulationContextService()
                                .selectSimulationContext(Integer.valueOf(cvalue));
 
@@ -126,7 +117,6 @@ public abstract class SearchBaseAction extends Action {
        }
 
        protected String doRemoveContext() {
-               // -----------------------------------
                int index = Integer.valueOf(cindex);
                for (Iterator<SimulationContext> selected = context.iterator(); selected
                                .hasNext();) {
@@ -142,7 +132,6 @@ public abstract class SearchBaseAction extends Action {
 
        @SuppressWarnings("unchecked")
        protected String doCancel() {
-               // ----------------------------
                result = (List<Proxy>) getSession().get("search.result"); // Current result search
                setContextTypeOptions(getInvolvedContexts()); // Sets critext
                return "refresh";
@@ -153,37 +142,30 @@ public abstract class SearchBaseAction extends Action {
        // ==============================================================================================================================
 
        public String getAuthor() {
-               // --------------------------
                return author;
        }
 
        public List<Name> getCandidates() {
-               // ----------------------------------
                return manager;
        }
 
        public List<SimulationContextType> getContextTypeOptions() {
-               // -----------------------------------------------------------
                return critext;
        }
 
        public List<SimulationContext> getContextValueOptions() {
-               // --------------------------------------------------------
                return newvalue;
        }
 
        public SimulationContextType getSelectedContextType() {
-               // ------------------------------------------------------
                return newtype;
        }
 
        public List<SimulationContext> getSimulationContexts() {
-               // -------------------------------------------------------
                return context;
        }
 
        public List<Proxy> getResult() {
-               // -------------------------------
                return result;
        }
 
@@ -192,27 +174,22 @@ public abstract class SearchBaseAction extends Action {
        // ==============================================================================================================================
 
        public void setAuthor(String index) {
-               // ------------------------------------
                this.author = index;
        }
 
        public void setContextType(String type) {
-               // ----------------------------------------
                this.ctype = type;
        }
 
        public void setContextValue(String value) {
-               // ------------------------------------------
                this.cvalue = value;
        }
 
        public void setContextIndex(String value) {
-               // ------------------------------------------
                this.cindex = value;
        }
 
        protected void setCandidates() {
-               // -------------------------------
                manager = new Vector<Name>();
                List<User> users = getUserService().selectAllUsers();
                User me = getConnectedUser(); // May be null
@@ -229,7 +206,6 @@ public abstract class SearchBaseAction extends Action {
        }
 
        protected void setContextTypeOptions(List<SimulationContextType> critext) {
-               // --------------------------------------------------------------------------
                for (Iterator<SimulationContext> i = context.iterator(); i.hasNext();) {
                        critext.remove(i.next().getType()); // Already used context type
                }