From 70c594b84294406818ec9cb089bcdeac32d0e991 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 23 Oct 2012 05:49:56 +0000 Subject: [PATCH] Code is cleaned. --- .../src/org/splat/simer/SearchBaseAction.java | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/Workspace/Siman/src/org/splat/simer/SearchBaseAction.java b/Workspace/Siman/src/org/splat/simer/SearchBaseAction.java index 86a35c0..07c03ef 100644 --- a/Workspace/Siman/src/org/splat/simer/SearchBaseAction.java +++ b/Workspace/Siman/src/org/splat/simer/SearchBaseAction.java @@ -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 selected = context.iterator(); selected .hasNext();) { @@ -142,7 +132,6 @@ public abstract class SearchBaseAction extends Action { @SuppressWarnings("unchecked") protected String doCancel() { - // ---------------------------- result = (List) 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 getCandidates() { - // ---------------------------------- return manager; } public List getContextTypeOptions() { - // ----------------------------------------------------------- return critext; } public List getContextValueOptions() { - // -------------------------------------------------------- return newvalue; } public SimulationContextType getSelectedContextType() { - // ------------------------------------------------------ return newtype; } public List getSimulationContexts() { - // ------------------------------------------------------- return context; } public List 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(); List users = getUserService().selectAllUsers(); User me = getConnectedUser(); // May be null @@ -229,7 +206,6 @@ public abstract class SearchBaseAction extends Action { } protected void setContextTypeOptions(List critext) { - // -------------------------------------------------------------------------- for (Iterator i = context.iterator(); i.hasNext();) { critext.remove(i.next().getType()); // Already used context type } -- 2.39.2