formatting only

git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@886673 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2009-12-03 04:20:59 +00:00
parent 94ece43b50
commit fc37f62c5c
1 changed files with 235 additions and 224 deletions

View File

@ -140,9 +140,9 @@ public class GenerateReportAction
private DataLimits limits = new DataLimits();
private String[] datePatterns = new String[] { "MM/dd/yy", "MM/dd/yyyy", "MMMMM/dd/yyyy", "MMMMM/dd/yy",
"dd MMMMM yyyy", "dd/MM/yy", "dd/MM/yyyy", "yyyy/MM/dd", "yyyy-MM-dd", "yyyy-dd-MM", "MM-dd-yyyy",
"MM-dd-yy" };
private String[] datePatterns =
new String[]{"MM/dd/yy", "MM/dd/yyyy", "MMMMM/dd/yyyy", "MMMMM/dd/yy", "dd MMMMM yyyy", "dd/MM/yy",
"dd/MM/yyyy", "yyyy/MM/dd", "yyyy-MM-dd", "yyyy-dd-MM", "MM-dd-yyyy", "MM-dd-yy"};
public static final String SEND_FILE = "send-file";
@ -153,8 +153,8 @@ public class GenerateReportAction
{
repositoryIds = new ArrayList<String>();
repositoryIds.add( ALL_REPOSITORIES ); // comes first to be first in the list
repositoryIds.addAll( (List<String>) dao.query( new UniqueFieldConstraint( RepositoryProblem.class.getName(),
"repositoryId" ) ) );
repositoryIds.addAll( (List<String>) dao.query(
new UniqueFieldConstraint( RepositoryProblem.class.getName(), "repositoryId" ) ) );
availableRepositories = new ArrayList<String>();
@ -250,12 +250,15 @@ public class GenerateReportAction
return INPUT;
}
List<RepositoryContentStatistics> contentStats = repoContentStatsDao.queryRepositoryContentStatistics(
new RepositoryContentStatisticsByRepositoryConstraint( selectedRepo, startDateInDF, endDateInDF ) );
List<RepositoryContentStatistics> contentStats =
repoContentStatsDao.queryRepositoryContentStatistics(
new RepositoryContentStatisticsByRepositoryConstraint( selectedRepo, startDateInDF,
endDateInDF ) );
if ( contentStats == null || contentStats.isEmpty() )
{
addActionError( "No statistics available for repository. Repository might not have been scanned." );
addActionError(
"No statistics available for repository. Repository might not have been scanned." );
return ERROR;
}
@ -264,7 +267,8 @@ public class GenerateReportAction
int totalPages = ( limits.getTotalCount() / limits.getPerPageCount() ) + extraPage;
limits.setCountOfPages( totalPages );
repositoryStatistics = generator.generateReport( contentStats, selectedRepo, startDateInDF, endDateInDF, limits );
repositoryStatistics =
generator.generateReport( contentStats, selectedRepo, startDateInDF, endDateInDF, limits );
}
catch ( ObjectNotFoundException oe )
{
@ -354,16 +358,20 @@ public class GenerateReportAction
return INPUT;
}
List<RepositoryContentStatistics> contentStats = repoContentStatsDao.queryRepositoryContentStatistics(
new RepositoryContentStatisticsByRepositoryConstraint( selectedRepo, startDateInDF, endDateInDF ) );
List<RepositoryContentStatistics> contentStats =
repoContentStatsDao.queryRepositoryContentStatistics(
new RepositoryContentStatisticsByRepositoryConstraint( selectedRepo, startDateInDF,
endDateInDF ) );
if ( contentStats == null || contentStats.isEmpty() )
{
addActionError( "No statistics available for repository. Repository might not have been scanned." );
addActionError(
"No statistics available for repository. Repository might not have been scanned." );
return ERROR;
}
repositoryStatistics = generator.generateReport( contentStats, selectedRepo, startDateInDF, endDateInDF, false );
repositoryStatistics =
generator.generateReport( contentStats, selectedRepo, startDateInDF, endDateInDF, false );
}
catch ( ObjectNotFoundException oe )
{
@ -438,8 +446,8 @@ public class GenerateReportAction
return pasedSelectedRepos;
}
private void generateReportForMultipleRepos( RepositoryContentStatisticsDAO repoContentStatsDao,
Date startDateInDF, Date endDateInDF, boolean useLimits )
private void generateReportForMultipleRepos( RepositoryContentStatisticsDAO repoContentStatsDao, Date startDateInDF,
Date endDateInDF, boolean useLimits )
throws ArchivaReportException
{
for ( String repo : selectedRepositories )
@ -458,12 +466,13 @@ public class GenerateReportAction
if ( useLimits )
{
repositoryStatistics.addAll( generator.generateReport( contentStats, repo, startDateInDF, endDateInDF,
limits ) );
repositoryStatistics.addAll(
generator.generateReport( contentStats, repo, startDateInDF, endDateInDF, limits ) );
}
else
{
repositoryStatistics.addAll( generator.generateReport( contentStats, repo, startDateInDF, endDateInDF, true ) );
repositoryStatistics.addAll(
generator.generateReport( contentStats, repo, startDateInDF, endDateInDF, true ) );
}
}
catch ( ObjectNotFoundException oe )
@ -516,7 +525,8 @@ public class GenerateReportAction
if ( selectedRepositories.size() == 1 )
{
input = new StringBuffer( "Date of Scan,Total File Count,Total Size,Artifact Count,Group Count,Project Count," +
input = new StringBuffer(
"Date of Scan,Total File Count,Total Size,Artifact Count,Group Count,Project Count," +
"Plugins,Archetypes,Jars,Wars,Deployments,Downloads\n" );
for ( RepositoryStatistics stats : repositoryStatistics )
@ -537,7 +547,8 @@ public class GenerateReportAction
}
else if ( selectedRepositories.size() > 1 )
{
input = new StringBuffer( "Repository,Total File Count,Total Size,Artifact Count,Group Count,Project Count," +
input = new StringBuffer(
"Repository,Total File Count,Total Size,Artifact Count,Group Count,Project Count," +
"Plugins,Archetypes,Jars,Wars,Deployments,Downloads\n" );
for ( RepositoryStatistics stats : repositoryStatistics )