maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r421500 - in /maven/repository-manager/trunk: maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ maven-repository-webapp/src/mai...
Date Thu, 13 Jul 2006 05:20:41 GMT
Author: brett
Date: Wed Jul 12 22:20:41 2006
New Revision: 421500

URL: http://svn.apache.org/viewvc?rev=421500&view=rev
Log:
better handling of index not existing

Modified:
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/QuickSearchAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java?rev=421500&r1=421499&r2=421500&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java
(original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java
Wed Jul 12 22:20:41 2006
@@ -261,7 +261,7 @@
      * @return true if the index already exists
      * @throws RepositoryIndexException
      */
-    protected boolean indexExists()
+    public boolean indexExists()
         throws RepositoryIndexException
     {
         if ( IndexReader.indexExists( indexPath ) )

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/QuickSearchAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/QuickSearchAction.java?rev=421500&r1=421499&r2=421500&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/QuickSearchAction.java
(original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/QuickSearchAction.java
Wed Jul 12 22:20:41 2006
@@ -83,8 +83,6 @@
     {
         // TODO: give action message if indexing is in progress
 
-        // TODO: return zero results if index doesn't yet exist
-
         assert q != null && q.length() != 0;
 
         Configuration configuration = configurationStore.getConfigurationFromStore();
@@ -93,6 +91,12 @@
         ArtifactRepository repository = getDefaultRepository( configuration );
 
         ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath,
repository );
+
+        if ( !index.indexExists() )
+        {
+            addActionError( "The repository is not yet indexed. Please wait, and then try
again." );
+            return ERROR;
+        }
 
         searchResult = searchLayer.searchGeneral( q, index );
 

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml?rev=421500&r1=421499&r2=421500&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml (original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/resources/xwork.xml Wed
Jul 12 22:20:41 2006
@@ -48,6 +48,7 @@
     <action name="quickSearch" class="quickSearchAction">
       <result name="input">/WEB-INF/jsp/quickSearch.jsp</result>
       <result>/WEB-INF/jsp/results.jsp</result>
+      <result name="error">/WEB-INF/jsp/quickSearch.jsp</result>
     </action>
 
     <!-- TODO! old actions

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp?rev=421500&r1=421499&r2=421500&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp
(original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp
Wed Jul 12 22:20:41 2006
@@ -33,6 +33,7 @@
     </ww:form>
     <p>
       Enter your search terms. A variety of data will be searched for your keywords.
+      <ww:actionerror />
     </p>
   </div>
 </div>



Mime
View raw message