Moved the Managed Repository administration out of the main Administration page and onto its own page.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@479065 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2006-11-25 01:13:35 +00:00
parent fb36d24b9b
commit 74d149d557
4 changed files with 149 additions and 108 deletions

View File

@ -190,21 +190,25 @@
<result name="input">/WEB-INF/jsp/admin/index.jsp</result> <result name="input">/WEB-INF/jsp/admin/index.jsp</result>
</action> </action>
<action name="managedRepositories" class="configureAction" method="input">
<result name="input">/WEB-INF/jsp/admin/managedRepositories.jsp</result>
</action>
<action name="addRepository" class="configureRepositoryAction" method="add"> <action name="addRepository" class="configureRepositoryAction" method="add">
<result name="input">/WEB-INF/jsp/admin/addRepository.jsp</result> <result name="input">/WEB-INF/jsp/admin/addRepository.jsp</result>
<result type="redirect-action">index</result> <result type="redirect-action">managedRepositories</result>
<interceptor-ref name="unconfiguredStack"/> <interceptor-ref name="unconfiguredStack"/>
</action> </action>
<action name="editRepository" class="configureRepositoryAction" method="edit"> <action name="editRepository" class="configureRepositoryAction" method="edit">
<result name="input">/WEB-INF/jsp/admin/editRepository.jsp</result> <result name="input">/WEB-INF/jsp/admin/editRepository.jsp</result>
<result type="redirect-action">index</result> <result type="redirect-action">managedRepositories</result>
<interceptor-ref name="configuredPrepareParamsStack"/> <interceptor-ref name="configuredPrepareParamsStack"/>
</action> </action>
<action name="deleteRepository" class="deleteRepositoryAction"> <action name="deleteRepository" class="deleteRepositoryAction">
<result name="input">/WEB-INF/jsp/admin/deleteRepository.jsp</result> <result name="input">/WEB-INF/jsp/admin/deleteRepository.jsp</result>
<result type="redirect-action">index</result> <result type="redirect-action">managedRepositories</result>
</action> </action>
<action name="proxiedRepositories" class="configureAction" method="input"> <action name="proxiedRepositories" class="configureAction" method="input">

View File

@ -79,110 +79,5 @@
</table> </table>
</c:if> </c:if>
<c:set var="urlbase">${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/repository/</c:set>
<div>
<div style="float: right">
<%-- TODO replace with icons --%>
<pss:ifAuthorized permission="archiva-add-repository">
<ww:url id="addRepositoryUrl" action="addRepository" method="input"/>
<ww:a href="%{addRepositoryUrl}">Add Repository</ww:a>
</pss:ifAuthorized>
</div>
<h2>Managed Repositories</h2>
</div>
<ww:set name="repositories" value="repositories"/>
<c:if test="${empty(repositories)}">
<strong>There are no managed repositories configured yet.</strong>
</c:if>
<c:forEach items="${repositories}" var="repository" varStatus="i">
<div>
<div style="float: right">
<ww:url id="editRepositoryUrl" action="editRepository" method="input">
<ww:param name="repoId" value="%{'${repository.id}'}" />
</ww:url>
<ww:url id="deleteRepositoryUrl" action="deleteRepository" method="input">
<ww:param name="repoId" value="%{'${repository.id}'}" />
</ww:url>
<%-- TODO replace with icons --%>
<pss:ifAuthorized permission="archiva-edit-repository" resource="${repository.id}"><ww:a href="%{editRepositoryUrl}">Edit Repository</ww:a></pss:ifAuthorized>
<pss:ifAuthorized permission="archiva-delete-repository" resource="${repository.id}"><ww:a href="%{deleteRepositoryUrl}">Delete Repository</ww:a></pss:ifAuthorized>
</div>
<h3>${repository.name}</h3>
<table class="infoTable">
<tr>
<th>Identifier</th>
<td>
<code>${repository.id}</code>
</td>
</tr>
<tr>
<th>Directory</th>
<td>${repository.directory}</td>
</tr>
<tr>
<th>WebDAV URL</th>
<td><a href="${urlbase}${repository.urlName}">${urlbase}${repository.urlName}</a></td>
</tr>
<tr>
<th>Type</th>
<%-- TODO: can probably just use layout appended to a key prefix in i18n to simplify this --%>
<td>
<c:choose>
<c:when test="${repository.layout == 'default'}">
Maven 2.x Repository
</c:when>
<c:otherwise>
Maven 1.x Repository
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<th>Snapshots Included</th>
<td class="${repository.includeSnapshots ? 'doneMark' : 'errorMark'} booleanIcon"> ${repository.includeSnapshots}</td>
</tr>
<tr>
<th>Indexed</th>
<td class="${repository.indexed ? 'doneMark' : 'errorMark'} booleanIcon"> ${repository.indexed}</td>
</tr>
<tr>
<th>POM Snippet</th>
<td><a href="#" onclick="Effect.toggle('repoPom${repository.id}','slide'); return false;">Show POM Snippet</a><br />
<pre class="pom" style="display: none;" id="repoPom${repository.id}"><code>&lt;project>
...
&lt;distributionManagement>
&lt;${repository.includeSnapshots ? 'snapshotRepository' : 'repository'}>
&lt;id>${repository.id}&lt;/id>
&lt;url>dav:${urlbase}${repository.urlName}&lt;/url><c:if test="${repository.layout != 'default'}">
&lt;layout>${repository.layout}&lt;/layout></c:if>
&lt;/${repository.includeSnapshots ? 'snapshotRepository' : 'repository'}>
&lt;/distributionManagement>
&lt;repositories>
&lt;repository>
&lt;id>${repository.id}&lt;/id>
&lt;name>${repository.name}&lt;/name>
&lt;url>${urlbase}${repository.urlName}&lt;/url><c:if test="${repository.layout != 'default'}">
&lt;layout>${repository.layout}&lt;/layout></c:if>
&lt;releases>
&lt;enabled>${repository.includeSnapshots ? 'false' : 'true'}&lt;/enabled>
&lt;/releases>
&lt;snapshots>
&lt;enabled>${repository.includeSnapshots ? 'true' : 'false'}&lt;/enabled>
&lt;/snapshots>
&lt;/repository>
&lt;/repositories>
...
&lt;/project>
</code></pre>
</td>
</tr>
</table>
</div>
</c:forEach>
</div>
</body> </body>
</html> </html>

View File

@ -0,0 +1,139 @@
<%--
~ Copyright 2005-2006 The Apache Software Foundation.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
--%>
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="pss" uri="/plexusSecuritySystem" %>
<html>
<head>
<title>Administration</title>
<ww:head/>
</head>
<body>
<h1>Administration</h1>
<div id="contentArea">
<c:set var="urlbase">${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/repository/</c:set>
<div>
<div style="float: right">
<%-- TODO replace with icons --%>
<pss:ifAuthorized permission="archiva-add-repository">
<ww:url id="addRepositoryUrl" action="addRepository" method="input"/>
<ww:a href="%{addRepositoryUrl}">Add Repository</ww:a>
</pss:ifAuthorized>
</div>
<h2>Managed Repositories</h2>
</div>
<ww:set name="repositories" value="repositories"/>
<c:if test="${empty(repositories)}">
<strong>There are no managed repositories configured yet.</strong>
</c:if>
<c:forEach items="${repositories}" var="repository" varStatus="i">
<div>
<div style="float: right">
<ww:url id="editRepositoryUrl" action="editRepository" method="input">
<ww:param name="repoId" value="%{'${repository.id}'}" />
</ww:url>
<ww:url id="deleteRepositoryUrl" action="deleteRepository" method="input">
<ww:param name="repoId" value="%{'${repository.id}'}" />
</ww:url>
<%-- TODO replace with icons --%>
<pss:ifAuthorized permission="archiva-edit-repository" resource="${repository.id}"><ww:a href="%{editRepositoryUrl}">Edit Repository</ww:a></pss:ifAuthorized>
<pss:ifAuthorized permission="archiva-delete-repository" resource="${repository.id}"><ww:a href="%{deleteRepositoryUrl}">Delete Repository</ww:a></pss:ifAuthorized>
</div>
<h3>${repository.name}</h3>
<table class="infoTable">
<tr>
<th>Identifier</th>
<td>
<code>${repository.id}</code>
</td>
</tr>
<tr>
<th>Directory</th>
<td>${repository.directory}</td>
</tr>
<tr>
<th>WebDAV URL</th>
<td><a href="${urlbase}${repository.urlName}">${urlbase}${repository.urlName}</a></td>
</tr>
<tr>
<th>Type</th>
<%-- TODO: can probably just use layout appended to a key prefix in i18n to simplify this --%>
<td>
<c:choose>
<c:when test="${repository.layout == 'default'}">
Maven 2.x Repository
</c:when>
<c:otherwise>
Maven 1.x Repository
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<th>Snapshots Included</th>
<td class="${repository.includeSnapshots ? 'doneMark' : 'errorMark'} booleanIcon"> ${repository.includeSnapshots}</td>
</tr>
<tr>
<th>Indexed</th>
<td class="${repository.indexed ? 'doneMark' : 'errorMark'} booleanIcon"> ${repository.indexed}</td>
</tr>
<tr>
<th>POM Snippet</th>
<td><a href="#" onclick="Effect.toggle('repoPom${repository.id}','slide'); return false;">Show POM Snippet</a><br />
<pre class="pom" style="display: none;" id="repoPom${repository.id}"><code>&lt;project>
...
&lt;distributionManagement>
&lt;${repository.includeSnapshots ? 'snapshotRepository' : 'repository'}>
&lt;id>${repository.id}&lt;/id>
&lt;url>dav:${urlbase}${repository.urlName}&lt;/url><c:if test="${repository.layout != 'default'}">
&lt;layout>${repository.layout}&lt;/layout></c:if>
&lt;/${repository.includeSnapshots ? 'snapshotRepository' : 'repository'}>
&lt;/distributionManagement>
&lt;repositories>
&lt;repository>
&lt;id>${repository.id}&lt;/id>
&lt;name>${repository.name}&lt;/name>
&lt;url>${urlbase}${repository.urlName}&lt;/url><c:if test="${repository.layout != 'default'}">
&lt;layout>${repository.layout}&lt;/layout></c:if>
&lt;releases>
&lt;enabled>${repository.includeSnapshots ? 'false' : 'true'}&lt;/enabled>
&lt;/releases>
&lt;snapshots>
&lt;enabled>${repository.includeSnapshots ? 'true' : 'false'}&lt;/enabled>
&lt;/snapshots>
&lt;/repository>
&lt;/repositories>
...
&lt;/project>
</code></pre>
</td>
</tr>
</table>
</div>
</c:forEach>
</div>
</body>
</html>

View File

@ -119,6 +119,9 @@
<ul> <ul>
<li class="none">
<my:currentWWUrl action="managedRepositories" namespace="/admin">Managed Repositories</my:currentWWUrl>
</li>
<li class="none"> <li class="none">
<my:currentWWUrl action="proxiedRepositories" namespace="/admin">Proxied Repositories</my:currentWWUrl> <my:currentWWUrl action="proxiedRepositories" namespace="/admin">Proxied Repositories</my:currentWWUrl>
</li> </li>