Author: oching
Date: Wed Sep 13 20:39:47 2006
New Revision: 443212
URL: http://svn.apache.org/viewvc?view=rev&rev=443212
Log:
Updated ConfigurationAction. Removed cron expression validation in execute().
Created method for getting the cron expression.
Modified:
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java
Modified:
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java
URL:
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java?view=diff&rev=443212&r1=443211&r2=443212
==============================================================================
---
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java
(original)
+++
maven/archiva/trunk/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureAction.java
Wed Sep 13 20:39:47 2006
@@ -67,17 +67,12 @@
private String year;
- private String cronEx = "";
-
public void validate()
{
- cronEx = ( second + " " + minute + " " + hour + " " + dayOfMonth + " "
+ month +
- " " + dayOfWeek + " " + year ).trim();
-
//validate cron expression
cronValidator = new CronExpressionValidator();
- if( !cronValidator.validate( cronEx ) )
+ if( !cronValidator.validate( getCronExpression() ) )
{
addActionError( "Invalid Cron Expression" );
}
@@ -89,19 +84,7 @@
{
// TODO: if this didn't come from the form, go to configure.action
instead of going through with re-saving what was just loaded
// TODO: if this is changed, do we move the index or recreate it?
-
- String cronEx = ( second + " " + minute + " " + hour + " " +
dayOfMonth + " " + month +
- " " + dayOfWeek + " " + year ).trim();
-
- //validate cron expression
- cronValidator = new CronExpressionValidator();
- if( !cronValidator.validate( cronEx ) )
- {
- addActionError( "Invalid Cron Expression" );
- return ERROR;
- }
-
- configuration.setIndexerCronExpression( cronEx );
+ configuration.setIndexerCronExpression( getCronExpression() );
// Normalize the path
File file = new File( configuration.getIndexPath() );
@@ -227,4 +210,11 @@
{
this.dayOfWeek = dayOfWeek;
}
+
+ private String getCronExpression()
+ {
+ return ( second + " " + minute + " " + hour + " " + dayOfMonth + " " +
month +
+ " " + dayOfWeek + " " + year ).trim();
+ }
+
}