[MRM-341] "delete proxy connector" page and action added.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@538601 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Fabrice Bellingard 2007-05-16 14:02:50 +00:00
parent ca962323fe
commit ba721ad3cc
2 changed files with 82 additions and 1 deletions

View File

@ -30,6 +30,7 @@ import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
import org.apache.maven.archiva.configuration.functors.NetworkProxySelectionPredicate;
import org.apache.maven.archiva.configuration.functors.ProxyConnectorSelectionPredicate;
import org.apache.maven.archiva.configuration.functors.RemoteRepositoryPredicate;
import org.apache.maven.archiva.configuration.functors.RepositoryIdListClosure;
@ -137,7 +138,35 @@ public class ConfigureProxyConnectorAction
public String delete()
{
return INPUT;
Configuration config = archivaConfiguration.getConfiguration();
String source = getSource();
if ( StringUtils.isBlank( source ) )
{
addActionError( "Unable to delete proxy connector with blank id for its source." );
return SUCCESS;
}
String target = getTarget();
if ( StringUtils.isBlank( target ) )
{
addActionError( "Unable to delete proxy connector with blank id for its target." );
return SUCCESS;
}
ProxyConnectorSelectionPredicate proxyConnectorSelection = new ProxyConnectorSelectionPredicate( source, target );
ProxyConnectorConfiguration proxyConnectorConfiguration = (ProxyConnectorConfiguration) CollectionUtils.find( config
.getProxyConnectors(), proxyConnectorSelection );
if ( proxyConnectorConfiguration == null )
{
addActionError( "Unable to remove proxy connector, proxy connector with source [" + source + "] and target ["
+ target + "] not found." );
return SUCCESS;
}
archivaConfiguration.getConfiguration().removeProxyConnector( proxyConnectorConfiguration );
addActionMessage( "Successfully removed proxy connector [" + source + " , " + target + " ]" );
return saveConfiguration();
}
public String addProperty()

View File

@ -0,0 +1,52 @@
<%--
~ 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>Admin: Delete Proxy Connector</title>
<ww:head/>
</head>
<body>
<h1>Admin: Delete Proxy Connector</h1>
<div id="contentArea">
<h2>Delete Proxy Connector</h2>
<blockquote>
<strong><span class="statusFailed">WARNING:</span> This operation can not be undone.</strong>
</blockquote>
<p>
Are you sure you want to delete proxy connector <code>[ ${source} , ${target} ]</code> ?
</p>
<ww:form method="post" action="deleteProxyConnector!delete" namespace="/admin" validate="true">
<ww:hidden name="target"/>
<ww:hidden name="source"/>
<ww:submit value="Delete"/>
</ww:form>
</div>
</body>
</html>