archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r693737 - in /archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main: java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java webapp/WEB-INF/jsp/admin/proxyConnectors.jsp
Date Wed, 10 Sep 2008 08:46:27 GMT
Author: oching
Date: Wed Sep 10 01:46:26 2008
New Revision: 693737

URL: http://svn.apache.org/viewvc?rev=693737&view=rev
Log:
[MRM-765]
submitted by Mark Jeffery
-disabled the Add link if there are no remote repositories defined and inform the user that
it is disabled

Modified:
    archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java
    archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/proxyConnectors.jsp

Modified: archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java?rev=693737&r1=693736&r2=693737&view=diff
==============================================================================
--- archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java
(original)
+++ archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java
Wed Sep 10 01:46:26 2008
@@ -44,6 +44,11 @@
     private Map<String, AbstractRepositoryConfiguration> repoMap;
 
     /**
+     * boolean to indicate that remote repo is present. Used for Add Link
+     */
+    private boolean remoteRepoExists=false;
+    
+    /**
      * Map of Proxy Connectors.
      */
     private Map<String, List<ProxyConnectorConfiguration>> proxyConnectorMap;
@@ -57,6 +62,8 @@
         repoMap.putAll( config.getManagedRepositoriesAsMap() );
 
         proxyConnectorMap = createProxyConnectorMap();
+        
+        remoteRepoExists=config.getRemoteRepositories().size()>0;
     }
 
     public Map<String, AbstractRepositoryConfiguration> getRepoMap()
@@ -68,4 +75,9 @@
     {
         return proxyConnectorMap;
     }
+
+	public boolean getRemoteRepoExists()
+    {
+        return remoteRepoExists;
+    }
 }

Modified: archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/proxyConnectors.jsp
URL: http://svn.apache.org/viewvc/archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/proxyConnectors.jsp?rev=693737&r1=693736&r2=693737&view=diff
==============================================================================
--- archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/proxyConnectors.jsp
(original)
+++ archiva/branches/archiva-1.1.x/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/proxyConnectors.jsp
Wed Sep 10 01:46:26 2008
@@ -44,14 +44,22 @@
 <ww:actionerror/>
 <ww:actionmessage/>
 
-<div style="float:right">
-  <redback:ifAnyAuthorized permissions="archiva-manage-configuration">
-    <ww:url id="addProxyConnectorUrl" action="addProxyConnector"/>
-    <ww:a href="%{addProxyConnectorUrl}" cssClass="create">
-      <img src="<c:url value="/images/icons/create.png" />"/>
-      Add
-    </ww:a>
-  </redback:ifAnyAuthorized>
+<div style="float:right">  
+  <c:choose>
+	<c:when test="${remoteRepoExists}">
+	  <redback:ifAnyAuthorized permissions="archiva-manage-configuration">
+	    <ww:url id="addProxyConnectorUrl" action="addProxyConnector"/>
+	    <ww:a href="%{addProxyConnectorUrl}" cssClass="create">
+	      <img src="<c:url value="/images/icons/create.png" />"/>
+	      Add
+	    </ww:a>
+	  </redback:ifAnyAuthorized>
+	</c:when>
+	<c:otherwise>
+		<img src="<c:url value="/images/icons/create.png" />"/>
+	      Add (Disabled. No remote repositories)
+	</c:otherwise>
+  </c:choose>    
 </div>
 
 <h2>Repository Proxy Connectors</h2>



Mime
View raw message