]> source.dussan.org Git - archiva.git/commitdiff
[MRM-275]
authorMaria Odea B. Ching <oching@apache.org>
Mon, 6 Aug 2007 05:45:38 +0000 (05:45 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Mon, 6 Aug 2007 05:45:38 +0000 (05:45 +0000)
- Added days older, retention count and delete released snapshots fields in repository page.
- Updated RepositoryPurgeConsumer

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@563030 13f79535-47bb-0310-9956-ffa450edef68

archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AdminRepositoryConfiguration.java
archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/repositoryForm.jspf
archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp

index 014d6a6c90bf29545154be9402964577dbd37966..f2022addccdee172c6d350ce02dae755dec2114a 100644 (file)
           </description>\r
           <defaultValue>100</defaultValue>\r
         </field>\r
+        <field>\r
+          <name>deleteReleasedSnapshots</name>\r
+          <version>1.0.0+</version>\r
+          <type>boolean</type>\r
+          <description>\r
+               True if the released snapshots are to be removed from the repo during repository purge.\r
+          </description>\r
+          <defaultValue>false</defaultValue>\r
+        </field>\r
       </fields>\r
       <codeSegments>\r
         <codeSegment>\r
         }\r
 \r
         return this.url.startsWith( "file" );\r
-    }          \r
+    }\r
+\r
           ]]></code>\r
         </codeSegment>\r
       </codeSegments>\r
index fa6df3f5c2daad232f699d0de862358212580100..065521f8b1a11f137464a2e77d090fd3f2e502b6 100644 (file)
@@ -81,7 +81,7 @@ public class RepositoryPurgeConsumer
     /**
      * @plexus.requirement role-hint="jdo"
      */
-    private ArchivaDAO dao;
+    private ArchivaDAO dao;   
 
     /**
      * @plexus.requirement
@@ -176,7 +176,11 @@ public class RepositoryPurgeConsumer
     {
         try
         {
-            cleanUp.process( path, configuration.getConfiguration() );
+            RepositoryConfiguration repoConfig = configuration.getConfiguration().findRepositoryById( repository.getId() );
+            if( repoConfig.isDeleteReleasedSnapshots() )
+            {
+                cleanUp.process( path, configuration.getConfiguration() );
+            }
 
             repoPurge.process( path, configuration.getConfiguration() );
         }
index 01bf410948f8cdca1ce2452ae80ca09fc143af95..665dbafbe4c52fb562b3d4589ee6839df699c578 100644 (file)
@@ -59,6 +59,10 @@ public class AdminRepositoryConfiguration
         this.setIndexDir( repoconfig.getIndexDir() );
         this.setRefreshCronExpression( repoconfig.getRefreshCronExpression() );
 
+        this.setDaysOlder( repoconfig.getDaysOlder() );
+        this.setRetentionCount( repoconfig.getRetentionCount() );
+        this.setDeleteReleasedSnapshots( repoconfig.isDeleteReleasedSnapshots() );
+
         if ( repoconfig.isManaged() )
         {
             RepositoryURL url = new RepositoryURL( repoconfig.getUrl() );
index f0f42a099eb0e23a28ff8762778efdbb5dbe838b..6fe3c6e5358a74f0b871db335177f142e1ebfff0 100644 (file)
 <ww:select list="#@java.util.LinkedHashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}"
            name="repository.layout" label="Type"/>
 <ww:textfield name="repository.refreshCronExpression" label="Cron" size="40" required="true" />
+<ww:textfield name="repository.daysOlder" label="Repository Purge By Days Older Than" size="5"/>
+<ww:textfield name="repository.retentionCount" label="Repository Purge By Retention Count" size="5"/>
 <ww:checkbox name="repository.releases" value="repository.releases" label="Releases Included"/>
 <ww:checkbox name="repository.snapshots" value="repository.snapshots" label="Snapshots Included"/>
 <ww:checkbox name="repository.indexed" value="repository.indexed" label="Scannable"/>
+<ww:checkbox name="repository.deleteReleasedSnapshots" value="repository.deleteReleasedSnapshots"
+           label="Delete Released Snapshots"/>
+
  
index 43c4385be810079ee733d63b4b8a436b617094c1..ef735ed7319c7b40f9d05315a8af5fcb6a302a61 100644 (file)
                 </c:otherwise>
               </c:choose>
             </td>
+          </tr>          
+          <tr>
+            <th>Repository Purge By Days Older Than</th>
+            <td>${repository.daysOlder}</td>
+          </tr>
+          <tr>
+            <th>Repository Purge By Retention Count</th>
+            <td>${repository.retentionCount}</td>
           </tr>
           <tr>
             <th>Releases Included</th>
             <th>Scanned</th>
             <td class="${repository.indexed ? 'donemark' : 'errormark'} booleanIcon"> ${repository.indexed}</td>
           </tr>
+          <tr>
+            <th>Delete Released Snapshots</th>
+            <td class="${repository.deleteReleasedSnapshots ? 'donemark' : 'errormark'} booleanIcon"> ${repository.deleteReleasedSnapshots}</td>
+          </tr>
           <c:if test="${repository.indexed}">
             <tr>
               <th>Scanning Cron</th>