public abstract SyndFeed process( Map<String, String> reqParams ) throws ArchivaDatabaseException;
protected List<RssFeedEntry> processData( List<ArchivaArtifact> artifacts, boolean isRepoLevel )
{
long tmp = 0;
RssFeedEntry entry = null;
List<RssFeedEntry> entries = new ArrayList<RssFeedEntry>();
String description = "";
int idx = 0;
for ( ArchivaArtifact artifact : artifacts )
{
long whenGathered = artifact.getModel().getWhenGathered().getTime();
if ( tmp != whenGathered )
{
if ( entry != null )
{
entry.setDescription( description );
entries.add( entry );
entry = null;
}
if ( !isRepoLevel )
{
entry =
new RssFeedEntry( getTitle() + "\'" + artifact.getGroupId() + ":" + artifact.getArtifactId() +
"\'" + " as of " + new Date( whenGathered ) );
entry.setPublishedDate( artifact.getModel().getWhenGathered() );
description = getDescription() + "\'" + artifact.getGroupId() + ":" + artifact.getArtifactId() +
"\'" + ": \n" + artifact.toString() + " | ";
}
else
{
String repoId = artifact.getModel().getRepositoryId();
entry = new RssFeedEntry( getTitle() + "\'" + repoId + "\'" + " as of " + new Date( whenGathered ) );
entry.setPublishedDate( artifact.getModel().getWhenGathered() );
description = getDescription() + "\'" + repoId + "\'" + ": \n" + artifact.toString() + " | ";
}
}
else
{
description = description + artifact.toString() + " | ";
}
if ( idx == ( artifacts.size() - 1 ) )
{
entry.setDescription( description );
entries.add( entry );
}
tmp = whenGathered;
idx++;