Author: raintang
Date: 2009-06-05 12:40:10 +0200 (Fri, 05 Jun 2009)
New Revision: 35761

Modified:
   
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/QuickSearchAction.java
Log:
CMSC-669 Inconsistent behavior when / is entered in field

Modified: 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/QuickSearchAction.java
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/QuickSearchAction.java
   2009-06-05 09:56:20 UTC (rev 35760)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/contentrepository/src/java/com/finalist/cmsc/repository/forms/QuickSearchAction.java
   2009-06-05 10:40:10 UTC (rev 35761)
@@ -1,11 +1,9 @@
 /*
-
- This software is OSI Certified Open Source Software.
- OSI Certified is a certification mark of the Open Source Initiative.
-
- The license (Mozilla version 1.0) can be read at the MMBase site.
- See http://www.MMBase.org/license
-
+ * 
+ * This software is OSI Certified Open Source Software. OSI Certified is a 
certification mark of the Open Source
+ * Initiative.
+ * 
+ * The license (Mozilla version 1.0) can be read at the MMBase site. See 
http://www.MMBase.org/license
  */
 package com.finalist.cmsc.repository.forms;
 
@@ -17,22 +15,24 @@
 
 public class QuickSearchAction extends 
com.finalist.cmsc.struts.QuickSearchAction {
 
-    @Override
-    protected Node getChannelFromPath(Cloud cloud, String quicksearch) {
-        return RepositoryUtil.getChannelFromPath(cloud, quicksearch);
-    }
+   @Override
+   protected Node getChannelFromPath(Cloud cloud, String quicksearch) {
+      if (quicksearch.equalsIgnoreCase("/")) {
+         quicksearch = "repository";
+      }
+      return RepositoryUtil.getChannelFromPath(cloud, quicksearch);
+   }
 
-       protected boolean isValidChannel(Cloud cloud, int channelNumber) {
-               try {
-                       Node node = cloud.getNode(channelNumber);
-                       if(node != null) {
-                               String nodeManagerName = 
node.getNodeManager().getName();
-                return 
RepositoryUtil.getTreeManagers().containsKey(nodeManagerName);
-                       }
-               }
-               catch(NotFoundException nfe) {
-                       // when not found, it is not a valid number
-               }
-               return false;
-       }
+   protected boolean isValidChannel(Cloud cloud, int channelNumber) {
+      try {
+         Node node = cloud.getNode(channelNumber);
+         if (node != null) {
+            String nodeManagerName = node.getNodeManager().getName();
+            return 
RepositoryUtil.getTreeManagers().containsKey(nodeManagerName);
+         }
+      } catch (NotFoundException nfe) {
+         // when not found, it is not a valid number
+      }
+      return false;
+   }
 }

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to