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/21 06:01:17 UTC

svn commit: r290613 - in /webservices/axis2/trunk/java/modules: core/conf/ core/src/org/apache/axis2/ core/src/org/apache/axis2/context/ core/src/org/apache/axis2/transport/http/ core/webapp/ samples/src/sample/axisversion/

Author: deepal
Date: Tue Sep 20 21:00:58 2005
New Revision: 290613

URL: http://svn.apache.org/viewcvs?rev=290613&view=rev
Log:
1. Modified web admin to keep login status in session
2. Added jsp to display context hierachy
3. changed the version of axis2 version service

Modified:
    webservices/axis2/trunk/java/modules/core/conf/web.xml
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
    webservices/axis2/trunk/java/modules/core/webapp/LeftFrame.jsp
    webservices/axis2/trunk/java/modules/core/webapp/Loging.jsp
    webservices/axis2/trunk/java/modules/samples/src/sample/axisversion/Version.java

Modified: webservices/axis2/trunk/java/modules/core/conf/web.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/conf/web.xml?rev=290613&r1=290612&r2=290613&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/conf/web.xml (original)
+++ webservices/axis2/trunk/java/modules/core/conf/web.xml Tue Sep 20 21:00:58 2005
@@ -105,6 +105,14 @@
         <servlet-name>AxisServlet</servlet-name>
         <url-pattern>/engageToServiceGroup</url-pattern>
     </servlet-mapping>
+     <servlet-mapping>
+        <servlet-name>AxisServlet</servlet-name>
+        <url-pattern>/listContexts</url-pattern>
+    </servlet-mapping>
+     <servlet-mapping>
+        <servlet-name>AxisServlet</servlet-name>
+        <url-pattern>/logout</url-pattern>
+    </servlet-mapping>
     <error-page>
         <exception-type>org.apache.axis2.transport.http.server.AdminAppException</exception-type>
         <location>/Error/AuthError.html</location>

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java?rev=290613&r1=290612&r2=290613&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java Tue Sep 20 21:00:58 2005
@@ -116,6 +116,9 @@
 
     public static final String ADMIN_LOGGING = "adminloging";
 
+    public static final String LIST_CONTEXTS = "listContexts";
+    public static final String LOGOUT = "logout";
+
     public static final String VIEW_GLOBAL_HANDLERS = "viewGlobalHandlers";
     public static final String SELECT_SERVICE = "selectService";
     public static final String EDIR_SERVICE_PARA = "editServicepara";
@@ -128,6 +131,8 @@
      */
     public static final String SERVICE_MAP = "servicemap";
     public static final String SERVICE_GROUP_MAP = "serviceGroupmap";
+
+    public static final String CONFIG_CONTEXT = "config_context";
 
     public static final String SERVICE = "service";
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java?rev=290613&r1=290612&r2=290613&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java Tue Sep 20 21:00:58 2005
@@ -83,7 +83,6 @@
 
     public void init(AxisConfiguration axisConfiguration) throws AxisFault {
         this.axisConfiguration = axisConfiguration;
-
         Iterator operationContextIt = operationContextMap.keySet().iterator();
         while (operationContextIt.hasNext()) {
             Object key = operationContextIt.next();
@@ -91,7 +90,6 @@
             if (operationContext != null)
                 operationContext.init(axisConfiguration);
         }
-
         Iterator serviceContextIt = serviceContextMap.keySet().iterator();
         while (serviceContextIt.hasNext()) {
             Object key = serviceContextIt.next();
@@ -99,7 +97,6 @@
             if (serviceContext != null)
                 serviceContext.init(axisConfiguration);
         }
-
         Iterator serviceGroupContextIt = serviceGroupContextMap.keySet().iterator();
         while (serviceGroupContextIt.hasNext()) {
             Object key = serviceGroupContextIt.next();
@@ -272,6 +269,8 @@
                 serviceContext = serviceGroupContext.getServiceContext(
                         messageContext.getServiceDescription().getName().
                                 getLocalPart());
+                //set the serviceGroupContextID
+                serviceGroupContext.setId(serviceGroupContextId);
                 this.registerServiceGroupContext(serviceGroupContext);
             } else {
                 throw new AxisFault("ServiceDescription Not found yet");
@@ -295,6 +294,14 @@
 
     private boolean isNull(String string) {
         return "".equals(string) || string == null;
+    }
+
+    /**
+     * To get all the service groups in the system
+     * @return
+     */
+    public HashMap getServiceGroupContexts(){
+        return (HashMap)serviceGroupContextMap;
     }
 
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java?rev=290613&r1=290612&r2=290613&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceContext.java Tue Sep 20 21:00:58 2005
@@ -37,7 +37,8 @@
     private String serviceInstanceID;
 
     private QName serviceDescName = null;
-    
+
+
     /**
      * The method is used to do the intialization of the EngineContext
      * @throws AxisFault
@@ -63,8 +64,10 @@
         super(serviceGroupContext);
         this.serviceConfig = serviceConfig;
         
-        if (serviceConfig!=null)
+        if (serviceConfig!=null){
         	this.serviceDescName = serviceConfig.getName();
+            serviceInstanceID = serviceConfig.getName().getLocalPart(); 
+        }
 
     }
 
@@ -79,6 +82,7 @@
      * @param serviceInstanceID The serviceInstanceID to set.
      */
     public void setServiceInstanceID(String serviceInstanceID) {
+        //todo we do not need this , this ID should equal to serviceName
         this.serviceInstanceID = serviceInstanceID;
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java?rev=290613&r1=290612&r2=290613&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ServiceGroupContext.java Tue Sep 20 21:00:58 2005
@@ -36,6 +36,8 @@
     private transient ServiceGroupDescription description;
     private String serviceGroupDescName=null;
 
+
+
     public void init(AxisConfiguration axisConfiguration) throws AxisFault {
         if (serviceGroupDescName!=null)
             description = axisConfiguration.getServiceGroup(serviceGroupDescName);
@@ -105,5 +107,9 @@
 
     public ServiceGroupDescription getDescription() {
         return description;
+    }
+
+    public Iterator getServiceContexts(){
+        return serviceContextMap.values().iterator();
     }
 }

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=290613&r1=290612&r2=290613&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 Tue Sep 20 21:00:58 2005
@@ -54,7 +54,7 @@
 
     private static final String REMOVE_SERVICE_JSP_NAME = "RemoveService.jsp";
 
-    private static final String ADMIN_JSP_NAME = "admin.jsp";
+    public static final String ADMIN_JSP_NAME = "admin.jsp";
 
     private static final String LIST_AVAILABLE_MODULES_JSP_NAME = "listModules.jsp";
 
@@ -170,10 +170,16 @@
                 filePart.endsWith(Constants.LIST_SERVIC_GROUPS)) {
             listServiceGroups(httpServletRequest, httpServletResponse);
             return;
+        }else if ((filePart != null) &&
+                filePart.endsWith(Constants.LIST_CONTEXTS)) {
+            listContexts(httpServletRequest, httpServletResponse);
+            return;
+        }  else if ((filePart != null) &&
+                filePart.endsWith(Constants.LOGOUT)) {
+            logout(httpServletRequest, httpServletResponse);
+            return;
         }
 
-
-
         if ((filePart != null) &&
                 filePart.endsWith(Constants.LISTSERVICES)) {
             listServices(httpServletRequest, httpServletResponse);
@@ -209,6 +215,16 @@
         res.sendRedirect(LIST_SERVICE_GROUP_JSP);
     }
 
+
+    private void listContexts(HttpServletRequest req, HttpServletResponse res) throws IOException {
+        req.getSession().setAttribute(Constants.CONFIG_CONTEXT, configContext);
+        res.sendRedirect("ViewContexts.jsp");
+    }
+
+     private void logout(HttpServletRequest req, HttpServletResponse res) throws IOException {
+        req.getSession().invalidate();
+        res.sendRedirect("index.jsp");
+    }
     /**
      * @param req
      * @param res

Modified: webservices/axis2/trunk/java/modules/core/webapp/LeftFrame.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/LeftFrame.jsp?rev=290613&r1=290612&r2=290613&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/LeftFrame.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/LeftFrame.jsp Tue Sep 20 21:00:58 2005
@@ -179,6 +179,21 @@
        </td>
     </tr>
 
+
+    <tr>
+     <td colspan="2" >
+       <b>View Contexts </b>
+     </td>
+    </tr>
+    <tr>
+       <td>
+       &nbsp;&nbsp;&nbsp;&nbsp;
+       </td>
+       <td>
+         <a href="listContexts" target="mainFrame">View Context Hierachy</a>
+       </td>
+    </tr>
+
      <tr>
        <td>
        &nbsp;&nbsp;&nbsp;&nbsp;
@@ -193,6 +208,14 @@
        </td>
        <td>
          <a href="index.jsp" target="_parent" >Back</a>
+       </td>
+    </tr>
+    <tr>
+       <td>
+       &nbsp;&nbsp;&nbsp;&nbsp;
+       </td>
+       <td>
+         <a href="logout" target="_parent" >Log out</a>
        </td>
     </tr>
 </table>

Modified: webservices/axis2/trunk/java/modules/core/webapp/Loging.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/Loging.jsp?rev=290613&r1=290612&r2=290613&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/Loging.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/Loging.jsp Tue Sep 20 21:00:58 2005
@@ -1,4 +1,5 @@
- <%--
+<%@ page import="org.apache.axis2.Constants"%>
+<%@ page import="org.apache.axis2.transport.http.ListingAgent"%> <%--
  /*
 * Copyright 2004,2005 The Apache Software Foundation.
 *
@@ -28,6 +29,9 @@
   <head><title>Login to Axis2:: Administartion page</title></head>
   <body>
   <jsp:include page="include/header.inc"></jsp:include>
+  <% String isLoged = (String)request.getSession().getAttribute(Constants.LOGGED);
+   if(!"Yes".equals(isLoged)){
+   %>
     <form method="get" name="LogingForm" action="adminloging">
         <table border="0" width="100%" cellspacing="1" cellpadding="1">
             <tr>
@@ -61,6 +65,9 @@
              </tr>
          </table>
        </form>
+  <%} else {
+      response.sendRedirect(ListingAgent.ADMIN_JSP_NAME);
+  }%>
        <jsp:include page="include/footer.inc"></jsp:include>
      </body>
   </html>

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/axisversion/Version.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/axisversion/Version.java?rev=290613&r1=290612&r2=290613&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/axisversion/Version.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/axisversion/Version.java Tue Sep 20 21:00:58 2005
@@ -29,7 +29,7 @@
         OMElement version = fac.createOMElement("Version", omNs);
         version.addChild(
                 fac.createText(version,
-                        "Hello I am Axis2 versionning service , My version is Axis2 0.91 !! "));
+                        "Hello I am Axis2 versionning service , My version is Axis2 1.0-alpha !! "));
         return version;
     }
 }