]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1032]
authorMaria Odea B. Ching <oching@apache.org>
Sun, 15 Mar 2009 06:50:25 +0000 (06:50 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Sun, 15 Mar 2009 06:50:25 +0000 (06:50 +0000)
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

archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java

index 6bbf38784d6fdddd8b0c2c40ef8580d5a01efb23..94c9f5eead6e482fa9bda86f90130bd41c23beb8 100644 (file)
@@ -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 ) );