geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r1080141 - /geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
Date Thu, 10 Mar 2011 07:53:29 GMT
Author: rwonly
Date: Thu Mar 10 07:53:28 2011
New Revision: 1080141

URL: http://svn.apache.org/viewvc?rev=1080141&view=rev
Log:
GERONIMO-5847 make the search case insensitive and add some static string variables

Modified:
    geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java?rev=1080141&r1=1080140&r2=1080141&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/bundlemanager/BundleManagerPortlet.java
Thu Mar 10 07:53:28 2011
@@ -88,9 +88,11 @@ public class BundleManagerPortlet extend
     private PortletRequestDispatcher showManifestView;
     
     private PortletRequestDispatcher showWiredBundlesView;
-
-    //private String moduleType;
-
+    
+    private static final String VIEW_MANIFEST_PAGE = "view_manifest";
+    
+    private static final String VIEW_WIRED_BUNDLES_PAGE = "view_wired_bundles";
+    
     protected void doHelp(RenderRequest renderRequest, RenderResponse renderResponse) throws
PortletException, IOException {
         helpView.include(renderRequest, renderResponse);
     }
@@ -115,15 +117,15 @@ public class BundleManagerPortlet extend
         
         String page = actionRequest.getParameter("page");
         
-        if ("view_manifest".equals(page)){
+        if (VIEW_MANIFEST_PAGE.equals(page)){
             // no actions in this page
-            actionResponse.setRenderParameter("page", "view_manifest");
+            actionResponse.setRenderParameter("page", VIEW_MANIFEST_PAGE);
             
-        }else if ("view_wired_bundles".equals(page)){
+        }else if (VIEW_WIRED_BUNDLES_PAGE.equals(page)){
             String id = actionRequest.getParameter("bundleId");;
             String perspectiveType = actionRequest.getParameter("perspectiveType");
             //set render params
-            actionResponse.setRenderParameter("page", "view_wired_bundles");
+            actionResponse.setRenderParameter("page", VIEW_WIRED_BUNDLES_PAGE);
             actionResponse.setRenderParameter("bundleId", id);
             actionResponse.setRenderParameter("perspectiveTypeValue", perspectiveType);
             
@@ -222,7 +224,7 @@ public class BundleManagerPortlet extend
             
             String page = renderRequest.getParameter("page");
             
-            if ("view_manifest".equals(page)){
+            if (VIEW_MANIFEST_PAGE.equals(page)){
                 BundleContext bundleContext = getBundleContext(renderRequest);
                 
                 long id = Long.valueOf(renderRequest.getParameter("bundleId"));
@@ -247,7 +249,7 @@ public class BundleManagerPortlet extend
                 renderRequest.setAttribute("bundleInfo", bundleInfo);
                 showManifestView.include(renderRequest, renderResponse);
                 
-            }else if("view_wired_bundles".equals(page)) {
+            }else if(VIEW_WIRED_BUNDLES_PAGE.equals(page)) {
                 
                 BundleContext bundleContext = getBundleContext(renderRequest);
                 
@@ -392,7 +394,8 @@ public class BundleManagerPortlet extend
     }
     
     private static boolean matchBundle(Bundle bundle, String searchString){
-        if (bundle.getSymbolicName() == null || (bundle.getSymbolicName() != null &&
bundle.getSymbolicName().indexOf(searchString) == -1)){
+        if (bundle.getSymbolicName() == null 
+            || (bundle.getSymbolicName() != null && bundle.getSymbolicName().toLowerCase().indexOf(searchString.trim().toLowerCase())
== -1)){ // match ignore case
             return false;
         }
         return true;



Mime
View raw message