archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joak...@apache.org
Subject svn commit: r535418 [1/2] - in /maven/archiva/trunk: archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/ archiva-base/archiva-configuration/src/main/mdo/ archiva-base/archiva-policies/src/main/java/org/apache/m...
Date Sat, 05 May 2007 00:05:26 GMT
Author: joakime
Date: Fri May  4 17:05:23 2007
New Revision: 535418

URL: http://svn.apache.org/viewvc?view=rev&rev=535418
Log:
* Updates to repositories and proxy connector configuration / admin screens.


Added:
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/LocalRepositoryPredicate.java   (with props)
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/ProxyConnectorSelectionPredicate.java   (with props)
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RemoteRepositoryPredicate.java   (with props)
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryConfigurationComparator.java   (with props)
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryIdListClosure.java   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SingleSelectTransformer.java   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AdminRepositoryConfiguration.java
      - copied, changed from r534213, maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/models/AdminRepositoryConfiguration.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java
      - copied, changed from r534213, maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java
      - copied, changed from r534213, maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RepositoriesAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryConfigurationAdminTransformer.java   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addProxyConnector.jsp   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editProxyConnector.jsp   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/repositoryForm.jspf
      - copied, changed from r534213, maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/proxyConnectors.jsp   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/archiva-splat-32.gif   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/archiva-world.png   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-down.png   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-left.png   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-right.png   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-up.png   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/box.png   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/create.png   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/delete.gif   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/edit.png   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/security-key.png   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/security-lock.png   (with props)
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/images/icons/user.png   (with props)
Removed:
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractDeleteRepositoryAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/AbstractRepositoryAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/DeleteRepositoryAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/EditRepositoryAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/RepositoriesAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/SaveRepositoryAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/models/
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/proxiedRepositoryForm.jspf
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/syncedRepositoryForm.jspf
Modified:
    maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
    maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java
    maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java
    maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java
    maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java
    maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java
    maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java
    maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
    maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepository.jsp
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/css/maven-base.css
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/css/site.css

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/LocalRepositoryPredicate.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/LocalRepositoryPredicate.java?view=auto&rev=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/LocalRepositoryPredicate.java (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/LocalRepositoryPredicate.java Fri May  4 17:05:23 2007
@@ -0,0 +1,55 @@
+package org.apache.maven.archiva.configuration.util;
+
+/*
+ * 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 org.apache.commons.collections.Predicate;
+import org.apache.maven.archiva.configuration.RepositoryConfiguration;
+
+/**
+ * Predicate for {@link RepositoryConfiguration} objects that are local (aka managed) 
+ * {@link RepositoryConfiguration#isManaged()} 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class LocalRepositoryPredicate
+    implements Predicate
+{
+    public static final Predicate INSTANCE = new LocalRepositoryPredicate();
+
+    public static Predicate getInstance()
+    {
+        return INSTANCE;
+    }
+
+    public boolean evaluate( Object object )
+    {
+        boolean satisfies = false;
+
+        if ( object instanceof RepositoryConfiguration )
+        {
+            RepositoryConfiguration repoconfig = (RepositoryConfiguration) object;
+            return repoconfig.isManaged();
+        }
+
+        return satisfies;
+    }
+
+}

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/LocalRepositoryPredicate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/LocalRepositoryPredicate.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/LocalRepositoryPredicate.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/ProxyConnectorSelectionPredicate.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/ProxyConnectorSelectionPredicate.java?view=auto&rev=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/ProxyConnectorSelectionPredicate.java (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/ProxyConnectorSelectionPredicate.java Fri May  4 17:05:23 2007
@@ -0,0 +1,59 @@
+package org.apache.maven.archiva.configuration.util;
+
+/*
+ * 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 org.apache.commons.collections.Predicate;
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
+
+/**
+ * ProxyConnectorPredicate 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class ProxyConnectorSelectionPredicate
+    implements Predicate
+{
+    private String sourceId;
+
+    private String targetId;
+
+    public ProxyConnectorSelectionPredicate( String sourceId, String targetId )
+    {
+        this.sourceId = sourceId;
+        this.targetId = targetId;
+    }
+
+    public boolean evaluate( Object object )
+    {
+        boolean satisfies = false;
+
+        if ( object instanceof ProxyConnectorConfiguration )
+        {
+            ProxyConnectorConfiguration connector = (ProxyConnectorConfiguration) object;
+            return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils
+                .equals( targetId, connector.getTargetRepoId() ) );
+        }
+
+        return satisfies;
+    }
+
+}

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/ProxyConnectorSelectionPredicate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/ProxyConnectorSelectionPredicate.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/ProxyConnectorSelectionPredicate.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RemoteRepositoryPredicate.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RemoteRepositoryPredicate.java?view=auto&rev=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RemoteRepositoryPredicate.java (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RemoteRepositoryPredicate.java Fri May  4 17:05:23 2007
@@ -0,0 +1,54 @@
+package org.apache.maven.archiva.configuration.util;
+
+/*
+ * 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 org.apache.commons.collections.Predicate;
+import org.apache.maven.archiva.configuration.RepositoryConfiguration;
+
+/**
+ * Predicate for {@link RepositoryConfiguration} objects that are remote 
+ * {@link RepositoryConfiguration#isRemote()} 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RemoteRepositoryPredicate
+    implements Predicate
+{
+    public static final Predicate INSTANCE = new RemoteRepositoryPredicate();
+
+    public static Predicate getInstance()
+    {
+        return INSTANCE;
+    }
+
+    public boolean evaluate( Object object )
+    {
+        boolean satisfies = false;
+
+        if ( object instanceof RepositoryConfiguration )
+        {
+            RepositoryConfiguration repoconfig = (RepositoryConfiguration) object;
+            return repoconfig.isRemote();
+        }
+
+        return satisfies;
+    }
+}

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RemoteRepositoryPredicate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RemoteRepositoryPredicate.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RemoteRepositoryPredicate.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryConfigurationComparator.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryConfigurationComparator.java?view=auto&rev=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryConfigurationComparator.java (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryConfigurationComparator.java Fri May  4 17:05:23 2007
@@ -0,0 +1,63 @@
+package org.apache.maven.archiva.configuration.util;
+
+/*
+ * 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 org.apache.maven.archiva.configuration.RepositoryConfiguration;
+
+import java.util.Comparator;
+
+/**
+ * RepositoryConfigurationComparator 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RepositoryConfigurationComparator
+    implements Comparator
+{
+
+    public int compare( Object o1, Object o2 )
+    {
+        if ( o1 == null && o2 == null )
+        {
+            return 0;
+        }
+
+        if ( o1 == null && o2 != null )
+        {
+            return 1;
+        }
+
+        if ( o1 != null && o2 == null )
+        {
+            return -1;
+        }
+
+        if ( ( o1 instanceof RepositoryConfiguration ) && ( o2 instanceof RepositoryConfiguration ) )
+        {
+            String id1 = ( (RepositoryConfiguration) o1 ).getId();
+            String id2 = ( (RepositoryConfiguration) o2 ).getId();
+            return id1.compareToIgnoreCase( id2 );
+        }
+
+        return 0;
+    }
+
+}

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryConfigurationComparator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryConfigurationComparator.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryConfigurationComparator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryIdListClosure.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryIdListClosure.java?view=auto&rev=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryIdListClosure.java (added)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryIdListClosure.java Fri May  4 17:05:23 2007
@@ -0,0 +1,56 @@
+package org.apache.maven.archiva.configuration.util;
+
+/*
+ * 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 org.apache.commons.collections.Closure;
+import org.apache.maven.archiva.configuration.RepositoryConfiguration;
+
+import java.util.List;
+
+/**
+ * RepositoryIdListClosure 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class RepositoryIdListClosure
+    implements Closure
+{
+    private List list;
+
+    public RepositoryIdListClosure( List list )
+    {
+        this.list = list;
+    }
+
+    public void execute( Object input )
+    {
+        if ( input instanceof RepositoryConfiguration )
+        {
+            RepositoryConfiguration repoconfig = (RepositoryConfiguration) input;
+            list.add( repoconfig.getId() );
+        }
+    }
+
+    public List getList()
+    {
+        return list;
+    }
+}

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryIdListClosure.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryIdListClosure.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/util/RepositoryIdListClosure.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo?view=diff&rev=535418&r1=535417&r2=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo (original)
+++ maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo Fri May  4 17:05:23 2007
@@ -365,7 +365,7 @@
         <field>
           <name>policies</name>
           <version>1.0.0+</version>
-          <type>Properties</type>
+          <type>Map</type>
           <description>Policy configuration for the connector.</description>
           <association xml.mapStyle="inline">
             <type>String</type>
@@ -375,7 +375,7 @@
         <field>
           <name>properties</name>
           <version>1.0.0+</version>
-          <type>Properties</type>
+          <type>Map</type>
           <description>Configuration for the connector.</description>
           <association xml.mapStyle="inline">
             <type>String</type>
@@ -401,8 +401,15 @@
             return null;
         }
 
-        return this.getPolicies().getProperty( policyId, defaultValue );
-    }          
+        Object value = this.getPolicies().get( policyId );
+
+        if ( value == null )
+        {
+            return defaultValue;
+        }
+
+        return (String) value;
+    }
           ]]></code>
         </codeSegment>
       </codeSegments>

Modified: maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java?view=diff&rev=535418&r1=535417&r2=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java Fri May  4 17:05:23 2007
@@ -24,10 +24,10 @@
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.Calendar;
-import java.util.HashSet;
+import java.util.List;
 import java.util.Properties;
-import java.util.Set;
 
 /**
  * AbstractUpdatePolicy 
@@ -76,20 +76,25 @@
      */
     public static final String ONCE = "once";
 
-    private Set validPolicyCodes = new HashSet();
+    private List options = new ArrayList();
 
     public AbstractUpdatePolicy()
     {
-        validPolicyCodes.add( IGNORED );
-        validPolicyCodes.add( DISABLED );
-        validPolicyCodes.add( DAILY );
-        validPolicyCodes.add( HOURLY );
-        validPolicyCodes.add( ONCE );
+        options.add( IGNORED );
+        options.add( DISABLED );
+        options.add( DAILY );
+        options.add( HOURLY );
+        options.add( ONCE );
     }
 
     protected abstract boolean isSnapshotPolicy();
     
     protected abstract String getUpdateMode();
+    
+    public List getOptions()
+    {
+        return options;
+    }
 
     public boolean applyPolicy( String policySetting, Properties request, File localFile )
     {
@@ -101,7 +106,7 @@
             isSnapshotVersion = VersionUtil.isSnapshot( version );
         }
 
-        if ( !validPolicyCodes.contains( policySetting ) )
+        if ( !options.contains( policySetting ) )
         {
             // No valid code? false it is then.
             getLogger().error( "Unknown artifact-update policyCode [" + policySetting + "]" );

Modified: maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java?view=diff&rev=535418&r1=535417&r2=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java Fri May  4 17:05:23 2007
@@ -24,9 +24,9 @@
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.io.File;
-import java.util.HashSet;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Properties;
-import java.util.Set;
 
 /**
  * {@link PreDownloadPolicy} to check if the requested url has failed before. 
@@ -53,17 +53,17 @@
      */
     private UrlFailureCache urlFailureCache;
 
-    private Set validPolicyCodes = new HashSet();
+    private List options = new ArrayList();
 
     public CachedFailuresPolicy()
     {
-        validPolicyCodes.add( IGNORED );
-        validPolicyCodes.add( CACHED );
+        options.add( IGNORED );
+        options.add( CACHED );
     }
 
     public boolean applyPolicy( String policySetting, Properties request, File localFile )
     {
-        if ( !validPolicyCodes.contains( policySetting ) )
+        if ( !options.contains( policySetting ) )
         {
             // No valid code? false it is then.
             getLogger().error( "Unknown checksum policyCode [" + policySetting + "]" );
@@ -93,8 +93,18 @@
         return true;
     }
 
-    public String getDefaultPolicySetting()
+    public String getDefaultOption()
     {
         return IGNORED;
+    }
+
+    public String getId()
+    {
+        return "cache-failures";
+    }
+
+    public List getOptions()
+    {
+        return options;
     }
 }

Modified: maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java?view=diff&rev=535418&r1=535417&r2=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java Fri May  4 17:05:23 2007
@@ -27,9 +27,9 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.util.HashSet;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Properties;
-import java.util.Set;
 
 /**
  * ChecksumPolicy 
@@ -73,18 +73,18 @@
      */
     private ChecksumFile checksumFile;
 
-    private Set validPolicyCodes = new HashSet();
+    private List options = new ArrayList();
 
     public ChecksumPolicy()
     {
-        validPolicyCodes.add( FAIL );
-        validPolicyCodes.add( FIX );
-        validPolicyCodes.add( IGNORED );
+        options.add( FAIL );
+        options.add( FIX );
+        options.add( IGNORED );
     }
 
     public boolean applyPolicy( String policySetting, Properties request, File localFile )
     {
-        if ( !validPolicyCodes.contains( policySetting ) )
+        if ( !options.contains( policySetting ) )
         {
             // No valid code? false it is then.
             getLogger().error( "Unknown checksum policyCode [" + policySetting + "]" );
@@ -275,9 +275,19 @@
         }
     }
 
-    public String getDefaultPolicySetting()
+    public String getDefaultOption()
     {
         return FIX;
+    }
+
+    public String getId()
+    {
+        return "checksum";
+    }
+
+    public List getOptions()
+    {
+        return options;
     }
 
 }

Modified: maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java?view=diff&rev=535418&r1=535417&r2=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java Fri May  4 17:05:23 2007
@@ -20,6 +20,7 @@
  */
 
 import java.io.File;
+import java.util.List;
 import java.util.Properties;
 
 /**
@@ -39,11 +40,25 @@
     public static final boolean FAIL = false;
     
     /**
-     * Get the default policy setting.
+     * Get the list of options for this policy.
      * 
-     * @return the default policy setting.
+     * @return the list of options for this policy.
      */
-    public String getDefaultPolicySetting();
+    public List getOptions();
+
+    /**
+     * Get the default option for this policy.
+     * 
+     * @return the default policy for this policy.
+     */
+    public String getDefaultOption();
+
+    /**
+     * Get the id for this policy.
+     * 
+     * @return the id for this policy.
+     */
+    public String getId();
 
     /**
      * Apply the download policy.

Modified: maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java?view=diff&rev=535418&r1=535417&r2=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java Fri May  4 17:05:23 2007
@@ -33,7 +33,7 @@
     extends AbstractUpdatePolicy
     implements PreDownloadPolicy
 {
-    public String getDefaultPolicySetting()
+    public String getDefaultOption()
     {
         return AbstractUpdatePolicy.IGNORED;
     }
@@ -44,6 +44,11 @@
     }
     
     protected String getUpdateMode()
+    {
+        return "releases";
+    }
+
+    public String getId()
     {
         return "releases";
     }

Modified: maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java?view=diff&rev=535418&r1=535417&r2=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java Fri May  4 17:05:23 2007
@@ -33,7 +33,7 @@
     extends AbstractUpdatePolicy
     implements PreDownloadPolicy
 {
-    public String getDefaultPolicySetting()
+    public String getDefaultOption()
     {
         return AbstractUpdatePolicy.IGNORED;
     }
@@ -44,6 +44,11 @@
     }
     
     protected String getUpdateMode()
+    {
+        return "snapshots";
+    }
+
+    public String getId()
     {
         return "snapshots";
     }

Modified: maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java?view=diff&rev=535418&r1=535417&r2=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java Fri May  4 17:05:23 2007
@@ -20,6 +20,7 @@
  */
 
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
@@ -494,7 +495,7 @@
         }
     }
 
-    private boolean applyPolicies( Properties policySettings, Map downloadPolicies, Properties request, File localFile )
+    private boolean applyPolicies( Map policySettings, Map downloadPolicies, Properties request, File localFile )
     {
         Iterator it = downloadPolicies.entrySet().iterator();
         while ( it.hasNext() )
@@ -502,8 +503,8 @@
             Map.Entry entry = (Entry) it.next();
             String key = (String) entry.getKey();
             DownloadPolicy policy = (DownloadPolicy) entry.getValue();
-            String defaultSetting = policy.getDefaultPolicySetting();
-            String setting = policySettings.getProperty( key, defaultSetting );
+            String defaultSetting = policy.getDefaultOption();
+            String setting = StringUtils.defaultString( (String) policySettings.get( key ), defaultSetting );
 
             getLogger().debug( "Applying [" + key + "] policy with [" + setting + "]" );
             if ( !policy.applyPolicy( setting, request, localFile ) )

Modified: maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java?view=diff&rev=535418&r1=535417&r2=535418
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java Fri May  4 17:05:23 2007
@@ -22,9 +22,9 @@
 import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.repository.connector.RepositoryConnector;
 
-import java.util.Enumeration;
+import java.util.Iterator;
 import java.util.List;
-import java.util.Properties;
+import java.util.Map;
 
 /**
  * This represents a connector for a repository to repository proxy.
@@ -45,7 +45,7 @@
 
     private String proxyId;
 
-    private Properties policies;
+    private Map policies;
 
     public List getBlacklist()
     {
@@ -87,12 +87,12 @@
         this.whitelist = whitelist;
     }
 
-    public Properties getPolicies()
+    public Map getPolicies()
     {
         return policies;
     }
 
-    public void setPolicies( Properties policies )
+    public void setPolicies( Map policies )
     {
         this.policies = policies;
     }
@@ -116,12 +116,12 @@
         sb.append( "  target:" ).append( this.targetRepository ).append( "\n" );
         sb.append( "  proxyId:" ).append( this.proxyId ).append( "\n" );
 
-        Enumeration keys = this.policies.propertyNames();
-        while ( keys.hasMoreElements() )
+        Iterator keys = this.policies.keySet().iterator();
+        while ( keys.hasNext() )
         {
-            String name = (String) keys.nextElement();
+            String name = (String) keys.next();
             sb.append( "  policy[" ).append( name ).append( "]:" );
-            sb.append( this.policies.getProperty( name ) ).append( "\n" );
+            sb.append( this.policies.get( name ) ).append( "\n" );
         }
 
         sb.append( "]" );
@@ -131,6 +131,6 @@
 
     public void setPolicy( String policyId, String policySetting )
     {
-        // TODO Auto-generated method stub
+        this.policies.put( policyId, policySetting );
     }
 }

Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java?view=auto&rev=535418
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java (added)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java Fri May  4 17:05:23 2007
@@ -0,0 +1,606 @@
+package org.apache.maven.archiva.web.action.admin.connectors.proxy;
+
+/*
+ * 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.Preparable;
+
+import org.apache.commons.collections.Closure;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.functors.IfClosure;
+import org.apache.commons.collections.functors.NotPredicate;
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.InvalidConfigurationException;
+import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
+import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.maven.archiva.configuration.util.ProxyConnectorSelectionPredicate;
+import org.apache.maven.archiva.configuration.util.RemoteRepositoryPredicate;
+import org.apache.maven.archiva.configuration.util.RepositoryIdListClosure;
+import org.apache.maven.archiva.policies.DownloadPolicy;
+import org.apache.maven.archiva.security.ArchivaRoleConstants;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.codehaus.plexus.registry.RegistryException;
+import org.codehaus.plexus.security.rbac.Resource;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
+import org.codehaus.plexus.xwork.action.PlexusActionSupport;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+/**
+ * ConfigureProxyConnectorAction 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="configureProxyConnectorAction"
+ */
+public class ConfigureProxyConnectorAction
+    extends PlexusActionSupport
+    implements SecureAction, Preparable, Initializable
+{
+    private static final String DIRECT_CONNECTION = "(direct connection)";
+
+    /**
+     * @plexus.requirement
+     */
+    private ArchivaConfiguration archivaConfiguration;
+
+    /**
+     * @plexus.requirement role="org.apache.maven.archiva.policies.PreDownloadPolicy"
+     */
+    private Map preDownloadPolicyMap;
+
+    /**
+     * @plexus.requirement role="org.apache.maven.archiva.policies.PostDownloadPolicy"
+     */
+    private Map postDownloadPolicyMap;
+
+    /**
+     * The model for this action.
+     */
+    private ProxyConnectorConfiguration connector;
+
+    private Map policyMap;
+
+    private String source;
+
+    private String target;
+
+    private String mode;
+
+    private String propertyKey;
+
+    private String propertyValue;
+
+    private String pattern;
+
+    /**
+     * The list of possible proxy ids. 
+     */
+    private List proxyIdOptions = new ArrayList();
+
+    /**
+     * The list of local repository ids.
+     */
+    private List localRepoIdList = new ArrayList();
+
+    /**
+     * The list of remote repository ids.
+     */
+    private List remoteRepoIdList = new ArrayList();
+
+    /**
+     * The blacklist pattern to add.
+     */
+    private String blackListPattern;
+
+    /**
+     * The whitelist pattern to add.
+     */
+    private String whiteListPattern;
+
+    public String add()
+    {
+        getLogger().info( ".add()" );
+        this.mode = "add";
+        return INPUT;
+    }
+
+    public String confirm()
+    {
+        getLogger().info( ".confirm()" );
+        return INPUT;
+    }
+
+    public String delete()
+    {
+        getLogger().info( ".delete()" );
+        return INPUT;
+    }
+
+    public String addProperty()
+    {
+        getLogger().info( ".addProperty()" );
+        String key = getPropertyKey();
+        String value = getPropertyValue();
+
+        if ( StringUtils.isBlank( key ) )
+        {
+            addActionError( "Unable to add property with blank key." );
+        }
+
+        if ( StringUtils.isBlank( value ) )
+        {
+            addActionError( "Unable to add property with blank value." );
+        }
+
+        if ( !hasActionErrors() )
+        {
+            getConnector().getProperties().put( key, value );
+            setPropertyKey( null );
+            setPropertyValue( null );
+        }
+
+        return INPUT;
+    }
+
+    public String removeProperty()
+    {
+        getLogger().info( ".removeProperty()" );
+        String key = getPropertyKey();
+
+        if ( StringUtils.isBlank( key ) )
+        {
+            addActionError( "Unable to remove property with blank key." );
+        }
+
+        if ( !hasActionErrors() )
+        {
+            getConnector().getProperties().remove( key );
+            setPropertyKey( null );
+            setPropertyValue( null );
+        }
+
+        return INPUT;
+    }
+
+    public String addWhiteListPattern()
+    {
+        getLogger().info( ".addWhiteListPattern()" );
+        String pattern = getWhiteListPattern();
+
+        if ( StringUtils.isBlank( pattern ) )
+        {
+            addActionError( "Cannot add an blank white list pattern." );
+        }
+
+        if ( !hasActionErrors() )
+        {
+            getLogger().info(
+                              "whitelist patterns: (" + getConnector().getWhiteListPatterns().size() + "): "
+                                  + getConnector().getWhiteListPatterns() );
+
+            getConnector().getWhiteListPatterns().add( pattern );
+            setWhiteListPattern( null );
+        }
+
+        return INPUT;
+    }
+
+    public String removeWhiteListPattern()
+    {
+        String pattern = getPattern();
+        getLogger().info( ".removeWhiteListPattern(" + pattern + ")" );
+
+        if ( StringUtils.isBlank( pattern ) )
+        {
+            addActionError( "Cannot remove an blank white list pattern." );
+        }
+
+        if ( !hasActionErrors() )
+        {
+            getConnector().getWhiteListPatterns().remove( pattern );
+            setWhiteListPattern( null );
+        }
+
+        return INPUT;
+    }
+
+    public String addBlackListPattern()
+    {
+        getLogger().info( ".addBlackListPattern()" );
+        String pattern = getBlackListPattern();
+
+        if ( StringUtils.isBlank( pattern ) )
+        {
+            addActionError( "Cannot add an blank black list pattern." );
+        }
+
+        if ( !hasActionErrors() )
+        {
+            getConnector().getBlackListPatterns().add( pattern );
+            setBlackListPattern( null );
+        }
+
+        return INPUT;
+    }
+
+    public String removeBlackListPattern()
+    {
+        getLogger().info( ".removeBlackListPattern()" );
+        String pattern = getBlackListPattern();
+
+        if ( StringUtils.isBlank( pattern ) )
+        {
+            addActionError( "Cannot remove an blank black list pattern." );
+        }
+
+        if ( !hasActionErrors() )
+        {
+            getConnector().getBlackListPatterns().remove( pattern );
+            setBlackListPattern( null );
+        }
+
+        return INPUT;
+    }
+
+    public String edit()
+    {
+        getLogger().info( ".edit()" );
+        this.mode = "edit";
+        return INPUT;
+    }
+
+    public String getBlackListPattern()
+    {
+        return blackListPattern;
+    }
+
+    public ProxyConnectorConfiguration getConnector()
+    {
+        return connector;
+    }
+
+    public List getLocalRepoIdList()
+    {
+        return localRepoIdList;
+    }
+
+    public String getMode()
+    {
+        return this.mode;
+    }
+
+    public Map getPolicyMap()
+    {
+        return policyMap;
+    }
+
+    public String getPropertyKey()
+    {
+        return propertyKey;
+    }
+
+    public String getPropertyValue()
+    {
+        return propertyValue;
+    }
+
+    public List getProxyIdOptions()
+    {
+        return proxyIdOptions;
+    }
+
+    public List getRemoteRepoIdList()
+    {
+        return remoteRepoIdList;
+    }
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL );
+
+        return bundle;
+    }
+
+    public String getSource()
+    {
+        return source;
+    }
+
+    public String getTarget()
+    {
+        return target;
+    }
+
+    public String getWhiteListPattern()
+    {
+        return whiteListPattern;
+    }
+
+    public void initialize()
+        throws InitializationException
+    {
+        policyMap = new HashMap();
+        policyMap.putAll( preDownloadPolicyMap );
+        policyMap.putAll( postDownloadPolicyMap );
+    }
+
+    public String input()
+    {
+        getLogger().info( "input()" );
+        return INPUT;
+    }
+
+    public void prepare()
+        throws Exception
+    {
+        String sourceId = getSource();
+        String targetId = getTarget();
+
+        getLogger().info( ".prepare() - sourceId [" + sourceId + "], targetId [" + targetId + "]" );
+
+        if ( StringUtils.isBlank( sourceId ) || StringUtils.isBlank( targetId ) )
+        {
+            if ( this.connector == null )
+            {
+                getLogger().info( "Creating new connector." );
+                this.connector = new ProxyConnectorConfiguration();
+            }
+        }
+        else
+        {
+            this.connector = findProxyConnector( sourceId, targetId );
+        }
+        getLogger().info( "Connector: " + connector );
+
+        Configuration config = archivaConfiguration.getConfiguration();
+
+        // Gather Network Proxy Ids.
+
+        this.proxyIdOptions = new ArrayList();
+        this.proxyIdOptions.add( DIRECT_CONNECTION );
+
+        Closure addProxyIds = new Closure()
+        {
+            public void execute( Object input )
+            {
+                if ( input instanceof NetworkProxyConfiguration )
+                {
+                    NetworkProxyConfiguration netproxy = (NetworkProxyConfiguration) input;
+                    proxyIdOptions.add( netproxy.getId() );
+                }
+            }
+        };
+
+        CollectionUtils.forAllDo( config.getNetworkProxies(), addProxyIds );
+
+        // Gather Local & Remote Repo Ids.
+
+        RepositoryIdListClosure remoteRepoIdList = new RepositoryIdListClosure( new ArrayList() );
+        RepositoryIdListClosure localRepoIdList = new RepositoryIdListClosure( new ArrayList() );
+        Closure repoIfClosure = IfClosure.getInstance( RemoteRepositoryPredicate.getInstance(), remoteRepoIdList,
+                                                       localRepoIdList );
+
+        CollectionUtils.forAllDo( config.getRepositories(), repoIfClosure );
+
+        this.remoteRepoIdList = remoteRepoIdList.getList();
+        this.localRepoIdList = localRepoIdList.getList();
+    }
+
+    public String save()
+    {
+        String mode = getMode();
+
+        String sourceId = getConnector().getSourceRepoId();
+        String targetId = getConnector().getTargetRepoId();
+
+        getLogger().info( ".save(" + mode + ":" + sourceId + "->" + targetId + ")" );
+
+        if ( !isValid( getConnector() ) )
+        {
+            return INPUT;
+        }
+
+        if ( StringUtils.equalsIgnoreCase( "edit", mode ) )
+        {
+            removeConnector( sourceId, targetId );
+        }
+
+        try
+        {
+            if ( StringUtils.equals( DIRECT_CONNECTION, getConnector().getProxyId() ) )
+            {
+                getConnector().setProxyId( null );
+            }
+
+            addProxyConnector( getConnector() );
+            saveConfiguration();
+        }
+        catch ( IOException e )
+        {
+            addActionError( "I/O Exception: " + e.getMessage() );
+        }
+        catch ( InvalidConfigurationException e )
+        {
+            addActionError( "Invalid Configuration Exception: " + e.getMessage() );
+        }
+        catch ( RegistryException e )
+        {
+            addActionError( "Configuration Registry Exception: " + e.getMessage() );
+        }
+
+        return SUCCESS;
+    }
+
+    public void setBlackListPattern( String blackListPattern )
+    {
+        this.blackListPattern = blackListPattern;
+    }
+
+    public void setConnector( ProxyConnectorConfiguration connector )
+    {
+        this.connector = connector;
+    }
+
+    public void setLocalRepoIdList( List localRepoIdList )
+    {
+        this.localRepoIdList = localRepoIdList;
+    }
+
+    public void setMode( String mode )
+    {
+        this.mode = mode;
+    }
+
+    public void setPropertyKey( String propertyKey )
+    {
+        this.propertyKey = propertyKey;
+    }
+
+    public void setPropertyValue( String propertyValue )
+    {
+        this.propertyValue = propertyValue;
+    }
+
+    public void setRemoteRepoIdList( List remoteRepoIdList )
+    {
+        this.remoteRepoIdList = remoteRepoIdList;
+    }
+
+    public void setSource( String source )
+    {
+        this.source = source;
+    }
+
+    public void setTarget( String target )
+    {
+        this.target = target;
+    }
+
+    public void setWhiteListPattern( String whiteListPattern )
+    {
+        this.whiteListPattern = whiteListPattern;
+    }
+
+    private void addProxyConnector( ProxyConnectorConfiguration proxyConnector )
+        throws IOException
+    {
+        archivaConfiguration.getConfiguration().addProxyConnector( proxyConnector );
+    }
+
+    private ProxyConnectorConfiguration findProxyConnector( String sourceId, String targetId )
+    {
+        Configuration config = archivaConfiguration.getConfiguration();
+
+        ProxyConnectorSelectionPredicate selectedProxy = new ProxyConnectorSelectionPredicate( sourceId, targetId );
+        return (ProxyConnectorConfiguration) CollectionUtils.find( config.getProxyConnectors(), selectedProxy );
+    }
+
+    private boolean isValid( ProxyConnectorConfiguration proxyConnector )
+    {
+        if ( proxyConnector.getPolicies() == null )
+        {
+            addActionError( "Policies must be set." );
+            return false;
+        }
+
+        Iterator it = policyMap.entrySet().iterator();
+        while ( it.hasNext() )
+        {
+            Map.Entry entry = (Entry) it.next();
+            String policyId = (String) entry.getKey();
+            DownloadPolicy policy = (DownloadPolicy) entry.getValue();
+            List options = policy.getOptions();
+
+            if ( !proxyConnector.getPolicies().containsKey( policyId ) )
+            {
+                addActionError( "Policy [" + policyId + "] must be set (missing id)." );
+                continue;
+            }
+
+            String arr[] = (String[]) proxyConnector.getPolicies().get( policyId );
+            String value = arr[0];
+
+            proxyConnector.getPolicies().put( policyId, value );
+
+            if ( StringUtils.isBlank( value ) )
+            {
+                addActionError( "Policy [" + policyId + "] must be set (missing value)." );
+                continue;
+            }
+
+            if ( !options.contains( value ) )
+            {
+                addActionError( "Value of [" + value + "] is invalid for policy [" + policyId + "], valid values: "
+                    + options );
+                continue;
+            }
+        }
+
+        if ( hasActionErrors() || hasActionMessages() )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    private void removeConnector( String sourceId, String targetId )
+    {
+        ProxyConnectorSelectionPredicate selectedProxy = new ProxyConnectorSelectionPredicate( sourceId, targetId );
+        NotPredicate notSelectedProxy = new NotPredicate( selectedProxy );
+        CollectionUtils.filter( archivaConfiguration.getConfiguration().getProxyConnectors(), notSelectedProxy );
+    }
+
+    private String saveConfiguration()
+        throws IOException, InvalidConfigurationException, RegistryException
+    {
+        archivaConfiguration.save( archivaConfiguration.getConfiguration() );
+
+        addActionMessage( "Successfully saved configuration" );
+
+        return SUCCESS;
+    }
+
+    public String getPattern()
+    {
+        return pattern;
+    }
+
+    public void setPattern( String pattern )
+    {
+        this.pattern = pattern;
+    }
+}

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java?view=auto&rev=535418
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java (added)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java Fri May  4 17:05:23 2007
@@ -0,0 +1,151 @@
+package org.apache.maven.archiva.web.action.admin.connectors.proxy;
+
+/*
+ * 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.Preparable;
+
+import org.apache.commons.collections.Closure;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.Transformer;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
+import org.apache.maven.archiva.configuration.RepositoryConfiguration;
+import org.apache.maven.archiva.security.ArchivaRoleConstants;
+import org.apache.maven.archiva.web.action.admin.repositories.AdminRepositoryConfiguration;
+import org.codehaus.plexus.security.rbac.Resource;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
+import org.codehaus.plexus.xwork.action.PlexusActionSupport;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * ProxyConnectorsAction 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="proxyConnectorsAction"
+ */
+public class ProxyConnectorsAction
+    extends PlexusActionSupport
+    implements SecureAction, Preparable
+{
+    /**
+     * @plexus.requirement role-hint="adminrepoconfig"
+     */
+    private Transformer repoConfigToAdmin;
+
+    /**
+     * @plexus.requirement
+     */
+    private ArchivaConfiguration archivaConfiguration;
+
+    private Map /*<String,AdminRepositoryConfiguration>*/repoMap;
+
+    /**
+     * Map of Proxy Connectors.
+     */
+    private Map /*<String,AdminProxyConnector>*/proxyConnectorMap;
+
+    public void prepare()
+        throws Exception
+    {
+        Configuration config = archivaConfiguration.getConfiguration();
+
+        repoMap = new HashMap();
+
+        Closure addToRepoMap = new Closure()
+        {
+            public void execute( Object input )
+            {
+                if ( input instanceof RepositoryConfiguration )
+                {
+                    AdminRepositoryConfiguration arepo = (AdminRepositoryConfiguration) repoConfigToAdmin
+                        .transform( input );
+                    repoMap.put( arepo.getId(), arepo );
+                }
+            }
+        };
+
+        CollectionUtils.forAllDo( config.getRepositories(), addToRepoMap );
+
+        proxyConnectorMap = new HashMap();
+
+        Closure addToProxyConnectorMap = new Closure()
+        {
+            public void execute( Object input )
+            {
+                if ( input instanceof ProxyConnectorConfiguration )
+                {
+                    ProxyConnectorConfiguration proxyConfig = (ProxyConnectorConfiguration) input;
+                    String key = proxyConfig.getSourceRepoId();
+
+                    List connectors = (List) proxyConnectorMap.get( key );
+                    if ( connectors == null )
+                    {
+                        connectors = new ArrayList();
+                        proxyConnectorMap.put( key, connectors );
+                    }
+                    
+                    connectors.add( proxyConfig );
+                }
+            }
+        };
+
+        CollectionUtils.forAllDo( config.getProxyConnectors(), addToProxyConnectorMap );
+    }
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL );
+
+        return bundle;
+    }
+
+    public Map getRepoMap()
+    {
+        return repoMap;
+    }
+
+    public void setRepoMap( Map repoMap )
+    {
+        this.repoMap = repoMap;
+    }
+
+    public Map getProxyConnectorMap()
+    {
+        return proxyConnectorMap;
+    }
+
+    public void setProxyConnectorMap( Map proxyConnectorMap )
+    {
+        this.proxyConnectorMap = proxyConnectorMap;
+    }
+}

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SingleSelectTransformer.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SingleSelectTransformer.java?view=auto&rev=535418
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SingleSelectTransformer.java (added)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SingleSelectTransformer.java Fri May  4 17:05:23 2007
@@ -0,0 +1,56 @@
+package org.apache.maven.archiva.web.action.admin.connectors.proxy;
+
+/*
+ * 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 org.apache.commons.collections.Transformer;
+
+/**
+ * Ensure that input strings are never arrays.
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class SingleSelectTransformer
+    implements Transformer
+{
+    private static Transformer INSTANCE = new SingleSelectTransformer();
+
+    public Object transform( Object input )
+    {
+        if ( input instanceof String )
+        {
+            if ( input.getClass().isArray() )
+            {
+                String arr[] = (String[]) input;
+                if ( arr.length > 0 )
+                {
+                    return arr[0];
+                }
+            }
+        }
+        return null;
+    }
+
+    public static Transformer getInstance()
+    {
+        return INSTANCE;
+    }
+
+}

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SingleSelectTransformer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SingleSelectTransformer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SingleSelectTransformer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java?view=auto&rev=535418
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java (added)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java Fri May  4 17:05:23 2007
@@ -0,0 +1,73 @@
+package org.apache.maven.archiva.web.action.admin.database;
+
+/*
+ * 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.webwork.interceptor.ServletRequestAware;
+import com.opensymphony.xwork.ModelDriven;
+import com.opensymphony.xwork.Preparable;
+import com.opensymphony.xwork.Validateable;
+
+import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
+import org.codehaus.plexus.xwork.action.PlexusActionSupport;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * DatabaseAction 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="databaseAction"
+ */
+public class DatabaseAction
+extends PlexusActionSupport
+implements ModelDriven, Preparable, Validateable, SecureAction, ServletRequestAware
+{
+
+    public Object getModel()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void prepare()
+        throws Exception
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void setServletRequest( HttpServletRequest request )
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+}

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java?view=auto&rev=535418
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java (added)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java Fri May  4 17:05:23 2007
@@ -0,0 +1,73 @@
+package org.apache.maven.archiva.web.action.admin.networkproxies;
+
+/*
+ * 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.webwork.interceptor.ServletRequestAware;
+import com.opensymphony.xwork.ModelDriven;
+import com.opensymphony.xwork.Preparable;
+import com.opensymphony.xwork.Validateable;
+
+import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
+import org.codehaus.plexus.xwork.action.PlexusActionSupport;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * NetworkProxiesAction 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component role="com.opensymphony.xwork.Action" role-hint="networkProxiesAction"
+ */
+public class NetworkProxiesAction
+extends PlexusActionSupport
+implements ModelDriven, Preparable, Validateable, SecureAction, ServletRequestAware
+{
+
+    public Object getModel()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void prepare()
+        throws Exception
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void setServletRequest( HttpServletRequest request )
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+}

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AdminRepositoryConfiguration.java (from r534213, maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/models/AdminRepositoryConfiguration.java)
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AdminRepositoryConfiguration.java?view=diff&rev=535418&p1=maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/models/AdminRepositoryConfiguration.java&r1=534213&p2=maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AdminRepositoryConfiguration.java&r2=535418
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/models/AdminRepositoryConfiguration.java (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AdminRepositoryConfiguration.java Fri May  4 17:05:23 2007
@@ -1,4 +1,4 @@
-package org.apache.maven.archiva.web.action.admin.models;
+package org.apache.maven.archiva.web.action.admin.repositories;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -36,8 +36,6 @@
 public class AdminRepositoryConfiguration
     extends RepositoryConfiguration
 {
-    private String directory;
-
     private RepositoryContentStatistics stats;
 
     public AdminRepositoryConfiguration()
@@ -70,23 +68,33 @@
 
     public boolean isDirectoryExists()
     {
-        if ( StringUtils.isBlank( directory ) )
+        if ( StringUtils.isBlank( getDirectory() ) )
         {
             return false;
         }
 
-        File dir = new File( directory );
+        File dir = new File( getDirectory() );
         return ( dir.exists() && dir.isDirectory() );
     }
 
     public String getDirectory()
     {
-        return directory;
+        if ( this.isManaged() )
+        {
+            if ( StringUtils.isBlank( this.getUrl() ) )
+            {
+                return null;
+            }
+
+            RepositoryURL url = new RepositoryURL( this.getUrl() );
+            return url.getPath();
+        }
+
+        return null;
     }
 
     public void setDirectory( String directory )
     {
-        this.directory = directory;
         this.setUrl( PathUtil.toUrl( directory ) );
     }
 



Mime
View raw message