[Yanel-commits] rev 58476 - public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/reindex

michi at wyona.com michi at wyona.com
Wed May 25 23:17:30 CEST 2011


Author: michi
Date: 2011-05-25 23:17:30 +0200 (Wed, 25 May 2011)
New Revision: 58476

Modified:
   public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/reindex/ReindexResource.java
Log:
comments improved

Modified: public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/reindex/ReindexResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/reindex/ReindexResource.java	2011-05-25 15:06:18 UTC (rev 58475)
+++ public/yanel/trunk/src/contributions/resources/search/src/java/org/wyona/yanel/impl/resources/reindex/ReindexResource.java	2011-05-25 21:17:30 UTC (rev 58476)
@@ -38,11 +38,10 @@
         sb.append("\">");
 
         // Which repo needs to be re-indexed?
-        Repository repo = null;
-        String reindexRepo = getEnvironment().getRequest().getParameter("repository"); 
+        String reindexRepo = getEnvironment().getRequest().getParameter(REPO_NAME); 
 
         // Are we allowed to re-index this repository?
-        // Only repositories in the res-config are allowed to be re-indexed
+        // Only default repositories and the ones listed in the resource configuration are allowed to be re-indexed
         boolean allowed = false;
 
         // List default repositories
@@ -64,7 +63,7 @@
                 sb.append("\">Configured repository with id '");
                 sb.append(repoId);
                 sb.append("'</r:repository>");
-                // Check  if repo that should be re-indexed is in res-config
+                // Check  if repo that should be re-indexed is listed in resource configuration (see property 'repository-id')
                 if(!allowed && repoId.equals(reindexRepo)) allowed = true;
             }
         }
@@ -79,6 +78,7 @@
         }
 
         // If it's an extra repo, allowed needs to be set to true
+        Repository repo = null;
         if(allowed) {
             try {
                 repo = getRealm().getRepository(reindexRepo);
@@ -102,7 +102,7 @@
                 sb.append("</r:exception>");
             }
         } else if(reindexRepo != null) {
-            sb.append("<r:exception>Repository does not exist.</r:exception>");
+            sb.append("<r:exception>Repository '" + reindexRepo + "' does either not exist or is not configured in order to be re-indexed.</r:exception>");
         }
 
         sb.append("</r:reindex>");



More information about the Yanel-commits mailing list