Author: oching
Date: Sun Mar 15 06:50:25 2009
New Revision: 754623
URL: http://svn.apache.org/viewvc?rev=754623&view=rev
Log:
[MRM-1032]
o added check for start date and end date in statistics report
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java
Modified:
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java
URL:
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java?rev=754623&r1=754622&r2=754623&view=diff
==============================================================================
---
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java
(original)
+++
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java
Sun Mar 15 06:50:25 2009
@@ -227,6 +227,12 @@
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);
}
@@ -241,6 +247,12 @@
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 ) );
@@ -322,6 +334,12 @@
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, false );
}
@@ -333,6 +351,12 @@
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 ) );