From 51ad4bdec94c15ff08d73032e3f9f580f8004aee Mon Sep 17 00:00:00 2001 From: "Maria Odea B. Ching" Date: Sun, 15 Mar 2009 06:50:25 +0000 Subject: [PATCH] [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 --- .../action/reports/GenerateReportAction.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) 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 ) ); -- 2.39.5