1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service.webservice; 27 28 import java.io.IOException ; 29 import java.util.ArrayList ; 30 import java.util.HashMap ; 31 32 import javax.servlet.ServletException ; 33 import javax.servlet.http.HttpServletRequest ; 34 import javax.servlet.http.HttpServletResponse ; 35 36 import org.allesta.wsabi.j2ee.PortComponent; 37 import org.allesta.wsabi.j2ee.WebServiceDescription; 38 import org.allesta.wsabi.j2ee.provider.GenericDomainCapableProvider; 39 import org.allesta.wsabi.j2ee.provider.jonas.JonasProvider; 40 import org.apache.struts.action.ActionForm; 41 import org.apache.struts.action.ActionForward; 42 import org.apache.struts.action.ActionMapping; 43 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 44 45 48 49 public class ViewHandlersAction extends JonasBaseAction { 50 51 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 52 , HttpServletRequest p_Request, HttpServletResponse p_Response) 53 throws IOException , ServletException { 54 55 String wsPCId = p_Request.getParameter("pcselect"); 56 String wsdId = p_Request.getParameter("wsdselect"); 58 59 try { 60 GenericDomainCapableProvider jonasProvider = new JonasProvider(); 61 jonasProvider.initialize(m_WhereAreYou.getCurrentJonasServerName(), null); 62 WebServiceDescription wsd = jonasProvider.getWebServiceDescription(wsdId); 63 PortComponent pc = null; 64 int wsdPortComponentCount = wsd.getPortComponentCount(); 65 for(int i = 0; i < wsdPortComponentCount; i++){ 66 if(wsPCId.equals(((PortComponent) wsd.getPortComponent(i)).getId())){ 67 pc = (PortComponent) wsd.getPortComponent(i); 68 break; 69 } 70 } 71 72 ArrayList handlers = new ArrayList (); 73 for(int i=0; i<pc.getHandlerCount(); i++){ 74 handlers.add(pc.getHandler(i)); 75 } 76 77 HashMap map = new HashMap (); 78 map.put("wsdselect", wsd.getId()); 79 map.put("pcselect", pc.getId()); 80 p_Request.setAttribute("paramMap", map); 81 p_Request.setAttribute("portComponent", pc); 82 p_Request.setAttribute("webServiceDescription", wsd); 83 p_Request.setAttribute("handlers", handlers); 84 } catch (Throwable t) { 85 addGlobalError(t); 86 saveErrors(p_Request, m_Errors); 87 return (p_Mapping.findForward("Global Error")); 88 } 89 90 91 96 97 return (p_Mapping.findForward("Handlers")); 98 } 99 100 } 101 | Popular Tags |