diff options
author | Brett Porter <brett@apache.org> | 2008-04-18 10:40:45 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2008-04-18 10:40:45 +0000 |
commit | 3d13eda595c0e4f3a29524590db775c6f955ec79 (patch) | |
tree | 6350e5834198ecd421fb346105e4f5183ad4d547 | |
parent | 202feaa707d8b2aa5d4a9a2829fa772d789b414b (diff) | |
download | archiva-3d13eda595c0e4f3a29524590db775c6f955ec79.tar.gz archiva-3d13eda595c0e4f3a29524590db775c6f955ec79.zip |
[MRM-694] display the groups in the repositories page
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@649453 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 55 insertions, 4 deletions
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo b/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo index 041e3b8f2..57770b885 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo @@ -161,6 +161,37 @@ </fields> <codeSegments> <codeSegment> + <version>1.2.0+</version> + <code><![CDATA[ + private java.util.Map<String, java.util.List<String>> repositoryToGroupMap; + + public java.util.Map<String, java.util.List<String>> getRepositoryToGroupMap() + { + if ( repositoryToGroupMap == null ) + { + java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>(); + + for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups ) + { + for ( String repositoryId : (java.util.List<String>) group.getRepositories() ) + { + java.util.List<String> groups = map.get( repositoryId ); + if ( groups == null ) + { + groups = new java.util.ArrayList<String>(); + map.put( repositoryId, groups ); + } + groups.add( group.getId() ); + } + } + + repositoryToGroupMap = map; + } + return repositoryToGroupMap; + } + ]]></code> + </codeSegment> + <codeSegment> <version>1.0.0+</version> <code><![CDATA[ public java.util.Map<String, NetworkProxyConfiguration> getNetworkProxiesAsMap() diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java index 0962df616..3dda6d7d5 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java @@ -65,6 +65,8 @@ public class RepositoriesAction private List<RemoteRepositoryConfiguration> remoteRepositories; private Map<String, RepositoryContentStatistics> repositoryStatistics; + + private Map<String, List<String>> repositoryToGroupMap; /** * @plexus.requirement role-hint="jdo" @@ -99,6 +101,7 @@ public class RepositoriesAction remoteRepositories = new ArrayList<RemoteRepositoryConfiguration>( config.getRemoteRepositories() ); managedRepositories = new ArrayList<ManagedRepositoryConfiguration>( config.getManagedRepositories() ); + repositoryToGroupMap = config.getRepositoryToGroupMap(); Collections.sort( managedRepositories, new RepositoryConfigurationComparator() ); Collections.sort( remoteRepositories, new RepositoryConfigurationComparator() ); @@ -134,4 +137,9 @@ public class RepositoriesAction { return baseUrl; } + + public Map<String, List<String>> getRepositoryToGroupMap() + { + return repositoryToGroupMap; + } } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp index fcd72989a..eb77e6f48 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp @@ -116,10 +116,12 @@ <th>Directory</th> <td>${repository.location}</td> </tr> -<tr> - <th>Index Directory</th> - <td>${repository.indexDir}</td> -</tr> +<c:if test="${!empty(repository.indexDir)}"> + <tr> + <th>Index Directory</th> + <td>${repository.indexDir}</td> + </tr> +</c:if> <tr> <th>WebDAV URL</th> <td><a href="${baseUrl}/${repository.id}/">${baseUrl}/${repository.id}/</a></td> @@ -138,6 +140,16 @@ </c:choose> </td> </tr> +<c:if test="${!empty(repositoryToGroupMap[repository.id])}"> + <tr> + <th>Groups</th> + <td> + <c:forEach items="${repositoryToGroupMap[repository.id]}" varStatus="i" var="group"> + ${group}<c:if test="${!i.last}">,</c:if> + </c:forEach> + </td> + </tr> +</c:if> <tr> <th>Releases Included</th> <td class="${repository.releases ? 'donemark' : 'errormark'} booleanIcon"> </td> |