Package org.apache.archiva.indexer.search

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


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

        SearchFields searchFields = new SearchFields(groupId, artifactId, version, null, className, selectedRepos);

        if ( StringUtils.isNotBlank(this.bundleExportPackage) )
        {
            searchFields.setBundleExportPackage(this.bundleExportPackage);
        }

        if ( StringUtils.isNotBlank(this.bundleExportService) )
        {
            searchFields.setBundleExportService(this.bundleExportService);
        }

        if ( StringUtils.isNotBlank(this.bundleImportPackage) )
        {
            searchFields.setBundleImportPackage(this.bundleImportPackage);
        }

        if ( StringUtils.isNotBlank(this.bundleSymbolicName) )
        {
            searchFields.setBundleSymbolicName(this.bundleSymbolicName);
        }

        if ( StringUtils.isNotBlank(this.bundleName) )
        {
            searchFields.setBundleName(this.bundleName);
        }

        if ( StringUtils.isNotBlank(this.bundleVersion) )
        {
            searchFields.setBundleVersion(this.bundleVersion);
        }

        log.debug("filteredSearch with searchFields {}", searchFields);

        // TODO: add packaging in the list of fields for advanced search (UI)?
View Full Code Here


    {
        if ( StringUtils.isBlank( groupId ) || StringUtils.isBlank( artifactId ) )
        {
            return Collections.emptyList();
        }
        SearchFields searchField = new SearchFields();
        searchField.setGroupId( groupId );
        searchField.setArtifactId( artifactId );
        searchField.setPackaging( StringUtils.isBlank( packaging ) ? "jar" : packaging );
        searchField.setRepositories( getObservableRepos() );

        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), searchField, null );
            return getArtifacts( searchResults );
View Full Code Here

    {
        if ( searchRequest == null )
        {
            return Collections.emptyList();
        }
        SearchFields searchField = new BeanReplicator().replicateBean( searchRequest, SearchFields.class );
        SearchResultLimits limits = new SearchResultLimits( 0 );

        // if no repos set we use ones available for the user
        if ( searchField.getRepositories() == null || searchField.getRepositories().isEmpty() )
        {
            searchField.setRepositories( getObservableRepos() );
        }

        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), searchField, limits );
View Full Code Here

        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add("internal");
        selectedRepos.add("snapshots");

        SearchFields searchFields = new SearchFields("org", null, null, null, null, selectedRepos);

        searchControl.expectAndReturn(search.search("user", searchFields, limits), results);

        searchControl.replay();
View Full Code Here

        results.addHit(SearchUtil.getHitId("org.apache.archiva", "archiva-configuration", null, "jar"), hit);

        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add("internal");

        SearchFields searchFields = new SearchFields("org", null, null, null, null, selectedRepos);

        userReposControl.expectAndReturn(userRepos.getObservableRepositoryIds("user"), selectedRepos);

        searchControl.expectAndReturn(search.search("user", searchFields, limits), results);
View Full Code Here

        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add("internal");
        selectedRepos.add("snapshots");

        SearchFields searchFields = new SearchFields("org", null, null, null, null, selectedRepos);

        searchControl.expectAndReturn(search.search("user", searchFields, limits), results);

        searchControl.replay();
View Full Code Here

    {
        if ( StringUtils.isBlank( groupId ) || StringUtils.isBlank( artifactId ) )
        {
            return Collections.emptyList();
        }
        SearchFields searchField = new SearchFields();
        searchField.setGroupId( groupId );
        searchField.setArtifactId( artifactId );
        searchField.setPackaging( StringUtils.isBlank( packaging ) ? "jar" : packaging );
        searchField.setRepositories( getObservableRepos() );

        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), searchField, null );
            return getArtifacts( searchResults );
View Full Code Here

    {
        if ( searchRequest == null )
        {
            return Collections.emptyList();
        }
        SearchFields searchField = getModelMapper().map( searchRequest, SearchFields.class );
        SearchResultLimits limits = new SearchResultLimits( 0 );
        limits.setPageSize( searchRequest.getPageSize() );

        // if no repos set we use ones available for the user
        if ( searchField.getRepositories() == null || searchField.getRepositories().isEmpty() )
        {
            searchField.setRepositories( getObservableRepos() );
        }

        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), searchField, limits );
View Full Code Here

                        return "artifactId mandatory";
                    }
                } ).build();
            }

            SearchFields searchField = new SearchFields();
            searchField.setGroupId( groupId );
            searchField.setArtifactId( artifactId );
            searchField.setPackaging( StringUtils.isBlank( packaging ) ? "jar" : packaging );
            if ( !StringUtils.equals( version, LATEST_KEYWORD ) )
            {
                searchField.setVersion( version );
            }
            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() )
            {
View Full Code Here

       
        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add( "internal" );
        selectedRepos.add( "snapshots" );
       
        SearchFields searchFields = new SearchFields( "org", null, null, null, null, selectedRepos );
       
        searchControl.expectAndReturn( search.search( "user", searchFields, limits ), results );
       
        searchControl.replay();
       
View Full Code Here

TOP

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

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.