1 25 26 package org.objectweb.jonas.webapp.jonasadmin.deploy; 27 28 import java.io.IOException ; 29 import java.util.ArrayList ; 30 31 import javax.servlet.ServletException ; 32 import javax.servlet.http.HttpServletRequest ; 33 import javax.servlet.http.HttpServletResponse ; 34 35 import org.apache.struts.action.ActionMessage; 36 import org.apache.struts.action.ActionForm; 37 import org.apache.struts.action.ActionForward; 38 import org.apache.struts.action.ActionMapping; 39 import org.objectweb.jonas.webapp.jonasadmin.Jlists; 40 41 44 public class ApplyDeployAction extends BaseDeployAction { 45 46 48 50 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 51 , HttpServletRequest p_Request, HttpServletResponse p_Response) 52 throws IOException , ServletException { 53 54 String sForward = "Deploy Confirm"; 55 56 DeployForm oForm = (DeployForm) p_Form; 58 try { 59 oForm.setListDeploy(Jlists.getArrayList(oForm.getDeploy(), Jlists.SEPARATOR)); 60 oForm.setListUndeploy(Jlists.getArrayList(oForm.getUndeploy(), Jlists.SEPARATOR)); 61 62 ArrayList alAdd = new ArrayList (oForm.getListDeploy()); 63 alAdd.removeAll(oForm.getListDeployed()); 64 oForm.setListAdd(alAdd); 65 66 ArrayList alRemove = new ArrayList (oForm.getListUndeploy()); 67 alRemove.retainAll(oForm.getListDeployed()); 68 oForm.setListRemove(alRemove); 69 70 oForm.setConfirm(((alAdd.size() > 0) || (alRemove.size() > 0))); 71 if (!oForm.isConfirm()) { 72 m_Errors.add("error.deploy.noselect", new ActionMessage("error.deploy.noselect")); 73 saveErrors(p_Request, m_Errors); 74 sForward = getForwardEdit(); 75 } 76 } catch (Throwable t) { 77 addGlobalError(t); 78 saveErrors(p_Request, m_Errors); 79 return (p_Mapping.findForward("Global Error")); 80 } 81 return (p_Mapping.findForward(sForward)); 83 } 84 } 85 | Popular Tags |