]> source.dussan.org Git - archiva.git/commitdiff
-added check to not generate rss feed if there are no new artifacts
authorMaria Odea B. Ching <oching@apache.org>
Thu, 17 Apr 2008 01:03:01 +0000 (01:03 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Thu, 17 Apr 2008 01:03:01 +0000 (01:03 +0000)
-do not set the link for the feed entries

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

archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/DefaultRepositoryScanner.java
archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedGenerator.java

index 0ad94eb2761be54e2278a14f5168d52074bded1f..cdaca58e2a7dfc4bd78fad041de080bb8b1b7b14 100644 (file)
@@ -143,9 +143,12 @@ public class DefaultRepositoryScanner
         stats.setKnownConsumers( gatherIds( knownContentConsumers ) );
         stats.setInvalidConsumers( gatherIds( invalidContentConsumers ) );
 
-        // generate RSS feeds
-        List<ArchivaArtifact> newArtifacts = getNewArtifacts( scannerInstance.getNewFiles(), repository.getId() );
-        rssFeedProcessor.process( newArtifacts );
+        if ( scannerInstance.getNewFiles() != null && scannerInstance.getNewFiles().size() > 0 )
+        {
+            // generate RSS feeds
+            List<ArchivaArtifact> newArtifacts = getNewArtifacts( scannerInstance.getNewFiles(), repository.getId() );
+            rssFeedProcessor.process( newArtifacts );
+        }
         
         return stats;
     }
index 36634af96bace16ed7d3f448b2b5452e9b5b3c8b..0cd5a7459fe62ee4789508a9a38475692bf0f891 100644 (file)
@@ -96,9 +96,9 @@ public class RssFeedGenerator
             feed.setLink( link );
             feed.setDescription( description );
             feed.setLanguage( DEFAULT_LANGUAGE );
-            feed.setPublishedDate( Calendar.getInstance().getTime() );
         }
-
+        
+        feed.setPublishedDate( Calendar.getInstance().getTime() );
         feed.setFeedType( DEFAULT_FEEDTYPE );        
         feed.setEntries( getEntries( dataEntries, existingEntries ) );
 
@@ -136,7 +136,6 @@ public class RssFeedGenerator
         {
             entry = new SyndEntryImpl();
             entry.setTitle( dataEntry.getTitle() );
-            entry.setLink( dataEntry.getLink() );
             entry.setPublishedDate( Calendar.getInstance().getTime() );
 
             description = new SyndContentImpl();