package org.tgdb.webapp.action.model;
import org.tgdb.form.FormDataManager;
import org.tgdb.TgDbCaller;
import org.tgdb.TgDbFormDataManagerFactory;
import org.tgdb.exceptions.ApplicationException;
import org.tgdb.webapp.action.TgDbAction;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
public class AssignStrainPreAction extends TgDbAction {
public AssignStrainPreAction() {}
public String getName() {
return "AssignStrainPreAction";
}
public boolean performAction(HttpServletRequest req, ServletContext context) throws ApplicationException {
try {
HttpSession se = req.getSession();
TgDbCaller _caller = (TgDbCaller)se.getAttribute("caller");
FormDataManager fdm = getFormDataManager(TgDbFormDataManagerFactory.EXPMODEL, TgDbFormDataManagerFactory.WEB_FORM, req);
req.setAttribute("strains", modelManager.getUnassignedStrains(Integer.parseInt(fdm.getValue("eid")), _caller));
return true;
} catch (ApplicationException e) {
throw e;
} catch (Exception e) {
e.printStackTrace();
throw new ApplicationException("Could not retrieve model.", e);
}
}
}