import org.apache.maven.repository.indexing.RepositoryIndexException;
import org.apache.maven.repository.indexing.RepositoryIndexSearchException;
import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
-import org.apache.maven.repository.indexing.RepositoryIndex;
+import org.apache.maven.repository.indexing.RepositoryIndexSearchLayer;
import org.apache.maven.repository.indexing.query.SinglePhraseQuery;
import org.apache.maven.repository.manager.web.job.Configuration;
+import org.apache.maven.repository.indexing.RepositoryIndex;
import java.io.File;
import java.net.MalformedURLException;
private String md5;
+ private List searchResult;
+
/**
* @plexus.requirement
*/
*/
private Configuration configuration;
- private List artifacts;
-
public String execute()
throws MalformedURLException, RepositoryIndexException, RepositoryIndexSearchException
{
ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath, repository );
- DefaultRepositoryIndexSearcher searcher = factory.createDefaultRepositoryIndexSearcher( index );
+ RepositoryIndexSearchLayer searchLayer = factory.createRepositoryIndexSearchLayer( index );
- artifacts = searcher.search( new SinglePhraseQuery( key, searchTerm ) );
+ searchResult = searchLayer.searchAdvanced( new SinglePhraseQuery( key, searchTerm ) );
return SUCCESS;
}
this.md5 = md5;
}
- public List getArtifacts()
+ public List getSearchResult()
{
- return artifacts;
+ return searchResult;
}
}
<%@ include file="form.jspf" %>
-<table>
+<table border="1px" cellspacing="0">
<tr>
<th>Group ID</th>
<th>Artifact ID</th>
<th>Version</th>
</tr>
- <ww:iterator value="artifacts">
+ <ww:iterator value="searchResult">
<tr>
- <td><ww:property value="groupId"/></td>
- <td><ww:property value="artifactId"/></td>
- <td><ww:property value="version"/></td>
+ <td valign="top">
+ <ww:property value="Artifact.getGroupId()"/>
+ </td>
+ <td valign="top">
+ <ww:property value="Artifact.getArtifactId()"/>
+ </td>
+ <td valign="top">
+ <ww:property value="Artifact.getVersion()"/>
+ </td>
</tr>
</ww:iterator>
</table>