You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2005/09/15 13:36:36 UTC

svn commit: r289208 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: engine/AxisConfiguration.java engine/AxisConfigurationImpl.java transport/http/ListingAgent.java

Author: deepal
Date: Thu Sep 15 04:36:28 2005
New Revision: 289208

URL: http://svn.apache.org/viewcvs?rev=289208&view=rev
Log:
Fixed JSP errors in web admin module

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java?rev=289208&r1=289207&r2=289208&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfiguration.java Thu Sep 15 04:36:28 2005
@@ -105,6 +105,9 @@
     public void engageModule(QName moduleref) throws AxisFault;
 
 
+
+    //
+    public HashMap getServices();
     /**
      * This returns
      */

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java?rev=289208&r1=289207&r2=289208&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java Thu Sep 15 04:36:28 2005
@@ -95,6 +95,9 @@
     //to store AxisObserver Objects
     private ArrayList observersList = null;
 
+    private HashMap allservices = new HashMap();
+
+
     protected HashMap messagReceivers;
     /////////////////////// From AxisGlobal /////////////////////////////////////
     /**
@@ -499,6 +502,20 @@
         if (isNewmodule) {
             addModule(module);
         }
+    }
+
+    //to get all the services in the system
+    public HashMap getServices() {
+        Iterator sgs = getServiceGroups();
+        while (sgs.hasNext()) {
+            ServiceGroupDescription groupDescription = (ServiceGroupDescription) sgs.next();
+            Iterator servics =  groupDescription.getServices();
+            while (servics.hasNext()) {
+                ServiceDescription serviceDescription = (ServiceDescription) servics.next();
+                allservices.put(serviceDescription.getName().getLocalPart(),serviceDescription);
+            }
+        }
+        return allservices;  
     }
 
     public boolean isEngaged(QName moduleName) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java?rev=289208&r1=289207&r2=289208&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java Thu Sep 15 04:36:28 2005
@@ -182,12 +182,11 @@
      * @throws IOException
      */
     private void listServices(HttpServletRequest req, HttpServletResponse res) throws IOException {
-        //todo fix me Deepal
-//        HashMap services = configContext.getAxisConfiguration().getServices();
-//        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
-//        req.getSession().setAttribute(Constants.ERROR_SERVICE_MAP,
-//                configContext.getAxisConfiguration().getFaulytServices());
-//        res.sendRedirect(LIST_MULTIPLE_SERVICE_JSP_NAME);
+        HashMap services = configContext.getAxisConfiguration().getServices();
+        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
+        req.getSession().setAttribute(Constants.ERROR_SERVICE_MAP,
+                configContext.getAxisConfiguration().getFaultyServices());
+        res.sendRedirect(LIST_MULTIPLE_SERVICE_JSP_NAME);
     }
 
     /**
@@ -198,22 +197,20 @@
     private void listAdminServices(HttpServletRequest req,
                                    HttpServletResponse res)
             throws IOException {
-        //todo fix me Deepal
-//        HashMap services = configContext.getAxisConfiguration().getServices();
-//        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
-//        req.getSession().setAttribute(Constants.ERROR_SERVICE_MAP,
-//                configContext.getAxisConfiguration().getFaulytServices());
-//        res.sendRedirect(LIST_SRVICES_JSP_NAME);
+        HashMap services = configContext.getAxisConfiguration().getServices();
+        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
+        req.getSession().setAttribute(Constants.ERROR_SERVICE_MAP,
+                configContext.getAxisConfiguration().getFaultyServices());
+        res.sendRedirect(LIST_SRVICES_JSP_NAME);
     }
 
     private void selectService(HttpServletRequest req,
                                HttpServletResponse res)
             throws IOException {
-        //todo fix me Deepal
-//        HashMap services = configContext.getAxisConfiguration().getServices();
-//        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
-//        req.getSession().setAttribute(Constants.SELECT_SERVICE_TYPE, "VIEW");
-//        res.sendRedirect(SELECT_SERVICE_JSP_NAME);
+        HashMap services = configContext.getAxisConfiguration().getServices();
+        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
+        req.getSession().setAttribute(Constants.SELECT_SERVICE_TYPE, "VIEW");
+        res.sendRedirect(SELECT_SERVICE_JSP_NAME);
     }
 
     private void adminLogging(HttpServletRequest req, HttpServletResponse res) throws AdminAppException, IOException {
@@ -329,35 +326,34 @@
     private void engageModulesToService(HttpServletRequest req,
                                         HttpServletResponse res)
             throws IOException {
-        //todo fix me Deepal
-//        HashMap modules =
-//                ((AxisConfigurationImpl) configContext.getAxisConfiguration()).getModules();
-//        req.getSession().setAttribute(Constants.MODULE_MAP, modules);
-//        HashMap services = configContext.getAxisConfiguration().getServices();
-//        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
-//        String moduleName = req.getParameter("modules");
-//        req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
-//        req.getSession().setAttribute("modules", null);
-//        String serviceName = req.getParameter("service");
-//        req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
-//        if (serviceName != null && moduleName != null) {
-//            try {
-//
-//                configContext.getAxisConfiguration().getService(
-//                        new QName(serviceName))
-//                        .engageModule(
-//                                configContext.getAxisConfiguration().getModule(
-//                                        new QName(moduleName)),configContext.getAxisConfiguration());
-//                req.getSession().setAttribute(Constants.ENGAGE_STATUS,
-//                        moduleName +
-//                        " module engaged to the service Successfully");
-//            } catch (AxisFault axisFault) {
-//                req.getSession().setAttribute(Constants.ENGAGE_STATUS,
-//                        axisFault.getMessage());
-//            }
-//        }
-//        req.getSession().setAttribute("service", null);
-//        res.sendRedirect(ENGAGING_MODULE_TO_SERVICE_JSP_NAME);
+        HashMap modules =
+                ((AxisConfigurationImpl) configContext.getAxisConfiguration()).getModules();
+        req.getSession().setAttribute(Constants.MODULE_MAP, modules);
+        HashMap services = configContext.getAxisConfiguration().getServices();
+        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
+        String moduleName = req.getParameter("modules");
+        req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
+        req.getSession().setAttribute("modules", null);
+        String serviceName = req.getParameter("service");
+        req.getSession().setAttribute(Constants.ENGAGE_STATUS, null);
+        if (serviceName != null && moduleName != null) {
+            try {
+
+                configContext.getAxisConfiguration().getService(
+                        serviceName)
+                        .engageModule(
+                                configContext.getAxisConfiguration().getModule(
+                                        new QName(moduleName)),configContext.getAxisConfiguration());
+                req.getSession().setAttribute(Constants.ENGAGE_STATUS,
+                        moduleName +
+                        " module engaged to the service Successfully");
+            } catch (AxisFault axisFault) {
+                req.getSession().setAttribute(Constants.ENGAGE_STATUS,
+                        axisFault.getMessage());
+            }
+        }
+        req.getSession().setAttribute("service", null);
+        res.sendRedirect(ENGAGING_MODULE_TO_SERVICE_JSP_NAME);
     }
 
     private void listGloballyModules(HttpServletRequest req,
@@ -372,21 +368,19 @@
     private void lsitServiceformodules(HttpServletRequest req,
                                        HttpServletResponse res)
             throws IOException {
-        //todo fix me Deepal
-//        HashMap services = configContext.getAxisConfiguration().getServices();
-//        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
-//        req.getSession().setAttribute(Constants.SELECT_SERVICE_TYPE, "MODULE");
-//        res.sendRedirect(SELECT_SERVICE_JSP_NAME);
+        HashMap services = configContext.getAxisConfiguration().getServices();
+        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
+        req.getSession().setAttribute(Constants.SELECT_SERVICE_TYPE, "MODULE");
+        res.sendRedirect(SELECT_SERVICE_JSP_NAME);
     }
 
     private void lsitServiceforParameterChanged(HttpServletRequest req,
                                                 HttpServletResponse res)
             throws IOException {
-        //todo fix me Deepal
-//        HashMap services = configContext.getAxisConfiguration().getServices();
-//        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
-//        req.getSession().setAttribute(Constants.SELECT_SERVICE_TYPE, "SERVICE_PARAMETER");
-//        res.sendRedirect(SELECT_SERVICE_JSP_NAME);
+        HashMap services = configContext.getAxisConfiguration().getServices();
+        req.getSession().setAttribute(Constants.SERVICE_MAP, services);
+        req.getSession().setAttribute(Constants.SELECT_SERVICE_TYPE, "SERVICE_PARAMETER");
+        res.sendRedirect(SELECT_SERVICE_JSP_NAME);
     }
 
 
@@ -529,27 +523,26 @@
             throws IOException {
         String serviceName = filePart.substring(filePart.lastIndexOf("/") + 1,
                 filePart.length());
-        //todo fix me Deepal
-//        HashMap services = configContext.getAxisConfiguration().getServices();
-//        String wsdl = req.getParameter("wsdl");
-//        if ((services != null) && !services.isEmpty()) {
-//            Object serviceObj = services.get(new QName(serviceName));
-//            if (serviceObj != null) {
-//                if (wsdl != null) {
-//                    res.setContentType("text/html");
-//                    PrintWriter out_writer = new PrintWriter(out);
-//                    ((ServiceDescription) serviceObj).printWSDL(out_writer,
-//                            filePart);
-//                    out.flush();
-//                    out.close();
-//                    wsdl = null;
-//                    return;
-//                } else {
-//                    req.getSession().setAttribute(Constants.SINGLE_SERVICE,
-//                            serviceObj);
-//                }
-//            }
-//        }
+        HashMap services = configContext.getAxisConfiguration().getServices();
+        String wsdl = req.getParameter("wsdl");
+        if ((services != null) && !services.isEmpty()) {
+            Object serviceObj = services.get(new QName(serviceName));
+            if (serviceObj != null) {
+                if (wsdl != null) {
+                    res.setContentType("text/html");
+                    PrintWriter out_writer = new PrintWriter(out);
+                    ((ServiceDescription) serviceObj).printWSDL(out_writer,
+                            filePart);
+                    out.flush();
+                    out.close();
+                    wsdl = null;
+                    return;
+                } else {
+                    req.getSession().setAttribute(Constants.SINGLE_SERVICE,
+                            serviceObj);
+                }
+            }
+        }
         String URI = req.getRequestURI();
         URI = URI.substring(0, URI.indexOf("services"));
         res.sendRedirect(URI + LIST_SINGLE_SERVICE_JSP_NAME);