]> source.dussan.org Git - archiva.git/commitdiff
[MRM-773]
authorMaria Odea B. Ching <oching@apache.org>
Wed, 30 Apr 2008 03:29:34 +0000 (03:29 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Wed, 30 Apr 2008 03:29:34 +0000 (03:29 +0000)
fixed where condition for querying new versions of a specific artifact

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

archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java
archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java

index e8beae0c95aedf97268ad20aa77f218d4a56e715..fc976e35673aae4ca2247c3ccf448f32a1b87d80 100644 (file)
@@ -39,12 +39,16 @@ public class ArtifactVersionsConstraint
     {
         if( repoId != null )
         {
-            whereClause = "repositoryId == repoId && "; 
+            whereClause = "repositoryId.equals(selectedRepoId) && groupId.equals(selectedGroupId) && artifactId.equals(selectedArtifactId)";
+            declParams = new String[] { "String selectedRepoId", "String selectedGroupId", "String selectedArtifactId" };
+            params = new Object[] { repoId, groupId, artifactId };
+        }
+        else
+        {
+            whereClause = "groupId.equals(selectedGroupId) && artifactId.equals(selectedArtifactId)";
+            declParams = new String[] { "String selectedGroupId", "String selectedArtifactId" };
+            params = new Object[] { groupId, artifactId };
         }
-                
-        whereClause = whereClause + "groupId == groupId && artifactId == artifactId";
-        declParams = new String[] { "String repoId", "String groupId", "String artifactId" };
-        params = new Object[] { repoId, groupId, artifactId };
     }
     
     public ArtifactVersionsConstraint( String repoId, String groupId, String artifactId, String sortColumn )
index 058838aedb6906123c50eeb9bd08011cc35b8301..b9261efa16c5ab3742a6b488808cc455ff251215 100644 (file)
@@ -56,7 +56,7 @@ public class NewVersionsOfArtifactRssFeedProcessor
      */
     private RssFeedGenerator generator;
 
-    private Logger log = LoggerFactory.getLogger( NewArtifactsRssFeedProcessor.class );
+    private Logger log = LoggerFactory.getLogger( NewVersionsOfArtifactRssFeedProcessor.class );
 
     /**
      * @plexus.requirement role-hint="jdo"
@@ -83,19 +83,15 @@ public class NewVersionsOfArtifactRssFeedProcessor
     private SyndFeed processNewVersionsOfArtifact( String repoId, String groupId, String artifactId )
     {
         try
-        {
+        {            
             Constraint artifactVersions = new ArtifactVersionsConstraint( repoId, groupId, artifactId, "whenGathered" );
             List<ArchivaArtifact> artifacts = artifactDAO.queryArtifacts( artifactVersions );
-
-            log.info( "Queried artifacts size :: " + artifacts.size() );
             
             List<RssFeedEntry> entries = processData( artifacts, false );
-
             String key = groupId + ":" + artifactId;
             return generator.generateFeed( getTitle() + "\'" + key + "\'", "New versions of artifact " + "\'" + key +
                 "\' found in repository " + "\'" + repoId + "\'" + " during repository scan.", entries,
                                            "rss_feeds?groupId=" + groupId + "&artifactId=" + artifactId );
-
         }
         catch ( ObjectNotFoundException oe )
         {