Package org.apache.archiva.indexer.search

Examples of org.apache.archiva.indexer.search.SearchResults


        observableRepoIds.add( "repo1.mirror" );
        observableRepoIds.add( "public.releases" );

        userReposControl.expectAndReturn( userRepos.getObservableRepositories(), observableRepoIds );

        SearchResults results = new SearchResults();
        List<String> versions = new ArrayList<String>();
        versions.add( "1.0" );

        SearchResultHit resultHit = new SearchResultHit();
        resultHit.setGroupId( ARCHIVA_TEST_GROUP_ID );
        resultHit.setArtifactId( "archiva-webapp" );
        resultHit.setVersions( versions );
        resultHit.setRepositoryId( null );

        results.addHit( SearchUtil.getHitId( ARCHIVA_TEST_GROUP_ID, "archiva-webapp", null, "war" ), resultHit );

        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );

        searchControl.expectAndDefaultReturn( search.search( "", observableRepoIds, "archiva", limits, null ),
                                              results );
View Full Code Here


        observableRepoIds.add( "repo1.mirror" );
        observableRepoIds.add( "public.releases" );

        userReposControl.expectAndReturn( userRepos.getObservableRepositories(), observableRepoIds );

        SearchResults results = new SearchResults();
        List<String> versions = new ArrayList<String>();
        versions.add( "1.0" );

        SearchResultHit resultHit = new SearchResultHit();
        resultHit.setRepositoryId( null );
        resultHit.setGroupId( ARCHIVA_TEST_GROUP_ID );
        resultHit.setArtifactId( ARCHIVA_TEST_ARTIFACT_ID );
        resultHit.setVersions( versions );

        results.addHit( SearchUtil.getHitId( ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID, null, "war" ),
                        resultHit );

        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );

        searchControl.expectAndDefaultReturn( search.search( "", observableRepoIds, "archiva", limits, null ),
View Full Code Here

        observableRepoIds.add( "repo1.mirror" );
        observableRepoIds.add( "public.releases" );

        userReposControl.expectAndReturn( userRepos.getObservableRepositories(), observableRepoIds );

        SearchResults results = new SearchResults();
        List<String> versions = new ArrayList<String>();
        versions.add( "1.0" );

        SearchResultHit resultHit = new SearchResultHit();
        resultHit.setGroupId( ARCHIVA_TEST_GROUP_ID );
        resultHit.setArtifactId( ARCHIVA_TEST_ARTIFACT_ID );
        resultHit.setVersions( versions );
        resultHit.setRepositoryId( null );

        results.addHit( SearchUtil.getHitId( resultHit.getGroupId(), resultHit.getArtifactId(), null, "war" ),
                        resultHit );

        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );

        searchControl.expectAndDefaultReturn( search.search( "", observableRepoIds, "archiva", limits, null ),
View Full Code Here

        observableRepoIds.add( "repo1.mirror" );
        observableRepoIds.add( "public.releases" );

        userReposControl.expectAndReturn( userRepos.getObservableRepositories(), observableRepoIds );

        SearchResults results = new SearchResults();
        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );

        searchControl.expectAndDefaultReturn( search.search( "", observableRepoIds, "non-existent", limits, null ),
                                              results );
        userReposControl.replay();
View Full Code Here

        }

        SearchResultLimits limits = new SearchResultLimits( 0 );
        try
        {
            SearchResults searchResults =
                repositorySearch.search( getPrincipal(), getObservableRepos(), queryString, limits,
                                         Collections.<String>emptyList() );
            return getArtifacts( searchResults );

        }
View Full Code Here

        }
        SearchResultLimits limits =
            new SearchResultLimits( searchRequest.getPageSize(), searchRequest.getSelectedPage() );
        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), repositories, queryString, limits,
                                                                   Collections.<String>emptyList() );
            return getArtifacts( searchResults );

        }
        catch ( RepositorySearchException e )
View Full Code Here

        searchField.setPackaging( StringUtils.isBlank( packaging ) ? "jar" : packaging );
        searchField.setRepositories( getObservableRepos() );

        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), searchField, null );
            return getArtifacts( searchResults );
        }
        catch ( RepositorySearchException e )
        {
            log.error( e.getMessage(), e );
View Full Code Here

            searchField.setRepositories( getObservableRepos() );
        }

        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), searchField, limits );
            return getArtifacts( searchResults );
        }
        catch ( RepositorySearchException e )
        {
            log.error( e.getMessage(), e );
View Full Code Here

            searchField.setClassifier( classifier );
            List<String> userRepos = getObservablesRepoIds().getStrings();
            searchField.setRepositories(
                StringUtils.isEmpty( repositoryId ) ? userRepos : Arrays.asList( repositoryId ) );
            searchField.setExactSearch( true );
            SearchResults searchResults = repositorySearch.search( getPrincipal(), searchField, null );
            List<Artifact> artifacts = getArtifacts( searchResults );

            if ( artifacts.isEmpty() )
            {
                return Response.status( new Response.StatusType()
View Full Code Here

        throws Exception
    {  
        List<Artifact> artifacts = new ArrayList<Artifact>();
        List<String> observableRepos = xmlRpcUserRepositories.getObservableRepositories();
        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
        SearchResults results = null;
       
        results = search.search( "", observableRepos, queryString, limits, null );
       
        for ( SearchResultHit resultHit : results.getHits() )
        {
            // double-check all versions as done in SearchAction
            final List<String> versions =
                (List<String>) archivaDAO.query( new UniqueVersionConstraint( observableRepos, resultHit.getGroupId(),
                                                    resultHit.getArtifactId() ) );
View Full Code Here

TOP

Related Classes of org.apache.archiva.indexer.search.SearchResults

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.