parameters.put( ConfigurationManager.MIN_INDEXPATH, config.getMinimalIndexPath() );\r
parameters.put( ConfigurationManager.DISCOVERY_BLACKLIST_PATTERNS, config.getDiscoveryBlackListPatterns() );\r
parameters.put( ConfigurationManager.DISCOVER_SNAPSHOTS, new Boolean( config.isDiscoverSnapshots() ) );\r
+ parameters.put( ConfigurationManager.DISCOVERY_CRON_EXPRESSION, config.getDiscoveryCronExpression() );\r
setParameters( parameters );\r
\r
//Configuration configuration = new Configuration(); // TODO!\r
--- /dev/null
+package org.apache.maven.repository.manager.web.action;\r
+\r
+import com.opensymphony.xwork.Action;\r
+import com.opensymphony.webwork.interceptor.ParameterAware;\r
+\r
+import java.util.Map;\r
+import java.util.HashMap;\r
+\r
+import org.apache.maven.repository.manager.web.utils.ConfigurationManager;\r
+\r
+/**\r
+ * @author <a href="mailto:aramirez@apache.org">Allan Ramirez</a>\r
+ *\r
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="org.apache.maven.repository.manager.web.action.SchedulerConfigurationAction"\r
+ */\r
+public class SchedulerConfigurationAction\r
+ implements Action, ParameterAware\r
+{\r
+ /**\r
+ * @plexus.requirement\r
+ */\r
+ private ConfigurationManager plexusConfig;\r
+\r
+ private Map parameters;\r
+\r
+ public Map getParameters()\r
+ {\r
+ return parameters;\r
+ }\r
+\r
+ public void setParameters( Map parameters )\r
+ {\r
+ this.parameters = parameters;\r
+ }\r
+\r
+ /**\r
+ * Execute this method if the action was invoked\r
+ *\r
+ * @return String success or error\r
+ */\r
+ public String execute()\r
+ {\r
+ Map map;\r
+ try\r
+ {\r
+ map = new HashMap();\r
+\r
+ String[] cronExpression = (String[]) parameters.get( ConfigurationManager.DISCOVERY_CRON_EXPRESSION );\r
+\r
+ if( cronExpression[0] != null )\r
+ {\r
+ map.put( ConfigurationManager.DISCOVERY_CRON_EXPRESSION, cronExpression[0] );\r
+\r
+ plexusConfig.updateConfiguration( map );\r
+\r
+ return SUCCESS;\r
+ }\r
+ else\r
+ {\r
+ return ERROR;\r
+ }\r
+ }\r
+ catch( Exception e )\r
+ {\r
+ e.printStackTrace();\r
+ return ERROR;\r
+ }\r
+ }\r
+}\r
<result name="error" type="dispatcher">/WEB-INF/jsp/index.jsp</result>
</action>
+ <action name="configureScheduler" class="org.apache.maven.repository.manager.web.action.SchedulerConfigurationAction">
+ <result name="success" type="dispatcher">/WEB-INF/jsp/indexConfigUpdateSuccess.jsp</result>
+ <result name="error" type="dispatcher">/WEB-INF/jsp/index.jsp</result>
+ </action>
+
</package>
</xwork>
<%@ include file="indexconfig.jsp" %>
<p/>
+<p/>
+<%@ include file="schedulerconfig.jsp" %>
+<p/>
+
</body>
</html>
--- /dev/null
+<%--\r
+ ~ Copyright 2006 The Apache Software Foundation.\r
+ ~\r
+ ~ Licensed under the Apache License, Version 2.0 (the "License");\r
+ ~ you may not use this file except in compliance with the License.\r
+ ~ You may obtain a copy of the License at\r
+ ~\r
+ ~ http://www.apache.org/licenses/LICENSE-2.0\r
+ ~\r
+ ~ Unless required by applicable law or agreed to in writing, software\r
+ ~ distributed under the License is distributed on an "AS IS" BASIS,\r
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ ~ See the License for the specific language governing permissions and\r
+ ~ limitations under the License.\r
+ ~\r
+ --%>\r
+\r
+<%@ taglib uri="webwork" prefix="ww" %>\r
+\r
+<br>\r
+<p>\r
+<b>SCHEDULER CONFIGURATION:</b>\r
+</p>\r
+\r
+<form action="configureScheduler.action" method="post">\r
+ Cron Expression: <input type="text" name="discoveryCronExpression" value="<ww:property value="parameters.discoveryCronExpression"/>"/>\r
+ <input type="submit" value="Update"/>\r
+</form>\r
+\r
+\r