[MRM-773]

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
This commit is contained in:
Maria Odea B. Ching 2008-04-30 03:29:34 +00:00
parent a8bc40dbd4
commit ce8c8a06a2
2 changed files with 11 additions and 11 deletions

View File

@ -39,13 +39,17 @@ public class ArtifactVersionsConstraint
{
if( repoId != null )
{
whereClause = "repositoryId == repoId && ";
}
whereClause = whereClause + "groupId == groupId && artifactId == artifactId";
declParams = new String[] { "String repoId", "String groupId", "String artifactId" };
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 };
}
}
public ArtifactVersionsConstraint( String repoId, String groupId, String artifactId, String sortColumn )
{

View 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"
@ -87,15 +87,11 @@ public class NewVersionsOfArtifactRssFeedProcessor
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 )
{