archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r652241 - in /archiva/trunk/archiva-modules: archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/
Date Wed, 30 Apr 2008 03:29:34 GMT
Author: oching
Date: Tue Apr 29 20:29:34 2008
New Revision: 652241

URL: http://svn.apache.org/viewvc?rev=652241&view=rev
Log:
[MRM-773]
fixed where condition for querying new versions of a specific artifact

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

Modified: archiva/trunk/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java?rev=652241&r1=652240&r2=652241&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java
(original)
+++ archiva/trunk/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java
Tue Apr 29 20:29:34 2008
@@ -39,12 +39,16 @@
     {
         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 )

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java?rev=652241&r1=652240&r2=652241&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java
Tue Apr 29 20:29:34 2008
@@ -56,7 +56,7 @@
      */
     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 @@
     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 )
         {



Mime
View raw message