better handling of index not existing

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@421500 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2006-07-13 05:20:41 +00:00
parent 5c970ed39e
commit 867ec5b07c
4 changed files with 9 additions and 3 deletions

View File

@ -261,7 +261,7 @@ public abstract class AbstractRepositoryIndex
* @return true if the index already exists
* @throws RepositoryIndexException
*/
protected boolean indexExists()
public boolean indexExists()
throws RepositoryIndexException
{
if ( IndexReader.indexExists( indexPath ) )

View File

@ -83,8 +83,6 @@ public class QuickSearchAction
{
// 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();
@ -94,6 +92,12 @@ public class QuickSearchAction
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 );
return SUCCESS;

View File

@ -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

View File

@ -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>