bioroot.strain
Class StrainModify

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bybioroot.strain.StrainModify
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class StrainModify
extends javax.servlet.http.HttpServlet

Servlet to modify strains using StrainBeans referenced from a Session object.

Author:
nix
See Also:
Serialized Form

Constructor Summary
StrainModify()
           
 
Method Summary
static java.lang.String deleteStrain(StrainBean strainBean, UserBean userBean, DBUtil bioRoot)
          Attempts to delete an strain, if sucessful, returns a "" String, otherwise an error message.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
static boolean subtractAndSetStrainBeans(StrainBean[] strainBeans, javax.servlet.http.HttpSession session)
          Subtracts a bean from the StrainBean[] and resets it in strainBeansToEdit
static java.lang.String updateStrain(StrainBean bean, UserBean userBean, java.util.HashMap nameValue, javax.servlet.http.HttpServletRequest request, DBUtil bioRoot)
          Attempts to update a StrainBean in the database, only checks that the name is unique if it has changed.
static boolean updateStrainCommonAccessFields(StrainBean bean, UserBean userBean, java.util.HashMap nameValue, DBUtil bioRoot)
          Just update the commonly accessible fields: restock, lastUser, remainingAliquots, comments
 
Methods inherited from class javax.servlet.http.HttpServlet
service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrainModify

public StrainModify()
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

deleteStrain

public static java.lang.String deleteStrain(StrainBean strainBean,
                                            UserBean userBean,
                                            DBUtil bioRoot)
Attempts to delete an strain, if sucessful, returns a "" String, otherwise an error message.


updateStrainCommonAccessFields

public static boolean updateStrainCommonAccessFields(StrainBean bean,
                                                     UserBean userBean,
                                                     java.util.HashMap nameValue,
                                                     DBUtil bioRoot)
Just update the commonly accessible fields: restock, lastUser, remainingAliquots, comments


updateStrain

public static java.lang.String updateStrain(StrainBean bean,
                                            UserBean userBean,
                                            java.util.HashMap nameValue,
                                            javax.servlet.http.HttpServletRequest request,
                                            DBUtil bioRoot)
Attempts to update a StrainBean in the database, only checks that the name is unique if it has changed. If the update is sucessful, the message will be "", otherwise an error message will be returned.


subtractAndSetStrainBeans

public static boolean subtractAndSetStrainBeans(StrainBean[] strainBeans,
                                                javax.servlet.http.HttpSession session)
Subtracts a bean from the StrainBean[] and resets it in strainBeansToEdit