From: Maria Odea B. Ching Date: Sun, 15 Mar 2009 06:50:25 +0000 (+0000) Subject: [MRM-1032] X-Git-Tag: archiva-1.2~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=51ad4bdec94c15ff08d73032e3f9f580f8004aee;p=archiva.git [MRM-1032] o added check for start date and end date in statistics report git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@754623 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java index 6bbf38784..94c9f5eea 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java @@ -227,6 +227,12 @@ public class GenerateReportAction 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 @@ public class GenerateReportAction startDateInDF = getStartDateInDateFormat(); endDateInDF = getEndDateInDateFormat(); + if( startDateInDF.after( endDateInDF ) ) + { + addFieldError( "startDate", "Start Date must be earlier than the End Date" ); + return INPUT; + } + List contentStats = repoContentStatsDao.queryRepositoryContentStatistics( new RepositoryContentStatisticsByRepositoryConstraint( selectedRepo, startDateInDF, endDateInDF ) ); @@ -322,6 +334,12 @@ public class GenerateReportAction 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 @@ public class GenerateReportAction startDateInDF = getStartDateInDateFormat(); endDateInDF = getEndDateInDateFormat(); + if( startDateInDF.after( endDateInDF ) ) + { + addFieldError( "startDate", "Start Date must be earlier than the End Date" ); + return INPUT; + } + List contentStats = repoContentStatsDao.queryRepositoryContentStatistics( new RepositoryContentStatisticsByRepositoryConstraint( selectedRepo, startDateInDF, endDateInDF ) );