You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ma...@apache.org on 2009/01/22 15:21:54 UTC

svn commit: r736657 - in /geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main: java/org/apache/geronimo/console/ejbserver/EjbHelper.java webapp/WEB-INF/view/ejbserver/view.jsp

Author: manugeorge
Date: Thu Jan 22 06:21:54 2009
New Revision: 736657

URL: http://svn.apache.org/viewvc?rev=736657&view=rev
Log:
GERONIMO-4509 Two EJB server portlet issues: Fixes the issue with rechanging back config properties

Modified:
    geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java
    geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/view/ejbserver/view.jsp

Modified: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java?rev=736657&r1=736656&r2=736657&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java (original)
+++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/java/org/apache/geronimo/console/ejbserver/EjbHelper.java Thu Jan 22 06:21:54 2009
@@ -94,7 +94,6 @@
     private static final String CD_KEY="portlet.openejb.view.containerdescription";
     private static final String DN_KEY="portlet.openejb.view.displayname";
     
-    
     private ContainerSystem containerSystem;
     private OpenEjbConfiguration configuration;
     private Kernel kernel;    
@@ -173,9 +172,24 @@
         }
         return deployments;
     }
+    
+    @RemoteMethod
+    public String getCurrentContainerProperty(String containerId, String propertyKey){
+        ContainerSystemInfo systemInfo = configuration.containerSystem;
+        List<ContainerInfo> containerInfos = systemInfo.containers;        
+        
+        for (ContainerInfo containerInfo : containerInfos) {
+        	containerId = replaceEscapes(containerId);
+            if (containerInfo.id.equals(containerId)) {
+            	return containerInfo.properties.getProperty(propertyKey);
+            }
+        }
+        return null;
+    }
 
     @RemoteMethod
     public List<EjbInformation> getContainerInfo(String containerId) {
+    	containerId = replaceEscapes(containerId); 
         Container container = containerSystem.getContainer(containerId);
         if (container == null)
             return null;
@@ -266,9 +280,9 @@
             String propertyValue) {
         propertyKey = propertyKey.trim();
         propertyValue = propertyValue.trim();
-        if (containerId.indexOf("%20") != -1) {
-            containerId = containerId.replaceAll("%20", "\\ ");
-        }
+        
+        containerId = replaceEscapes(containerId);
+        
         List<String> numericProperties = new ArrayList<String>();
         numericProperties.add(POOLSIZE);
         numericProperties.add(BULKPASSIVATE);
@@ -526,5 +540,12 @@
         }
         return data;
     }
+    
+    private String replaceEscapes(String escaped){
+    	if (escaped.indexOf("%20") != -1) {
+    	    return escaped.replaceAll("%20"," ");
+    	} 
+    	return escaped;
+    }
 
 }

Modified: geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/view/ejbserver/view.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/view/ejbserver/view.jsp?rev=736657&r1=736656&r2=736657&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/view/ejbserver/view.jsp (original)
+++ geronimo/server/trunk/plugins/openejb/openejb-portlets/src/main/webapp/WEB-INF/view/ejbserver/view.jsp Thu Jan 22 06:21:54 2009
@@ -55,6 +55,7 @@
     var doCheck = false;
     var serverStore=null;
     var data = '';
+    var containerPropertyValue = ''; 
 
     EjbHelper.getEjbInformation({callback:createStore,async:false});
         
@@ -140,24 +141,28 @@
 
       
   }
+
+   function getCurrentValue(value){
+       containerPropertyValue = value; 
+   }
   
    function updateValues(containerId,  propertyKey, originalValue){       
        var propertyValue = document.getElementById(propertyKey).value;       
        var para = propertyKey+"para";
-       if(originalValue != propertyValue){
+       EjbHelper.getCurrentContainerProperty(containerId,  propertyKey, {callback:getCurrentValue,async:false}); 
+       if(containerPropertyValue != propertyValue ){
            EjbHelper.setContainerProperty(containerId,  propertyKey,  propertyValue, updateResult);
            document.getElementById(para).style.color="red";
+       } else {
+           EjbHelper.setContainerProperty(containerId,  propertyKey,  propertyValue,{async:false} );
+           document.getElementById(para).style.color=document.body.style.color;
        }
    }
    
    function updateResult(status){
 	     alert(status.message);
    }
-   
-   function getIcon(item) {    
-	   
-   }
-   
+     
    document.body.className="soria";
    
   </script>