Examples of SearchResultLimits


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

       
        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add( "internal" );
        selectedRepos.add( "snapshots" );
       
        SearchResultLimits limits = new SearchResultLimits( action.getCurrentPage() );
        limits.setPageSize( 30 );
       
        SearchResultHit hit = new SearchResultHit();
        hit.setGroupId( "org.apache.archiva" );
        hit.setArtifactId( "archiva-configuration" );
        hit.setUrl( "url" );
View Full Code Here

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

       
        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add( "internal" );
        selectedRepos.add( "snapshots" );
       
        SearchResultLimits limits = new SearchResultLimits( action.getCurrentPage() );
        limits.setPageSize( 30 );
               
        SearchResults results = new SearchResults();
       
        userReposControl.expectAndReturn( userRepos.getObservableRepositoryIds( "user" ), selectedRepos );
       
View Full Code Here

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

        action.setManagedRepositoryList( managedRepos );
        action.setCurrentPage( 0 );
        action.setRowCount( 30 );
        action.setGroupId( "org" );
       
        SearchResultLimits limits = new SearchResultLimits( action.getCurrentPage() );
        limits.setPageSize( 30 );
       
        SearchResultHit hit = new SearchResultHit();
        hit.setGroupId( "org.apache.archiva" );
        hit.setArtifactId( "archiva-configuration" );
        hit.setUrl( "url" );
View Full Code Here

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

        action.setManagedRepositoryList( managedRepos );
        action.setCurrentPage( 0 );
        action.setRowCount( 30 );
        action.setGroupId( "org" );
       
        SearchResultLimits limits = new SearchResultLimits( action.getCurrentPage() );
        limits.setPageSize( 30 );
       
        SearchResultHit hit = new SearchResultHit();
        hit.setGroupId( "org.apache.archiva" );
        hit.setArtifactId( "archiva-configuration" );
        hit.setUrl( "url" );
View Full Code Here

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

        action.setManagedRepositoryList( managedRepos );
        action.setCurrentPage( 0 );
        action.setRowCount( 30 );
        action.setGroupId( "org" );
       
        SearchResultLimits limits = new SearchResultLimits( action.getCurrentPage() );
        limits.setPageSize( 30 );
               
        SearchResults results = new SearchResults();
       
        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add( "internal" );
View Full Code Here

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

        resultHit.setVersions( versions );
        resultHit.setRepositoryId( null );
       
        results.addHit( SearchUtil.getHitId( ARCHIVA_TEST_GROUP_ID, "archiva-webapp" ), resultHit );
       
        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
       
        searchControl.expectAndDefaultReturn( search.search( "", observableRepoIds, "archiva", limits, null ), results );
       
        archivaDAOControl.expectAndReturn( archivaDAO.query( new UniqueVersionConstraint( observableRepoIds, resultHit.getGroupId(),
                                                                                          resultHit.getArtifactId() ) ), null );
View Full Code Here

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

        resultHit.setArtifactId( ARCHIVA_TEST_ARTIFACT_ID );
        resultHit.setVersions( versions );
       
        results.addHit( SearchUtil.getHitId( ARCHIVA_TEST_GROUP_ID, ARCHIVA_TEST_ARTIFACT_ID ), resultHit );
       
        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
       
        searchControl.expectAndDefaultReturn( search.search( "", observableRepoIds, "archiva", limits, null ), results );
       
        archivaDAOControl.expectAndReturn( archivaDAO.query( new UniqueVersionConstraint( observableRepoIds, resultHit.getGroupId(),
                                                                                          resultHit.getArtifactId() ) ), null );
View Full Code Here

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

        results.addHit( SearchUtil.getHitId( resultHit.getGroupId(), resultHit.getArtifactId() ), resultHit );
   
        archivaDAOControl.expectAndReturn( archivaDAO.query( new UniqueVersionConstraint( observableRepoIds, resultHit.getGroupId(),
                                                                                          resultHit.getArtifactId() ) ), null );
       
        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
   
        searchControl.expectAndDefaultReturn( search.search( "", observableRepoIds, "archiva", limits, null ), results );
       
        ArchivaProjectModel model = new ArchivaProjectModel();
        model.setGroupId( ARCHIVA_TEST_GROUP_ID );
View Full Code Here

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

        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();
        searchControl.replay();
   
View Full Code Here

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

        if ( CollectionUtils.isEmpty( managedRepositoryList ) )
        {           
            return GlobalResults.ACCESS_TO_NO_REPOS;
        }

        SearchResultLimits limits = new SearchResultLimits( currentPage );
        limits.setPageSize( rowCount );
        List<String> selectedRepos = new ArrayList<String>();
       
        if ( repositoryId == null || StringUtils.isBlank( repositoryId ) ||
            "all".equals( StringUtils.stripToEmpty( repositoryId ) ) )
        {
            selectedRepos = getObservableRepos();
        }
        else
        {
            selectedRepos.add( repositoryId );
        }       

        if ( CollectionUtils.isEmpty( selectedRepos ) )
        {        
            return GlobalResults.ACCESS_TO_NO_REPOS;
        }

        SearchFields searchFields =
            new SearchFields( groupId, artifactId, version, null, className, selectedRepos );
               
        // TODO: add packaging in the list of fields for advanced search (UI)?
        try
        {
            results = getNexusSearch().search( getPrincipal(), searchFields, limits );
        }
        catch ( RepositorySearchException e )
        {
            addActionError( e.getMessage() );
            return ERROR;
        }
       
        if ( results.isEmpty() )
        {
            addActionError( "No results found" );
            return INPUT;
        }

        totalPages = results.getTotalHits() / limits.getPageSize();

        if ( ( results.getTotalHits() % limits.getPageSize() ) != 0 )
        {
            totalPages = totalPages + 1;
        }

        for (SearchResultHit hit : results.getHits())
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.