archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <br...@apache.org>
Subject Re: svn commit: r816084 - in /archiva/trunk/archiva-modules: archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ archiva-scheduled/src/main/java/org/apache/maven/archi...
Date Fri, 18 Sep 2009 04:21:28 GMT
I'd suggest, instead of modifying the existing API - add a new method  
that introduces scanAll, and delegate the old method to it (defaulting  
to false which was the previous behaviour). This would have less code  
impact?

It also looks like it might fix bugs with just-in-time scanning of  
proxied and uploaded files, if that means we can close other issues.

But isn't setting it to true for the scheduled job incorrect?

- Brett

On 17/09/2009, at 5:48 PM, oching@apache.org wrote:

> Author: oching
> Date: Thu Sep 17 07:48:55 2009
> New Revision: 816084
>
> URL: http://svn.apache.org/viewvc?rev=816084&view=rev
> Log:
> [MRM-1056] Option to force scanning of an artifact/repository  
> regardless of file dates
> o add checkbox for processing all artifacts beside Scan Repository  
> Now button in repositories page
> o scan all artifacts if flag is set
> o added unit tests
>
> Modified:
>    archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/ 
> java/org/apache/maven/archiva/proxy/ 
> DefaultRepositoryProxyConnectors.java
>    archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/ 
> apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java
>    archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/ 
> apache/maven/archiva/scheduled/RepositoryTaskJob.java
>    archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/ 
> apache/maven/archiva/scheduled/executors/ 
> ArchivaRepositoryScanningTaskExecutor.java
>    archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/ 
> apache/maven/archiva/scheduled/tasks/RepositoryTask.java
>    archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/ 
> apache/maven/archiva/scheduled/tasks/TaskCreator.java
>    archiva/trunk/archiva-modules/archiva-scheduled/src/test/java/org/ 
> apache/maven/archiva/scheduled/executors/ 
> ArchivaRepositoryScanningTaskExecutorTest.java
>    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/ 
> java/org/apache/maven/archiva/web/action/UploadAction.java
>    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/ 
> java/org/apache/maven/archiva/web/action/admin/SchedulerAction.java
>    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/ 
> webapp/WEB-INF/jsp/admin/repositories.jsp
>    archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/ 
> java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
>    archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva- 
> xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/ 
> AdministrationServiceImpl.java
>
> Modified: archiva/trunk/archiva-modules/archiva-base/archiva-proxy/ 
> src/main/java/org/apache/maven/archiva/proxy/ 
> DefaultRepositoryProxyConnectors.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/ 
> main/java/org/apache/maven/archiva/proxy/ 
> DefaultRepositoryProxyConnectors.java (original)
> +++ archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/ 
> main/java/org/apache/maven/archiva/proxy/ 
> DefaultRepositoryProxyConnectors.java Thu Sep 17 07:48:55 2009
> @@ -585,7 +585,7 @@
>
>     private void queueRepositoryTask( String repositoryId, File  
> localFile )
>     {
> -        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repositoryId, localFile.getName(), localFile, true );
> +        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repositoryId, localFile.getName(), localFile, true, true );
>
>         try
>         {
>
> Modified: archiva/trunk/archiva-modules/archiva-scheduled/src/main/ 
> java/org/apache/maven/archiva/scheduled/ 
> DefaultArchivaTaskScheduler.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/ 
> org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java  
> (original)
> +++ archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/ 
> org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java  
> Thu Sep 17 07:48:55 2009
> @@ -428,7 +428,7 @@
>     private synchronized void queueInitialRepoScan 
> ( ManagedRepositoryConfiguration repoConfig )
>     {
>         String repoId = repoConfig.getId();
> -        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repoId, "initial-scan" );
> +        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repoId, "initial-scan", true );
>
>         if ( queuedRepos.contains( repoId ) )
>         {
>
> Modified: archiva/trunk/archiva-modules/archiva-scheduled/src/main/ 
> java/org/apache/maven/archiva/scheduled/RepositoryTaskJob.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/RepositoryTaskJob.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/ 
> org/apache/maven/archiva/scheduled/RepositoryTaskJob.java (original)
> +++ archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/ 
> org/apache/maven/archiva/scheduled/RepositoryTaskJob.java Thu Sep 17  
> 07:48:55 2009
> @@ -59,7 +59,7 @@
>         TaskQueue taskQueue = (TaskQueue) dataMap.get( TASK_QUEUE );
>         String queuePolicy = dataMap.get 
> ( TASK_QUEUE_POLICY ).toString();
>
> -        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( (String) dataMap.get( TASK_REPOSITORY ), "" );
> +        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( (String) dataMap.get( TASK_REPOSITORY ), "", true );
>         task.setName( context.getJobDetail().getName() );
>
>         try
>
> Modified: archiva/trunk/archiva-modules/archiva-scheduled/src/main/ 
> java/org/apache/maven/archiva/scheduled/executors/ 
> ArchivaRepositoryScanningTaskExecutor.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/ 
> org/apache/maven/archiva/scheduled/executors/ 
> ArchivaRepositoryScanningTaskExecutor.java (original)
> +++ archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/ 
> org/apache/maven/archiva/scheduled/executors/ 
> ArchivaRepositoryScanningTaskExecutor.java Thu Sep 17 07:48:55 2009
> @@ -130,11 +130,14 @@
>                 long sinceWhen = RepositoryScanner.FRESH_SCAN;
>
>                 List<RepositoryContentStatistics> results =  
> (List<RepositoryContentStatistics>) dao.query( new  
> MostRecentRepositoryScanStatistics( arepo.getId() ) );
> -
> +
>                 if ( CollectionUtils.isNotEmpty( results ) )
>                 {
>                     RepositoryContentStatistics lastStats =  
> results.get( 0 );
> -                    sinceWhen = lastStats.getWhenGathered().getTime 
> () + lastStats.getDuration();
> +                    if( !repoTask.isScanAll() )
> +                    {
> +                        sinceWhen = lastStats.getWhenGathered 
> ().getTime() + lastStats.getDuration();
> +                    }
>                 }
>
>                 RepositoryScanStatistics stats = repoScanner.scan 
> ( arepo, sinceWhen );
>
> Modified: archiva/trunk/archiva-modules/archiva-scheduled/src/main/ 
> java/org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/ 
> org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java  
> (original)
> +++ archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/ 
> org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java Thu Sep  
> 17 07:48:55 2009
> @@ -42,6 +42,18 @@
>
>     boolean updateRelatedArtifacts;
>
> +    boolean scanAll;
> +
> +    public boolean isScanAll()
> +    {
> +        return scanAll;
> +    }
> +
> +    public void setScanAll( boolean scanAll )
> +    {
> +        this.scanAll = scanAll;
> +    }
> +
>     public String getRepositoryId()
>     {
>         return repositoryId;
>
> Modified: archiva/trunk/archiva-modules/archiva-scheduled/src/main/ 
> java/org/apache/maven/archiva/scheduled/tasks/TaskCreator.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/TaskCreator.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/ 
> org/apache/maven/archiva/scheduled/tasks/TaskCreator.java (original)
> +++ archiva/trunk/archiva-modules/archiva-scheduled/src/main/java/ 
> org/apache/maven/archiva/scheduled/tasks/TaskCreator.java Thu Sep 17  
> 07:48:55 2009
> @@ -31,7 +31,7 @@
>  */
> public class TaskCreator
> {
> -    public static RepositoryTask createRepositoryTask( String  
> repositoryId, String taskNameSuffix )
> +    public static RepositoryTask createRepositoryTask( String  
> repositoryId, String taskNameSuffix, boolean scanAll )
>     {
>         String suffix = "";
>         if( !StringUtils.isEmpty( taskNameSuffix ) )
> @@ -43,14 +43,15 @@
>         task.setRepositoryId( repositoryId );
>         task.setName( DefaultArchivaTaskScheduler.REPOSITORY_JOB +  
> ":" + repositoryId + suffix );
>         task.setQueuePolicy( ArchivaTask.QUEUE_POLICY_WAIT );
> +        task.setScanAll( scanAll );
>
>         return task;
>     }
>
>     public static RepositoryTask createRepositoryTask( String  
> repositoryId, String taskNameSuffix, File resourceFile,
> -                                                       boolean  
> updateRelatedArtifacts )
> +                                                       boolean  
> updateRelatedArtifacts, boolean scanAll )
>     {
> -        RepositoryTask task = createRepositoryTask( repositoryId,  
> taskNameSuffix );
> +        RepositoryTask task = createRepositoryTask( repositoryId,  
> taskNameSuffix, scanAll );
>         task.setResourceFile( resourceFile );
>         task.setUpdateRelatedArtifacts( updateRelatedArtifacts );
>
>
> Modified: archiva/trunk/archiva-modules/archiva-scheduled/src/test/ 
> java/org/apache/maven/archiva/scheduled/executors/ 
> ArchivaRepositoryScanningTaskExecutorTest.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-scheduled/src/test/java/ 
> org/apache/maven/archiva/scheduled/executors/ 
> ArchivaRepositoryScanningTaskExecutorTest.java (original)
> +++ archiva/trunk/archiva-modules/archiva-scheduled/src/test/java/ 
> org/apache/maven/archiva/scheduled/executors/ 
> ArchivaRepositoryScanningTaskExecutorTest.java Thu Sep 17 07:48:55  
> 2009
> @@ -21,6 +21,7 @@
>
> import java.io.File;
> import java.net.URL;
> +import java.util.Calendar;
> import java.util.List;
> import java.util.Map;
> import java.util.Properties;
> @@ -34,11 +35,13 @@
> import org.apache.maven.archiva.database.ArtifactDAO;
> import  
> org.apache.maven.archiva.database.constraints.ArtifactsProcessedConstraint 
> ;
> import org.apache.maven.archiva.model.ArchivaArtifact;
> +import org.apache.maven.archiva.model.RepositoryContentStatistics;
> import org.apache.maven.archiva.scheduled.tasks.RepositoryTask;
> import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
> import org.codehaus.plexus.jdo.JdoFactory;
> import org.codehaus.plexus.spring.PlexusInSpringTestCase;
> import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
> +import org.codehaus.plexus.util.FileUtils;
> import org.jpox.SchemaTool;
>
> /**
> @@ -53,6 +56,8 @@
>
>     protected ArchivaDAO dao;
>
> +    private File repoDir;
> +
>     protected void setUp()
>         throws Exception
>     {
> @@ -131,12 +136,114 @@
>         this.dao = (ArchivaDAO) lookup( ArchivaDAO.class.getName(),  
> "jdo" );
>
>         taskExecutor = (TaskExecutor) lookup( TaskExecutor.class,  
> "test-repository-scanning" );
> +
> +        File sourceRepoDir = new File( getBasedir(), "src/test/ 
> repositories/default-repository" );
> +        repoDir = new File( getBasedir(), "target/default- 
> repository" );
> +
> +        repoDir.mkdir();
> +
> +        FileUtils.copyDirectoryStructure( sourceRepoDir, repoDir );
> +
> +        assertTrue( repoDir.exists() );
>     }
> -
> +
> +    protected void tearDown() throws Exception
> +    {
> +        FileUtils.deleteDirectory( repoDir );
> +
> +        assertFalse( repoDir.exists() );
> +
> +        super.tearDown();
> +    }
> +
>     public void testExecutor() throws Exception
>     {
> -        File repoDir = new File( getBasedir(), "src/test/ 
> repositories/default-repository" );
> +        assertTrue( "Default Test Repository should exist.",  
> repoDir.exists() && repoDir.isDirectory() );
> +
> +        ArchivaConfiguration archivaConfig = (ArchivaConfiguration)  
> lookup( ArchivaConfiguration.class );
> +        assertNotNull( archivaConfig );
> +
> +        // Create it
> +        ManagedRepositoryConfiguration repo = createRepository 
> ( "testRepo", "Test Repository", repoDir );
> +        assertNotNull( repo );
> +        archivaConfig.getConfiguration().getManagedRepositories 
> ().clear();
> +        archivaConfig.getConfiguration().addManagedRepository 
> ( repo );
> +
> +        RepositoryTask repoTask = new RepositoryTask();
> +
> +        repoTask.setName( "testRepoTask" );
> +        repoTask.setRepositoryId( "testRepo" );
> +
> +        taskExecutor.executeTask( repoTask );
> +
> +        ArtifactDAO adao = dao.getArtifactDAO();
> +        List<ArchivaArtifact> unprocessedResultList =  
> adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) );
> +
> +        assertNotNull( unprocessedResultList );
> +        assertEquals("Incorrect number of unprocessed artifacts  
> detected.", 8, unprocessedResultList.size() );
> +    }
> +
> +    public void testExecutorScanOnlyNewArtifacts()
> +        throws Exception
> +    {
> +        assertTrue( "Default Test Repository should exist.",  
> repoDir.exists() && repoDir.isDirectory() );
> +
> +        ArchivaConfiguration archivaConfig = (ArchivaConfiguration)  
> lookup( ArchivaConfiguration.class );
> +        assertNotNull( archivaConfig );
> +
> +        // Create it
> +        ManagedRepositoryConfiguration repo = createRepository 
> ( "testRepo", "Test Repository", repoDir );
> +        assertNotNull( repo );
> +        archivaConfig.getConfiguration().getManagedRepositories 
> ().clear();
> +        archivaConfig.getConfiguration().addManagedRepository 
> ( repo );
> +
> +        RepositoryTask repoTask = new RepositoryTask();
> +
> +        repoTask.setName( "testRepoTask" );
> +        repoTask.setRepositoryId( "testRepo" );
> +        repoTask.setScanAll( false );
> +
> +        RepositoryContentStatistics stats = new  
> RepositoryContentStatistics();
> +        stats.setDuration( 1234567 );
> +        stats.setNewFileCount( 8 );
> +        stats.setRepositoryId( "testRepo" );
> +        stats.setTotalArtifactCount( 8 );
> +        stats.setTotalFileCount( 8 );
> +        stats.setTotalGroupCount( 3 );
> +        stats.setTotalProjectCount( 5 );
> +        stats.setTotalSize( 999999 );
> +        stats.setWhenGathered( Calendar.getInstance().getTime() );
> +
> +        dao.getRepositoryContentStatisticsDAO 
> ().saveRepositoryContentStatistics( stats );
> +
> +        taskExecutor.executeTask( repoTask );
>
> +        ArtifactDAO adao = dao.getArtifactDAO();
> +        List<ArchivaArtifact> unprocessedResultList =  
> adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) );
> +
> +        assertNotNull( unprocessedResultList );
> +        assertEquals("Incorrect number of unprocessed artifacts  
> detected. No new artifacts should have been found.", 0,  
> unprocessedResultList.size() );
> +
> +        File newArtifactGroup = new File( repoDir, "org/apache/ 
> archiva");
> +
> +        FileUtils.copyDirectoryStructure( new File( getBasedir(),  
> "target/test-classes/test-repo/org/apache/archiva"),  
> newArtifactGroup );
> +
> +        // update last modified date
> +        new File( newArtifactGroup, "archiva-index-methods-jar-test/ 
> 1.0/pom.xml" ).setLastModified( Calendar.getInstance 
> ().getTimeInMillis() + 1000 );
> +        new File( newArtifactGroup, "archiva-index-methods-jar-test/ 
> 1.0/archiva-index-methods-jar-test-1.0.jar" ).setLastModified 
> ( Calendar.getInstance().getTimeInMillis() + 1000 );
> +
> +        assertTrue( newArtifactGroup.exists() );
> +
> +        taskExecutor.executeTask( repoTask );
> +
> +        unprocessedResultList = adao.queryArtifacts( new  
> ArtifactsProcessedConstraint( false ) );
> +        assertNotNull( unprocessedResultList );
> +        assertEquals( "Incorrect number of unprocessed artifacts  
> detected. One new artifact should have been found.", 1,  
> unprocessedResultList.size() );
> +    }
> +
> +    public void testExecutorForceScanAll()
> +        throws Exception
> +    {
>         assertTrue( "Default Test Repository should exist.",  
> repoDir.exists() && repoDir.isDirectory() );
>
>         ArchivaConfiguration archivaConfig = (ArchivaConfiguration)  
> lookup( ArchivaConfiguration.class );
> @@ -152,6 +259,20 @@
>
>         repoTask.setName( "testRepoTask" );
>         repoTask.setRepositoryId( "testRepo" );
> +        repoTask.setScanAll( true );
> +
> +        RepositoryContentStatistics stats = new  
> RepositoryContentStatistics();
> +        stats.setDuration( 1234567 );
> +        stats.setNewFileCount( 8 );
> +        stats.setRepositoryId( "testRepo" );
> +        stats.setTotalArtifactCount( 8 );
> +        stats.setTotalFileCount( 8 );
> +        stats.setTotalGroupCount( 3 );
> +        stats.setTotalProjectCount( 5 );
> +        stats.setTotalSize( 999999 );
> +        stats.setWhenGathered( Calendar.getInstance().getTime() );
> +
> +        dao.getRepositoryContentStatisticsDAO 
> ().saveRepositoryContentStatistics( stats );
>
>         taskExecutor.executeTask( repoTask );
>
>
> Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/ 
> src/main/java/org/apache/maven/archiva/web/action/UploadAction.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/ 
> main/java/org/apache/maven/archiva/web/action/UploadAction.java  
> (original)
> +++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/ 
> main/java/org/apache/maven/archiva/web/action/UploadAction.java Thu  
> Sep 17 07:48:55 2009
> @@ -617,7 +617,7 @@
>
>     private void queueRepositoryTask( String repositoryId, File  
> localFile )
>     {
> -        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repositoryId, localFile.getName(), localFile, true );
> +        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repositoryId, localFile.getName(), localFile, true, true );
>
>         try
>         {
>
> Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/ 
> src/main/java/org/apache/maven/archiva/web/action/admin/ 
> SchedulerAction.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/SchedulerAction.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/ 
> main/java/org/apache/maven/archiva/web/action/admin/ 
> SchedulerAction.java (original)
> +++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/ 
> main/java/org/apache/maven/archiva/web/action/admin/ 
> SchedulerAction.java Thu Sep 17 07:48:55 2009
> @@ -50,7 +50,9 @@
>     private ArchivaTaskScheduler taskScheduler;
>
>     private String repoid;
> -
> +
> +    private boolean scanAll;
> +
>     public String scanRepository()
>     {
>         if ( StringUtils.isBlank( repoid ) )
> @@ -59,7 +61,7 @@
>             return SUCCESS;
>         }
>
> -        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repoid, "" );
> +        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repoid, "", scanAll );
>
>         boolean scheduleTask = false;
>
> @@ -181,4 +183,14 @@
>     {
>         this.repoid = repoid;
>     }
> +
> +    public boolean getScanAll()
> +    {
> +        return scanAll;
> +    }
> +
> +    public void setScanAll( boolean scanAll )
> +    {
> +        this.scanAll = scanAll;
> +    }
> }
>
> Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/ 
> src/main/webapp/WEB-INF/jsp/admin/repositories.jsp
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/ 
> main/webapp/WEB-INF/jsp/admin/repositories.jsp (original)
> +++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/ 
> main/webapp/WEB-INF/jsp/admin/repositories.jsp Thu Sep 17 07:48:55  
> 2009
> @@ -198,20 +198,21 @@
>       Actions
>     </th>
>     <td>
> -      <table>
> -        <tr>
> -          <td>
> -            <redback:ifAuthorized permission="archiva-run-indexer">
> -              <s:form action="indexRepository" theme="simple">
> -                <s:hidden name="repoid" value="% 
> {#attr.repository.id}"/>
> -                <s:submit value="Scan Repository Now"/>
> -              </s:form>
> -            </redback:ifAuthorized>
> -          </td>
> -        </tr>
> -      </table>
> +      <redback:ifAuthorized permission="archiva-run-indexer">
> +        <s:form action="indexRepository" theme="simple">
> +        <s:hidden name="repoid" value="%{#attr.repository.id}"/>
> +        <table>
> +          <tr>
> +            <td><s:checkbox name="scanAll" value="scanAll"/>Process  
> All Artifacts</td>
> +          </tr>
> +          <tr>
> +            <td><s:submit value="Scan Repository Now"/></td>
> +          </tr>
> +        </table>
> +        </s:form>
> +      </redback:ifAuthorized>
>     </td>
> -  </tr>
> +  </tr>
>   <tr>
>     <th>Stats</th>
>     <td>
>
> Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/ 
> src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/ 
> main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java  
> (original)
> +++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/ 
> main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java  
> Thu Sep 17 07:48:55 2009
> @@ -645,7 +645,7 @@
>
>     private void queueRepositoryTask(  File localFile )
>     {
> -        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repository.getId(), localFile.getName(), localFile, false );
> +        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repository.getId(), localFile.getName(), localFile, false, true );
>
>         try
>         {
>
> Modified: archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/ 
> archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/ 
> services/AdministrationServiceImpl.java
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/AdministrationServiceImpl.java?rev=816084&r1=816083&r2=816084&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva- 
> xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/ 
> AdministrationServiceImpl.java (original)
> +++ archiva/trunk/archiva-modules/archiva-web/archiva-xmlrpc/archiva- 
> xmlrpc-services/src/main/java/org/apache/archiva/web/xmlrpc/services/ 
> AdministrationServiceImpl.java Thu Sep 17 07:48:55 2009
> @@ -313,7 +313,7 @@
>             }
>         }
>
> -        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repoId, "" );
> +        RepositoryTask task = TaskCreator.createRepositoryTask 
> ( repoId, "", false );
>
>         taskScheduler.queueRepositoryTask( task );
>
>
>


Mime
View raw message