}
reposSize = selectedRepositories.size();
try
{
RepositoryContentStatisticsDAO repoContentStatsDao = dao.getRepositoryContentStatisticsDAO();
Date startDateInDF = null;
Date endDateInDF = null;
if( selectedRepositories.size() > 1 )
{
limits.setTotalCount( selectedRepositories.size() );
limits.setCurrentPage( 1 );
limits.setPerPageCount( 1 );
limits.setCountOfPages( 1 );
try
{
startDateInDF = getStartDateInDateFormat();
endDateInDF = getEndDateInDateFormat();
}
catch ( ParseException e )
{
addActionError( "Error parsing date(s)." );
return ERROR;
}
if( startDateInDF.after( endDateInDF ) )
{
addFieldError( "startDate", "Start Date must be earlier than the End Date" );
return INPUT;
}
// multiple repos
generateReportForMultipleRepos(repoContentStatsDao, startDateInDF, endDateInDF, true);
}
else if ( selectedRepositories.size() == 1 )
{
limits.setCurrentPage( getPage() );
limits.setPerPageCount( getRowCount() );
selectedRepo = selectedRepositories.get( 0 );
try
{
startDateInDF = getStartDateInDateFormat();
endDateInDF = getEndDateInDateFormat();
if( startDateInDF.after( endDateInDF ) )
{
addFieldError( "startDate", "Start Date must be earlier than the End Date" );
return INPUT;
}
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." );