summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaria Odea B. Ching <oching@apache.org>2009-03-15 06:50:25 +0000
committerMaria Odea B. Ching <oching@apache.org>2009-03-15 06:50:25 +0000
commit51ad4bdec94c15ff08d73032e3f9f580f8004aee (patch)
tree386f978db91362c26cacc0947271f8cd28b17a61
parent18bb01e2cdd6aa1a347042a22e988f1b2882a095 (diff)
downloadarchiva-51ad4bdec94c15ff08d73032e3f9f580f8004aee.tar.gz
archiva-51ad4bdec94c15ff08d73032e3f9f580f8004aee.zip
[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
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java24
1 files changed, 24 insertions, 0 deletions
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<RepositoryContentStatistics> 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<RepositoryContentStatistics> contentStats = repoContentStatsDao.queryRepositoryContentStatistics(
new RepositoryContentStatisticsByRepositoryConstraint( selectedRepo, startDateInDF, endDateInDF ) );