tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amy...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/webapps/admin/service service.jsp
Date Fri, 21 Mar 2003 08:19:16 GMT
amyroh      2003/03/21 00:19:16

  Modified:    webapps/admin/WEB-INF/classes/org/apache/webapp/admin
                        Lists.java TomcatTreeBuilder.java
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector
                        AddConnectorAction.java ConnectorForm.java
                        DeleteConnectorAction.java SaveConnectorAction.java
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host
                        HostForm.java SaveHostAction.java
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin/logger
                        DeleteLoggerAction.java SaveLoggerAction.java
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin/resources
                        ListDataSourcesAction.java ResourceUtils.java
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin/service
                        EditServiceAction.java SaveServiceAction.java
               webapps/admin/service service.jsp
  Log:
  More updates.
  
  Revision  Changes    Path
  1.7       +8 -7      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/Lists.java
  
  Index: Lists.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/Lists.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Lists.java	20 Mar 2003 05:40:09 -0000	1.6
  +++ Lists.java	21 Mar 2003 08:19:12 -0000	1.7
  @@ -635,7 +635,7 @@
           Iterator names = mbserver.queryNames(search, null).iterator();
           String service = null;
           while (names.hasNext()) {
  -            service = ((ObjectName)names.next()).getKeyProperty("name");
  +            service = ((ObjectName)names.next()).getKeyProperty("serviceName");
           }
           return service;
   
  @@ -654,7 +654,7 @@
       public static String getAdminAppHost
           (MBeanServer mbserver, String domain, HttpServletRequest request)
           throws Exception {
  -        // FIXME TEST
  +        
           // Get the admin app's host name
           StringBuffer sb = new StringBuffer(domain);
           sb.append(":j2eeType=WebModule,*"); 
  @@ -672,9 +672,10 @@
               int i = host.indexOf("/");
               if (contextPath.equals(host.substring(i))) {
                   host = host.substring(0,i);
  +                return host;
               }
           }
  -        return host;
  +        return "";
   
       }
   
  
  
  
  1.5       +21 -14    jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java
  
  Index: TomcatTreeBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/TomcatTreeBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TomcatTreeBuilder.java	20 Mar 2003 05:40:09 -0000	1.4
  +++ TomcatTreeBuilder.java	21 Mar 2003 08:19:13 -0000	1.5
  @@ -204,7 +204,7 @@
               String serviceName = (String) serviceNames.next();
               ObjectName objectName = new ObjectName(serviceName);
               String nodeLabel =
  -                "Service (" + objectName.getDomain() + ")";
  +                "Service (" + objectName.getKeyProperty("serviceName") + ")";
               TreeControlNode serviceNode =
                   new TreeControlNode(serviceName,
                                       "Service.gif",
  @@ -467,16 +467,23 @@
           ObjectName oname = new ObjectName(containerName);
           String type = oname.getKeyProperty("type");
           if (type == null) {
  -            type = "";
  +            type = oname.getKeyProperty("j2eeType");
  +            if (type.equals("WebModule")) {
  +                type = "Context";
  +            } else {
  +                type = "";
  +            }
           }
  -        String path = oname.getKeyProperty("path");
  -        if (path == null) {
  -            path = "";
  -        }        
  -        String host = oname.getKeyProperty("host");
  -        if (host == null) {
  -            host = "";
  -        }                
  +        String path = "";
  +        String host = "";
  +        String name = oname.getKeyProperty("name");
  +        if ((name != null) && (name.length() > 0)) {
  +            // context resource
  +            name = name.substring(2);
  +            int i = name.indexOf("/");
  +            host = name.substring(0,i);
  +            path = name.substring(i);
  +        }     
           TreeControlNode subtree = new TreeControlNode
               ("Context Resource Administration " + containerName,
                "folder_16_pad.gif",
  
  
  
  1.3       +7 -7      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/AddConnectorAction.java
  
  Index: AddConnectorAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/AddConnectorAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AddConnectorAction.java	18 Mar 2003 10:48:14 -0000	1.2
  +++ AddConnectorAction.java	21 Mar 2003 08:19:13 -0000	1.3
  @@ -125,7 +125,7 @@
           
           // the service Name is needed to retrieve the engine mBean to
           // which the new connector mBean will be added.
  -        String serviceName = request.getParameter("serviceName");
  +        String serviceName = request.getParameter("select");
           
           // Fill in the form values for display and editing
           ConnectorForm connectorFm = new ConnectorForm();
  @@ -174,12 +174,12 @@
           ArrayList types = new ArrayList();    
           // the first element in the select list should be the type selected
           types.add(new LabelValueBean(type,
  -                "AddConnector.do?serviceName=" + URLEncoder.encode(serviceName) 
  +                "AddConnector.do?select=" + URLEncoder.encode(serviceName) 
                   + "&type=" + type));        
            for (int i=0; i< schemeTypes.length; i++) {
               if (!type.equalsIgnoreCase(schemeTypes[i])) {
                   types.add(new LabelValueBean(schemeTypes[i],
  -                "AddConnector.do?serviceName=" + URLEncoder.encode(serviceName)
  +                "AddConnector.do?select=" + URLEncoder.encode(serviceName)
                   + "&type=" + schemeTypes[i]));        
               }
           }
  
  
  
  1.2       +5 -5      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/ConnectorForm.java
  
  Index: ConnectorForm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/ConnectorForm.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConnectorForm.java	18 Jul 2002 16:48:26 -0000	1.1
  +++ ConnectorForm.java	21 Mar 2003 08:19:13 -0000	1.2
  @@ -92,7 +92,7 @@
       private String objectName = null;
       
       /**
  -     * The name of the service this connector belongs to.
  +     * The object name of the service this connector belongs to.
        */
       private String serviceName = null;
      
  
  
  
  1.3       +7 -7      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/DeleteConnectorAction.java
  
  Index: DeleteConnectorAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/DeleteConnectorAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DeleteConnectorAction.java	18 Mar 2003 10:48:14 -0000	1.2
  +++ DeleteConnectorAction.java	21 Mar 2003 08:19:13 -0000	1.3
  @@ -151,7 +151,6 @@
               ("Cannot acquire MBeanServer reference", t);
           }
           
  -        String serviceName = request.getParameter("serviceName");
           String domain = null;
           // Set up a form bean containing the currently selected
           // objects to be deleted
  @@ -175,12 +174,13 @@
           // Accumulate a list of all available connectors
           ArrayList list = new ArrayList();
            try {
  -            String pattern = domain + ":" + TomcatTreeBuilder.CONNECTOR_TYPE +
  +            String pattern = domain + TomcatTreeBuilder.CONNECTOR_TYPE +
                   TomcatTreeBuilder.WILDCARD;          
               Iterator items =
                   mBServer.queryNames(new ObjectName(pattern), null).iterator();
               while (items.hasNext()) {
  -                list.add(items.next().toString());
  +                Object item = items.next();
  +                list.add(item.toString());
               }
           } catch (Exception e) {
               getServlet().log
  
  
  
  1.4       +10 -10    jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/SaveConnectorAction.java
  
  Index: SaveConnectorAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/SaveConnectorAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SaveConnectorAction.java	20 Mar 2003 05:40:09 -0000	1.3
  +++ SaveConnectorAction.java	21 Mar 2003 08:19:13 -0000	1.4
  @@ -177,8 +177,10 @@
               try {
                   // get service name which is same as domain
                   String serviceName = cform.getServiceName();
  +                ObjectName soname = new ObjectName(serviceName);
  +                String domain = soname.getDomain();
                   ObjectName oname =
  -                    new ObjectName(serviceName + TomcatTreeBuilder.CONNECTOR_TYPE +
  +                    new ObjectName(domain + TomcatTreeBuilder.CONNECTOR_TYPE +
                                      ",port=" + cform.getPortText() +
                                      ",address=" + cform.getAddress());
                                                   
  @@ -196,8 +198,7 @@
   
                   // Create a new Connector object
                   values = new Object[3];                
  -                values[0] = // parent 
  -                    serviceName + TomcatTreeBuilder.SERVICE_TYPE + ",name=" + serviceName;
  +                values[0] = serviceName;  //service parent object name
                   values[1] = cform.getAddress();
                   values[2] = new Integer(cform.getPortText());
   
  @@ -217,8 +218,7 @@
                   TreeControl control = (TreeControl)
                       session.getAttribute("treeControlTest");
                   if (control != null) {
  -                    String parentName = serviceName + TomcatTreeBuilder.SERVICE_TYPE
  -                         + ",name=" + serviceName;
  +                    String parentName = serviceName;
                       TreeControlNode parentNode = control.findNode(parentName);
                       if (parentNode != null) {
                           String nodeLabel =
  @@ -232,7 +232,7 @@
                                                   "EditConnector.do?select=" +
                                                   encodedName,
                                                   "content",
  -                                                true, serviceName);
  +                                                true, domain);
                           // FIXME--the node should be next to the rest of 
                           // the Connector nodes..
                           parentNode.addChild(childNode);
  
  
  
  1.4       +7 -7      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host/HostForm.java
  
  Index: HostForm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host/HostForm.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HostForm.java	16 Sep 2002 04:46:18 -0000	1.3
  +++ HostForm.java	21 Mar 2003 08:19:14 -0000	1.4
  @@ -86,7 +86,7 @@
       private String adminAction = "Edit";
   
       /**
  -     * The object name of the Service this bean refers to.
  +     * The object name of this Host bean refers to.
        */
       private String objectName = null;
   
  @@ -102,7 +102,7 @@
       private String hostName = null;
   
       /**
  -     * The name of the service this host belongs to.
  +     * The object name of the service this host belongs to.
        */
       private String serviceName = null;
   
  @@ -205,7 +205,7 @@
           this.objectName = objectName;
   
       }
  -
  +    
   
       /**
        * Return the object name of the service this host belongs to.
  
  
  
  1.6       +7 -8      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host/SaveHostAction.java
  
  Index: SaveHostAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host/SaveHostAction.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SaveHostAction.java	20 Mar 2003 05:40:09 -0000	1.5
  +++ SaveHostAction.java	21 Mar 2003 08:19:14 -0000	1.6
  @@ -184,9 +184,9 @@
               Object values[] = null;
   
               try {
  -                honame = new ObjectName(hObjectName);
                   String serviceName = hform.getServiceName();
  -                String domain = honame.getDomain();
  +                ObjectName soname = new ObjectName(serviceName);
  +                String domain = soname.getDomain();
                   // Ensure that the requested host name is unique
                   ObjectName oname =
                       new ObjectName(domain + 
  @@ -225,8 +225,7 @@
                   TreeControl control = (TreeControl)
                       session.getAttribute("treeControlTest");
                   if (control != null) {
  -                    String parentName = domain +
  -                          TomcatTreeBuilder.SERVICE_TYPE + ",name=" + serviceName;
  +                    String parentName = serviceName;
                       TreeControlNode parentNode = control.findNode(parentName);
                       if (parentNode != null) {
                           String nodeLabel =
  
  
  
  1.3       +6 -5      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/logger/DeleteLoggerAction.java
  
  Index: DeleteLoggerAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/logger/DeleteLoggerAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DeleteLoggerAction.java	18 Mar 2003 10:48:23 -0000	1.2
  +++ DeleteLoggerAction.java	21 Mar 2003 08:19:15 -0000	1.3
  @@ -215,7 +215,8 @@
           String domain = poname.getDomain();
           StringBuffer sb = new StringBuffer(domain+MBeanType);
           String type = poname.getKeyProperty("type");
  -        if ("Context".equalsIgnoreCase(type)) { // container is context            
  +        String j2eeType = poname.getKeyProperty("j2eeType");
  +        if ("WebModule".equalsIgnoreCase(j2eeType)) { // container is context         
  
               sb.append(",path=");
               sb.append(poname.getKeyProperty("path"));
               sb.append(",host=");
  
  
  
  1.4       +7 -6      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/logger/SaveLoggerAction.java
  
  Index: SaveLoggerAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/logger/SaveLoggerAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SaveLoggerAction.java	20 Mar 2003 05:40:10 -0000	1.3
  +++ SaveLoggerAction.java	21 Mar 2003 08:19:15 -0000	1.4
  @@ -176,10 +176,11 @@
   
               try {
      
  -                String parent = lform.getParentObjectName();                
  +                String parent = lform.getParentObjectName();   
  +                System.out.println("parent = "+parent);             
                   String objectName = DeleteLoggerAction.getObjectName(
                                           parent, TomcatTreeBuilder.LOGGER_TYPE);
  -                
  +                System.out.println("objectName = "+objectName);
                   ObjectName pname = new ObjectName(parent);
                   StringBuffer sb = new StringBuffer(pname.getDomain());                
   
                   
  
  
  
  1.3       +5 -4      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/resources/ListDataSourcesAction.java
  
  Index: ListDataSourcesAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/resources/ListDataSourcesAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ListDataSourcesAction.java	18 Mar 2003 10:48:24 -0000	1.2
  +++ ListDataSourcesAction.java	21 Mar 2003 08:19:15 -0000	1.3
  @@ -164,6 +164,7 @@
               domain = URLDecoder.decode(domain);
           }
           
  +        System.out.println("list datasource "+resourcetype+path+host+domain);
           // Create a form bean containing the requested MBean Names
           DataSourcesForm dataSourcesForm = null;
           try {
  
  
  
  1.5       +5 -5      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/resources/ResourceUtils.java
  
  Index: ResourceUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/resources/ResourceUtils.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ResourceUtils.java	18 Mar 2003 10:48:24 -0000	1.4
  +++ ResourceUtils.java	21 Mar 2003 08:19:15 -0000	1.5
  @@ -231,7 +231,7 @@
                   }
               }
           }
  -       
  +        System.out.println("get datasource "+rname.toString());
           Iterator iterator = (mserver.queryMBeans(rname, null).iterator());
           
           ArrayList results = new ArrayList();        
  
  
  
  1.4       +6 -5      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/service/EditServiceAction.java
  
  Index: EditServiceAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/service/EditServiceAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EditServiceAction.java	20 Mar 2003 05:40:11 -0000	1.3
  +++ EditServiceAction.java	21 Mar 2003 08:19:16 -0000	1.4
  @@ -228,8 +228,9 @@
               while (items.hasNext()) {
                   ObjectName hname = new ObjectName((String) items.next());
                   String name = hname.getKeyProperty("host");
  -                if (name!=null)
  +                if (name!=null) {
                       hosts.add(new LabelValueBean(name, name));
  +                }
               }
               serviceFm.setHostNameVals(hosts);
   
  
  
  
  1.4       +8 -7      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/service/SaveServiceAction.java
  
  Index: SaveServiceAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/service/SaveServiceAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SaveServiceAction.java	20 Mar 2003 05:40:11 -0000	1.3
  +++ SaveServiceAction.java	21 Mar 2003 08:19:16 -0000	1.4
  @@ -207,7 +207,7 @@
               try {
                   // engine name is domain
                   String engineName = sform.getEngineName();
  -                String domain = (new ObjectName(serverObjectName)).getDomain();
  +                //String domain = (new ObjectName(serverObjectName)).getDomain();
                   // Ensure that the requested service name is unique
                   ObjectName oname =
                       new ObjectName(engineName + TomcatTreeBuilder.SERVICE_TYPE);
  @@ -264,7 +264,8 @@
                   TreeControl control = (TreeControl)
                       session.getAttribute("treeControlTest");
                   if (control != null) {
  -                    String parentName = TomcatTreeBuilder.SERVER_TYPE;
  +                    String parentName = TomcatTreeBuilder.DEFAULT_DOMAIN + 
  +                                            TomcatTreeBuilder.SERVER_TYPE;
                       TreeControlNode parentNode = control.findNode(parentName);
                       if (parentNode != null) {
                           String nodeLabel =
  @@ -278,7 +279,7 @@
                                                   "EditService.do?select=" +
                                                   encodedName,
                                                   "content",
  -                                                true, domain);
  +                                                true, engineName);
                           parentNode.addChild(childNode);
                           // FIXME - force a redisplay
                       } else {
  
  
  
  1.5       +8 -8      jakarta-tomcat-catalina/webapps/admin/service/service.jsp
  
  Index: service.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/service/service.jsp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- service.jsp	23 Jan 2003 00:07:10 -0000	1.4
  +++ service.jsp	21 Mar 2003 08:19:16 -0000	1.5
  @@ -53,34 +53,34 @@
                 -------------------------------------
               </controls:action>
               <logic:notEqual name="serviceForm" property="adminAction" value="Create">
  -              <controls:action url='<%= "/AddConnector.do?serviceName=" +
  -                                        URLEncoder.encode(thisServiceName) %>'>
  +              <controls:action url='<%= "/AddConnector.do?select=" +
  +                                        URLEncoder.encode(thisObjectName) %>'>
                   <bean:message key="actions.connectors.create"/>
                 </controls:action>
  -              <controls:action url='<%= "/DeleteConnector.do?serviceName=" +
  -                                        URLEncoder.encode(thisServiceName)%>'>
  +              <controls:action url='<%= "/DeleteConnector.do?select=" +
  +                                        URLEncoder.encode(thisObjectName)%>'>
                   <bean:message key="actions.connectors.deletes"/>
                 </controls:action>
                 <controls:action>
                   -------------------------------------
                 </controls:action>
                 <controls:action url='<%= "/AddDefaultContext.do?serviceName=" +
  -                                        URLEncoder.encode(thisServiceName) %>'>
  +                                        URLEncoder.encode(thisObjectName) %>'>
                   <bean:message key="actions.defaultcontexts.create"/>
                 </controls:action>
                 <!--controls:action url='<%= "/DeleteDefaultContext.do?serviceName="
+
  -                                        URLEncoder.encode(thisServiceName) %>'>
  +                                        URLEncoder.encode(thisObjectName) %>'>
                   <bean:message key="actions.defaultcontexts.deletes"/>
                 </controls:action-->
                 <controls:action disabled="true">
                   -------------------------------------
                 </controls:action>
                 <controls:action url='<%= "/AddHost.do?serviceName=" +
  -                                        URLEncoder.encode(thisServiceName) %>'>
  +                                        URLEncoder.encode(thisObjectName) %>'>
                   <bean:message key="actions.hosts.create"/>
                 </controls:action>
                 <controls:action url='<%= "/DeleteHost.do?serviceName=" +
  -                                        URLEncoder.encode(thisServiceName) %>'>
  +                                        URLEncoder.encode(thisObjectName) %>'>
                   <bean:message key="actions.hosts.deletes"/>
                 </controls:action>
                 <controls:action disabled="true">
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message