mirror of https://github.com/apache/archiva.git
remove outdated configuration action
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@562494 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
19800f99da
commit
a84578e55b
|
@ -1,162 +0,0 @@
|
|||
package org.apache.maven.archiva.web.action.admin;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import com.opensymphony.xwork.ModelDriven;
|
||||
import com.opensymphony.xwork.Preparable;
|
||||
import com.opensymphony.xwork.Validateable;
|
||||
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
|
||||
import org.apache.maven.archiva.configuration.Configuration;
|
||||
import org.apache.maven.archiva.configuration.IndeterminateConfigurationException;
|
||||
import org.apache.maven.archiva.configuration.InvalidConfigurationException;
|
||||
import org.apache.maven.archiva.indexer.RepositoryIndexException;
|
||||
import org.apache.maven.archiva.indexer.RepositoryIndexSearchException;
|
||||
import org.apache.maven.archiva.security.ArchivaRoleConstants;
|
||||
import org.codehaus.plexus.redback.rbac.Resource;
|
||||
import org.codehaus.plexus.redback.xwork.interceptor.SecureAction;
|
||||
import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle;
|
||||
import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException;
|
||||
import org.codehaus.plexus.registry.RegistryException;
|
||||
import org.codehaus.plexus.xwork.action.PlexusActionSupport;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Configures the application.
|
||||
*
|
||||
* @plexus.component role="com.opensymphony.xwork.Action" role-hint="configureAction"
|
||||
*/
|
||||
public class ConfigureAction
|
||||
extends PlexusActionSupport
|
||||
implements ModelDriven, Preparable, Validateable, SecureAction
|
||||
{
|
||||
/**
|
||||
* @plexus.requirement
|
||||
*/
|
||||
private ArchivaConfiguration archivaConfiguration;
|
||||
|
||||
/**
|
||||
* The configuration.
|
||||
*/
|
||||
private Configuration configuration;
|
||||
|
||||
public void validate()
|
||||
{
|
||||
getLogger().info( "validate()" );
|
||||
//validate cron expression
|
||||
}
|
||||
|
||||
public String execute()
|
||||
throws IOException, RepositoryIndexException, RepositoryIndexSearchException, InvalidConfigurationException,
|
||||
RegistryException
|
||||
{
|
||||
getLogger().info( "execute()" );
|
||||
// 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?
|
||||
|
||||
try
|
||||
{
|
||||
archivaConfiguration.save( configuration );
|
||||
|
||||
// TODO: if the repository has changed, we need to check if indexing is needed!
|
||||
addActionMessage( "Successfully saved configuration" );
|
||||
}
|
||||
catch ( IndeterminateConfigurationException e )
|
||||
{
|
||||
addActionError( e.getMessage() );
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// public String input()
|
||||
// {
|
||||
//// String[] cronEx = configuration.getDataRefreshCronExpression().split( " " );
|
||||
// String[] cronEx = new String[]{"0","0","*","*","*","*","*"};
|
||||
// int i = 0;
|
||||
//
|
||||
// while ( i < cronEx.length )
|
||||
// {
|
||||
// switch ( i )
|
||||
// {
|
||||
// case 0:
|
||||
// second = cronEx[i];
|
||||
// break;
|
||||
// case 1:
|
||||
// minute = cronEx[i];
|
||||
// break;
|
||||
// case 2:
|
||||
// hour = cronEx[i];
|
||||
// break;
|
||||
// case 3:
|
||||
// dayOfMonth = cronEx[i];
|
||||
// break;
|
||||
// case 4:
|
||||
// month = cronEx[i];
|
||||
// break;
|
||||
// case 5:
|
||||
// dayOfWeek = cronEx[i];
|
||||
// break;
|
||||
// case 6:
|
||||
// year = cronEx[i];
|
||||
// break;
|
||||
// }
|
||||
// i++;
|
||||
// }
|
||||
//
|
||||
//// if ( activeRepositories.getLastDataRefreshTime() != 0 )
|
||||
//// {
|
||||
//// lastIndexingTime = new Date( activeRepositories.getLastDataRefreshTime() ).toString();
|
||||
//// }
|
||||
//// else
|
||||
// {
|
||||
// lastIndexingTime = "Never been run.";
|
||||
// }
|
||||
//
|
||||
// return INPUT;
|
||||
// }
|
||||
|
||||
public Object getModel()
|
||||
{
|
||||
return configuration;
|
||||
}
|
||||
|
||||
public void prepare()
|
||||
{
|
||||
configuration = archivaConfiguration.getConfiguration();
|
||||
}
|
||||
|
||||
// private String getCronExpression()
|
||||
// {
|
||||
// return ( second + " " + minute + " " + hour + " " + dayOfMonth + " " + month + " " + dayOfWeek + " " +
|
||||
// year ).trim();
|
||||
// }
|
||||
|
||||
public SecureActionBundle getSecureActionBundle()
|
||||
throws SecureActionException
|
||||
{
|
||||
SecureActionBundle bundle = new SecureActionBundle();
|
||||
|
||||
bundle.setRequiresAuthentication( true );
|
||||
bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL );
|
||||
|
||||
return bundle;
|
||||
}
|
||||
}
|
|
@ -359,17 +359,6 @@
|
|||
|
||||
<!-- .\ CONFIGURATION \.___________________________________________ -->
|
||||
|
||||
<action name="configure" class="configureAction" method="input">
|
||||
<result name="input">/WEB-INF/jsp/admin/configure.jsp</result>
|
||||
<interceptor-ref name="unconfiguredArchivaStack"/>
|
||||
</action>
|
||||
|
||||
<action name="saveConfiguration" class="configureAction">
|
||||
<result name="input">/WEB-INF/jsp/admin/configure.jsp</result>
|
||||
<result>/WEB-INF/jsp/admin/index.jsp</result>
|
||||
<interceptor-ref name="unconfiguredArchivaStack"/>
|
||||
</action>
|
||||
|
||||
<!-- The following are needed by the maven-app-configuration-web artifact -->
|
||||
|
||||
<action name="configureAppearance" class="configureAppearance" method="input">
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
<%--
|
||||
~ Licensed to the Apache Software Foundation (ASF) under one
|
||||
~ or more contributor license agreements. See the NOTICE file
|
||||
~ distributed with this work for additional information
|
||||
~ regarding copyright ownership. The ASF licenses this file
|
||||
~ to you under the Apache License, Version 2.0 (the
|
||||
~ "License"); you may not use this file except in compliance
|
||||
~ with the License. You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
--%>
|
||||
|
||||
<%@ taglib prefix="ww" uri="/webwork" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Configuration</title>
|
||||
<ww:head/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Configuration</h1>
|
||||
|
||||
<div class="errors">
|
||||
<ww:actionerror/>
|
||||
</div>
|
||||
|
||||
<div id="contentArea">
|
||||
<ww:actionmessage/>
|
||||
<ww:form method="post" action="saveConfiguration" namespace="/admin" validate="true">
|
||||
<ww:textfield name="indexPath" label="Index Directory" size="100" required="true"/>
|
||||
<!--ww:textfield name="indexerCronExpression" label="Indexing Schedule"/-->
|
||||
|
||||
<ww:label value="Indexing Schedule" labelposition="top"/>
|
||||
<ww:div>
|
||||
<ww:textfield name="second" label="Second" size="2"/>
|
||||
<ww:textfield name="minute" label="Minute" labelposition="left" size="2"/>
|
||||
<ww:textfield name="hour" label="Hour" size="2"/>
|
||||
<ww:textfield name="dayOfMonth" label="Day Of Month" size="2"/>
|
||||
<ww:textfield name="month" label="Month" size="2"/>
|
||||
<ww:textfield name="dayOfWeek" label="Day Of Week" size="2"/>
|
||||
<ww:textfield name="year" label="Year" size="4"/>
|
||||
</ww:div>
|
||||
|
||||
<ww:hidden name="proxy.protocol" value="http"/>
|
||||
<ww:textfield name="proxy.host" label="HTTP Proxy Host"/>
|
||||
<ww:textfield name="proxy.port" label="HTTP Proxy Port"/>
|
||||
<ww:textfield name="proxy.username" label="HTTP Proxy Username"/>
|
||||
<ww:password name="proxy.password" label="HTTP Proxy Password"/>
|
||||
|
||||
<ww:submit value="Save Configuration"/>
|
||||
|
||||
<ww:div>
|
||||
<ww:label value="Indexing Schedule Keys:" labelposition="top"/>
|
||||
<ww:label value="* = every" labelposition="top"/>
|
||||
<ww:label value="? = any" labelposition="top"/>
|
||||
<ww:label value="- = ranges" labelposition="top"/>
|
||||
<ww:label value="/ = increments" labelposition="top"/>
|
||||
</ww:div>
|
||||
</ww:form>
|
||||
|
||||
<ww:div>
|
||||
<p><i>For valid cron expression values for the Indexing Schedule, see
|
||||
<ww:a href="http://www.opensymphony.com/quartz/api/org/quartz/CronExpression.html">here</ww:a>
|
||||
</i></p>
|
||||
</ww:div>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.getElementById("saveConfiguration_indexPath").focus();
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,101 +0,0 @@
|
|||
<%--
|
||||
~ Licensed to the Apache Software Foundation (ASF) under one
|
||||
~ or more contributor license agreements. See the NOTICE file
|
||||
~ distributed with this work for additional information
|
||||
~ regarding copyright ownership. The ASF licenses this file
|
||||
~ to you under the Apache License, Version 2.0 (the
|
||||
~ "License"); you may not use this file except in compliance
|
||||
~ with the License. You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing,
|
||||
~ software distributed under the License is distributed on an
|
||||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
~ KIND, either express or implied. See the License for the
|
||||
~ specific language governing permissions and limitations
|
||||
~ under the License.
|
||||
--%>
|
||||
|
||||
<%@ taglib prefix="ww" uri="/webwork" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Administration</title>
|
||||
<ww:head/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Administration</h1>
|
||||
|
||||
<div id="contentArea">
|
||||
<div>
|
||||
<div style="float: right">
|
||||
<%-- TODO replace with icons --%>
|
||||
<redback:ifAuthorized permission="archiva-manage-configuration">
|
||||
<a href="<ww:url action="configure" />">Edit Configuration</a>
|
||||
</redback:ifAuthorized>
|
||||
</div>
|
||||
<h2>Configuration</h2>
|
||||
</div>
|
||||
|
||||
<table class="infoTable">
|
||||
<tr>
|
||||
<th>Index Directory</th>
|
||||
<td>
|
||||
<ww:property value="indexPath"/>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Indexing Schedule</th>
|
||||
<td>
|
||||
<ww:property value="indexerCronExpression"/>
|
||||
</td>
|
||||
<%-- TODO: a "delete index and run now" operation should be here too (really clean, remove deletions that didn't get picked up) --%>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Last Indexing Time</th>
|
||||
<td>
|
||||
<ww:property value="lastIndexingTime"/>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="infoTable">
|
||||
<tr>
|
||||
<td>
|
||||
<redback:ifAuthorized permission="archiva-run-indexer">
|
||||
<a href="<ww:url action="runIndexer" />">Run Now</a>
|
||||
</redback:ifAuthorized>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<ww:set name="proxy" value="proxy"/>
|
||||
<c:if test="${!empty(proxy.host)}">
|
||||
<h3>HTTP Proxy</h3>
|
||||
|
||||
<table class="infoTable">
|
||||
<tr>
|
||||
<th>Host</th>
|
||||
<td>${proxy.host}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Port</th>
|
||||
<td>${proxy.port}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Username</th>
|
||||
<td>${proxy.username}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue