1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service.mail; 27 28 import java.io.IOException ; 29 30 import javax.management.ObjectName ; 31 import javax.servlet.ServletException ; 32 import javax.servlet.http.HttpServletRequest ; 33 import javax.servlet.http.HttpServletResponse ; 34 35 import org.apache.struts.action.ActionForm; 36 import org.apache.struts.action.ActionForward; 37 import org.apache.struts.action.ActionMapping; 38 import org.objectweb.jonas.jmx.J2eeObjectName; 39 import org.objectweb.jonas.mail.MailServiceImpl; 40 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 41 42 46 public class EditMimePartMailFactoryAction extends EditMailFactoryAction { 47 48 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 49 , HttpServletRequest p_Request, HttpServletResponse p_Response) 50 throws IOException , ServletException { 51 52 String sName = p_Request.getParameter("name"); 54 55 MailFactoryForm oForm = null; 57 if (sName != null) { 58 oForm = new MailFactoryForm(); 60 oForm.reset(p_Mapping, p_Request); 61 m_Session.setAttribute("mailFactoryForm", oForm); 62 oForm.setMailFactoryName(sName); 63 } 64 else { 65 oForm = (MailFactoryForm) m_Session.getAttribute("mailFactoryForm"); 67 } 68 69 m_WhereAreYou.selectNameNode(getTreeBranchName(DEPTH_SERVER) + WhereAreYou.NODE_SEPARATOR 71 + "services" + WhereAreYou.NODE_SEPARATOR + "mail" + WhereAreYou.NODE_SEPARATOR 72 + "mimepart" + WhereAreYou.NODE_SEPARATOR + oForm.getMailFactoryName(), true); 73 74 try { 76 if (sName != null) { 77 String domainName = m_WhereAreYou.getCurrentDomainName(); 78 String serverName = m_WhereAreYou.getCurrentJonasServerName(); 79 ObjectName oObjectName = J2eeObjectName.JavaMailResource(domainName 81 , oForm.getMailFactoryName(), serverName 82 , MailServiceImpl.MIMEPART_PROPERTY_TYPE); 83 populate(oObjectName, oForm); 84 setMimePartProps(oObjectName, oForm); 85 } 86 } 87 catch (Throwable t) { 88 addGlobalError(t); 89 saveErrors(p_Request, m_Errors); 90 return (p_Mapping.findForward("Global Error")); 91 } 92 93 return (p_Mapping.findForward("MimePart Factory")); 95 } 96 } 97 | Popular Tags |