axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r395198 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/deployment/ core/src/org/apache/axis2/deployment/repository/util/ core/src/org/apache/axis2/transport/http/ webapp/ webapp/conf/
Date Wed, 19 Apr 2006 10:18:10 GMT
Author: deepal
Date: Wed Apr 19 03:18:05 2006
New Revision: 395198

URL: http://svn.apache.org/viewcvs?rev=395198&view=rev
Log:
- applying patch in 589
- moved all the web admin code into separate Servelet so if some does not like web admin guide
he can just modify web.xml as he wish
- if services.xml is invalid one will throw exception

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/FileSystemConfigurator.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisAdminServlet.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
    webservices/axis2/trunk/java/modules/webapp/conf/web.xml
    webservices/axis2/trunk/java/modules/webapp/listService.jsp
    webservices/axis2/trunk/java/modules/webapp/listServices.jsp
    webservices/axis2/trunk/java/modules/webapp/listSingleService.jsp

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/FileSystemConfigurator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/FileSystemConfigurator.java?rev=395198&r1=395197&r2=395198&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/FileSystemConfigurator.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/FileSystemConfigurator.java
Wed Apr 19 03:18:05 2006
@@ -50,10 +50,6 @@
         if (repoLocation == null) {
             //checking wether user has set the system property
             repoLocation = System.getProperty(Constants.AXIS2_REPO);
-            if (repoLocation == null) {
-                // Should we default to anything here?  Current
-                // directory?  ~/.axis?
-            }
         }
 
         // OK, we've got a repository location in mind.  Let's make

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?rev=395198&r1=395197&r2=395198&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
Wed Apr 19 03:18:05 2006
@@ -43,7 +43,7 @@
     private ArrayList buildServiceGroup(InputStream zin, DeploymentEngine engine,
                                         AxisServiceGroup axisServiceGroup, HashMap wsdlServices,
                                         AxisConfiguration axisConfig)
-            throws XMLStreamException, DeploymentException {
+            throws XMLStreamException, AxisFault {
 
         DescriptionBuilder builder = new DescriptionBuilder(zin, axisConfig);
         OMElement rootElement = builder.buildOM();
@@ -81,7 +81,7 @@
                     axisConfig);
             return groupBuilder.populateServiceGroup(axisServiceGroup);
         }
-        return null;
+       throw new AxisFault("In valid services.xml found");
     }
 
     /**
@@ -101,7 +101,7 @@
                                          boolean extractService,
                                          HashMap wsdls,
                                          AxisConfiguration axisConfig)
-            throws DeploymentException {
+            throws AxisFault {
         // get attribute values
         if (!extractService) {
             ZipInputStream zin = null;

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisAdminServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisAdminServlet.java?rev=395198&r1=395197&r2=395198&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisAdminServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisAdminServlet.java
Wed Apr 19 03:18:05 2006
@@ -15,7 +15,10 @@
  */
 package org.apache.axis2.transport.http;
 
+import org.apache.axis2.context.ConfigurationContext;
+
 import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -25,24 +28,30 @@
  * 
  */
 public class AxisAdminServlet extends AxisServlet {
+
     protected transient ListingAgent lister;
 
     protected void doGet(HttpServletRequest req,
                          HttpServletResponse resp) throws ServletException, IOException {
         try {
-            lister.handle(req, resp, resp.getOutputStream());
+            lister.handle(req, resp);
         } catch (Exception e) {
             throw new ServletException(e);
         }
     }
 
-    protected void doPost(HttpServletRequest req,
-                          HttpServletResponse resp) throws ServletException, IOException
{
-
-        //Not Supported
+    public void init(ServletConfig config) throws ServletException {
+        ServletContext servletContext = config.getServletContext();
+        this.configContext =
+                (ConfigurationContext) servletContext.getAttribute(CONFIGURATION_CONTEXT);
+        servletContext.setAttribute(this.getClass().getName(), this);
+        lister = new ListingAgent(configContext);
+        this.servletConfig = config;
     }
 
-    public void init(ServletConfig config) throws ServletException {
-       super.init(config);
+    public void init() throws ServletException {
+        if (this.servletConfig != null) {
+            init(this.servletConfig);
+        }
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java?rev=395198&r1=395197&r2=395198&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
Wed Apr 19 03:18:05 2006
@@ -58,7 +58,6 @@
     public static final String SESSION_ID = "SessionId";
     protected transient ConfigurationContext configContext;
     protected transient AxisConfiguration axisConfiguration;
-    protected transient ListingAgent lister;
 
     protected transient ServletConfig servletConfig;
 
@@ -89,56 +88,10 @@
         super.destroy();
     }
 
-    /**
-     * Method doGet
-     *
-     * @param httpServletRequest
-     * @param httpServletResponse
-     * @throws ServletException
-     * @throws IOException
-     */
-    protected void doGet(HttpServletRequest httpServletRequest,
-                         HttpServletResponse httpServletResponse)
-            throws ServletException, IOException {
-
-        //TODO: Remove impl after reviewing
-        MessageContext msgContext = null;
-        OutputStream out = null;
-
-        try {
-            Object sessionContext = getSessionContext(httpServletRequest);
-            HashMap map = getHTTPParameters(httpServletRequest);
-
-            msgContext = createAndSetInitialParamsToMsgCtxt(sessionContext, msgContext,
-                    httpServletResponse, httpServletRequest);
-            msgContext.setDoingREST(true);
-            msgContext.setServerSide(true);
-            out = httpServletResponse.getOutputStream();
-
-            boolean processed = HTTPTransportUtils.processHTTPGetRequest(msgContext,
-                    httpServletRequest.getInputStream(), out,
-                    httpServletRequest.getContentType(),
-                    httpServletRequest.getHeader(HTTPConstants.HEADER_SOAP_ACTION),
-                    httpServletRequest.getRequestURL().toString(), configContext,
-                    map);
-            if (!processed) {
-                lister.handle(httpServletRequest, httpServletResponse, out);
-            }
-        } catch (AxisFault e) {
-            if (msgContext != null) {
-                handleFault(msgContext, out, e);
-            } else {
-                throw new ServletException(e);
-            }
-        } catch (Exception e) {
-            throw new ServletException(e);
-        }
-    }
-
     /*
-     * (non-Javadoc)
-     * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
-     */
+    * (non-Javadoc)
+    * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
+    */
 
     /**
      * Method doPost
@@ -207,7 +160,7 @@
         try {
             this.servletConfig = config;
             configContext = initConfigContext(config);
-            lister = new ListingAgent(configContext);
+
             axisConfiguration = configContext.getAxisConfiguration();
             config.getServletContext().setAttribute(CONFIGURATION_CONTEXT, configContext);
             ListenerManager listenerManager = new ListenerManager();

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=395198&r1=395197&r2=395198&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
Wed Apr 19 03:18:05 2006
@@ -75,7 +75,6 @@
     /**
      * Field allowListSingleService
      */
-    private OutputStream out = null;
     private ConfigurationContext configContext;
     public static final String RUNNING_PORT = "RUNNING_PORT";
 
@@ -111,7 +110,7 @@
         String logged = (String) req.getSession().getAttribute(Constants.LOGGED);
         if (!(logged != null && "Yes".equals(logged))) {
             res.setContentType("text/html");
-            PrintWriter writer = new PrintWriter(out);
+            PrintWriter writer = new PrintWriter(res.getOutputStream());
             writer.write("<font color=\"red\">Invalid user , " +
                     "you have to loging to system before performing this operation</font>");
             writer.flush();
@@ -151,7 +150,7 @@
 
             res.setContentType("text/css");
 
-            PrintWriter out_writer = new PrintWriter(out);
+            PrintWriter out_writer = new PrintWriter(res.getOutputStream());
 
             out_writer.println("Parameters  changed Successfully");
             out_writer.flush();
@@ -313,9 +312,8 @@
     }
 
     public void handle(HttpServletRequest httpServletRequest,
-                       HttpServletResponse httpServletResponse, OutputStream out)
+                       HttpServletResponse httpServletResponse)
             throws IOException, Exception {
-        this.out = out;
 
         String filePart = httpServletRequest.getRequestURL().toString();
 
@@ -481,6 +479,7 @@
      */
     private void listService(HttpServletRequest req, HttpServletResponse res, String filePart)
             throws IOException {
+       OutputStream out = res.getOutputStream();
         String serviceName = filePart.substring(filePart.lastIndexOf("/") + 1, filePart.length());
         HashMap services = configContext.getAxisConfiguration().getServices();
         String wsdl = req.getParameter("wsdl");

Modified: webservices/axis2/trunk/java/modules/webapp/conf/web.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/webapp/conf/web.xml?rev=395198&r1=395197&r2=395198&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/conf/web.xml (original)
+++ webservices/axis2/trunk/java/modules/webapp/conf/web.xml Wed Apr 19 03:18:05 2006
@@ -27,6 +27,12 @@
         <servlet-class>
             org.apache.axis2.transport.http.AxisRESTServlet</servlet-class>
     </servlet>
+    <servlet>
+        <servlet-name>AxisAdminServlet</servlet-name>
+        <display-name>Apache-Axis AxisAdmin Servlet (REST)</display-name>
+        <servlet-class>
+            org.apache.axis2.transport.http.AxisAdminServlet</servlet-class>
+    </servlet>
     <servlet-mapping>
         <servlet-name>AxisRESTServlet</servlet-name>
         <url-pattern>/rest/*</url-pattern>
@@ -44,58 +50,58 @@
     </servlet-mapping>
 
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/listServices</url-pattern>
     </servlet-mapping>
 
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/listService</url-pattern>
     </servlet-mapping>
 
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/listModules</url-pattern>
     </servlet-mapping>
 
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/globalModules</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/listPhases</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/engagingglobally</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/engageToService</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/adminlogin</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/viewGlobalHandlers</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/selectService</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/viewServiceHandlers</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/listoperation</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/listOperations</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
@@ -103,39 +109,39 @@
         <url-pattern>/services/*</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/servicedit</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/inActivateService</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/activateService</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/editServicepara</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/selectServiceParaEdit</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/listServciceGroups</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/engageToServiceGroup</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/listContexts</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-        <servlet-name>AxisServlet</servlet-name>
+        <servlet-name>AxisAdminServlet</servlet-name>
         <url-pattern>/logout</url-pattern>
     </servlet-mapping>
     <error-page>

Modified: webservices/axis2/trunk/java/modules/webapp/listService.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/webapp/listService.jsp?rev=395198&r1=395197&r2=395198&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/listService.jsp (original)
+++ webservices/axis2/trunk/java/modules/webapp/listService.jsp Wed Apr 19 03:18:05 2006
@@ -40,6 +40,7 @@
         int lastindex = IP.lastIndexOf('/');
         IP = IP.substring(0,lastindex);
         String prifix = IP + "/services/";
+        String restprefix = IP + "/rest/";
     %>
      <%
          HashMap serviceMap = (HashMap)request.getSession().getAttribute(Constants.SERVICE_MAP);
@@ -54,9 +55,10 @@
                  operations = axisService.getOperations();
                  serviceName = axisService.getName();
      %><h2><font color="blue"><a href="<%=prifix + axisService.getName()%>?wsdl"><%=serviceName%></a></font></h2>
-     <font color="blue">Service EPR : <font color="black"><%=prifix + axisService.getName()%></font>
+     <font color="blue">Service EPR : <font color="black"><%=prifix + axisService.getName()%></font><br>
+         <font color="blue">Service REST epr : <font color="black"><%=restprefix
+ axisService.getName()%></font>
      <h4>Service Description : <font color="black"><%=axisService.getServiceDescription()%></h4>
-     <i><font color="blue">Service Status : <%=axisService.isActive()?"Active":"InActive"%></font></i></br>
+     <i><font color="blue">Service Status : <%=axisService.isActive()?"Active":"InActive"%></font></i><br>
            <%
                  Collection engagedModules = axisService.getEngagedModules();
                  String moduleName;

Modified: webservices/axis2/trunk/java/modules/webapp/listServices.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/webapp/listServices.jsp?rev=395198&r1=395197&r2=395198&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/listServices.jsp (original)
+++ webservices/axis2/trunk/java/modules/webapp/listServices.jsp Wed Apr 19 03:18:05 2006
@@ -36,6 +36,7 @@
         int lastindex = IP.lastIndexOf('/');
         IP = IP.substring(0,lastindex);
         String prifix = IP + "/services/";
+        String restprefix = IP + "/rest/";
     %>
      <%
         HashMap serviceMap = (HashMap)request.getSession().getAttribute(Constants.SERVICE_MAP);
@@ -53,9 +54,10 @@
             //operationsList = operations.values();
             serviceName = axisService.getName();
             %><h2><font color="blue"><a href="<%=prifix + axisService.getName()%>?wsdl"><%=serviceName%></a></font></h2>
-           <font color="blue">Service EPR : <font color="black"><%=prifix
+ axisService.getName()%></font>
+           <font color="blue">Service EPR : <font color="black"><%=prifix
+ axisService.getName()%></font><br>
+               <font color="blue">Service REST epr : <font color="black"><%=restprefix
+ axisService.getName()%></font>
            <h4>Service Description : <font color="black"><%=axisService.getServiceDescription()%></h4>
-            <i><font color="blue">Service Status : <%=axisService.isActive()?"Active":"InActive"%></font></i></br>
+            <i><font color="blue">Service Status : <%=axisService.isActive()?"Active":"InActive"%></font></i><br>
                <%
             if (opItr.hasNext()) {
                 %><i>Available operations</i><%

Modified: webservices/axis2/trunk/java/modules/webapp/listSingleService.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/webapp/listSingleService.jsp?rev=395198&r1=395197&r2=395198&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/listSingleService.jsp (original)
+++ webservices/axis2/trunk/java/modules/webapp/listSingleService.jsp Wed Apr 19 03:18:05
2006
@@ -15,6 +15,7 @@
         int lastindex = IP.lastIndexOf('/');
         IP = IP.substring(0,lastindex);
         String prifix = IP + "/services/";
+        String restprefix = IP + "/rest/";
     %>
         <%
             String isFault = (String)request.getSession().getAttribute(Constants.IS_FAULTY);
@@ -35,9 +36,10 @@
             //operationsList = operations.values();
           String  serviceName = axisService.getName();
             %><h2><font color="blue"><a href="<%=prifix + axisService.getName()%>?wsdl"><%=serviceName%></a></font></h2>
-           <font color="blue">Service EPR : <font color="black"><%=prifix
+ axisService.getName()%></font>
+           <font color="blue">Service EPR : <font color="black"><%=prifix
+ axisService.getName()%></font><br>
+               <font color="blue">Service REST epr : <font color="black"><%=restprefix
+ axisService.getName()%></font>
            <h4>Service Description : <font color="black"><%=axisService.getServiceDescription()%></h4>
-           <i><font color="blue">Service Status : <%=axisService.isActive()?"Active":"InActive"%></font></i></br>
+           <i><font color="blue">Service Status : <%=axisService.isActive()?"Active":"InActive"%></font></i><br>
            <%
             if (opItr.hasNext()) {
                 %><i>Available operations</i><%



Mime
View raw message