]> source.dussan.org Git - archiva.git/blob
746c82242be462e1f446d94d2f8deadcb1ee5693
[archiva.git] /
1 <%--
2   ~ Licensed to the Apache Software Foundation (ASF) under one
3   ~ or more contributor license agreements.  See the NOTICE file
4   ~ distributed with this work for additional information
5   ~ regarding copyright ownership.  The ASF licenses this file
6   ~ to you under the Apache License, Version 2.0 (the
7   ~ "License"); you may not use this file except in compliance
8   ~ with the License.  You may obtain a copy of the License at
9   ~
10   ~   http://www.apache.org/licenses/LICENSE-2.0
11   ~
12   ~ Unless required by applicable law or agreed to in writing,
13   ~ software distributed under the License is distributed on an
14   ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   ~ KIND, either express or implied.  See the License for the
16   ~ specific language governing permissions and limitations
17   ~ under the License.
18   --%>
19
20 <%@ taglib prefix="s" uri="/struts-tags" %>
21 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
22 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
23 <%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %>
24 <%@ taglib prefix="archiva" uri="http://archiva.apache.org" %>
25
26 <html>
27 <head>
28   <title>Administration - Repository Groups</title>
29   <s:head/>
30 </head>
31
32 <body>
33
34 <h1>Administration - Repository Groups</h1>
35
36 <c:url var="iconDeleteUrl" value="/images/icons/delete.gif"/>
37 <c:url var="iconEditUrl" value="/images/icons/edit.png"/>
38 <c:url var="iconCreateUrl" value="/images/icons/create.png"/>
39 <c:url var="iconUpUrl" value="/images/icons/up.gif"/>
40 <c:url var="iconDownUrl" value="/images/icons/down.gif"/>
41
42 <div id="contentArea">
43
44 <s:actionerror/>
45 <s:actionmessage/>
46
47 <div align="right">
48   <redback:ifAnyAuthorized permissions="archiva-manage-configuration">
49     <s:form action="addRepositoryGroup" namespace="/admin">
50       <span class="label">Identifier<span style="color:red">*</span>:</span> 
51       <s:textfield size="10" label="Identifier" theme="simple" name="repositoryGroup.id"/>
52       <s:submit value="Add Group" theme="simple" cssClass="button"/>
53     </s:form>
54   </redback:ifAnyAuthorized>
55 </div>
56
57 <h2>Repository Groups</h2>
58
59 <c:choose>
60 <c:when test="${empty (repositoryGroups)}">
61   <strong>No Repository Groups Defined.</strong>
62 </c:when>
63 <c:otherwise>
64
65 <div class="admin">
66
67 <c:forEach items="${repositoryGroups}" var="repositoryGroup" varStatus="i">
68
69 <div class="repoGroup">
70   <div class="managedRepo">
71     
72     <div style="float:right">
73       <s:url id="deleteRepositoryGroupUrl" action="confirmDeleteRepositoryGroup">
74         <s:param name="repoGroupId" value="%{#attr.repositoryGroup.key}" />
75       </s:url>
76       <s:a href="%{deleteRepositoryGroupUrl}" cssClass="delete">
77         <img src="${iconDeleteUrl}"/>
78       </s:a>
79     </div>
80     
81     <img src="<c:url value="/images/archiva-splat-32.gif"/>"/>
82     <p class="id">${repositoryGroup.key}</p>
83     <p><a href="${baseUrl}/${repositoryGroup.key}/">${baseUrl}/${repositoryGroup.key}/</a></p>
84   </div>
85
86   <c:if test="${!empty (groupToRepositoryMap[repositoryGroup.key])}">
87   <div class="repos">
88     <s:form name="form%{#attr.i}" action="addRepositoryToGroup" namespace="/admin" validate="true">
89       <s:hidden name="repoGroupId" value="%{#attr.repositoryGroup.key}"/>
90       <s:select list="%{#attr.groupToRepositoryMap[#attr.repositoryGroup.key]}" name="repoId" theme="simple"/>
91       <s:submit value="Add Repository" theme="simple" cssClass="button"/>
92     </s:form>
93   </div>
94   </c:if>
95   
96   <c:set var="numberOfRepos" value="${fn:length(repositoryGroup.value.repositories)}" />
97
98   <c:forEach items="${repositoryGroup.value.repositories}" var="repository" varStatus="r">
99   
100   <c:choose>
101     <c:when test='${(r.index)%2 eq 0}'>
102       <c:set var="rowColor" value="dark" scope="page"/>
103     </c:when>
104     <c:otherwise>
105       <c:set var="rowColor" value="lite" scope="page"/>
106     </c:otherwise>
107   </c:choose>
108
109   <div class="connector ${rowColor}"> 
110     <div class="controls">
111       <redback:ifAnyAuthorized permissions="archiva-manage-configuration">
112         <s:url id="sortDownRepositoryUrl" action="sortDownRepositoryFromGroup">
113           <s:param name="repoGroupId" value="%{#attr.repositoryGroup.key}"/>
114           <s:param name="targetRepo" value="managedRepositories['%{#attr.repository}'].id"/>
115         </s:url>
116         <s:url id="sortUpRepositoryUrl" action="sortUpRepositoryFromGroup">
117           <s:param name="repoGroupId" value="%{#attr.repositoryGroup.key}"/>
118           <s:param name="targetRepo" value="managedRepositories['%{#attr.repository}'].id"/>
119         </s:url>
120         <s:url id="removeRepositoryUrl" action="removeRepositoryFromGroup">
121           <s:param name="repoGroupId" value="%{#attr.repositoryGroup.key}"/>
122           <s:param name="repoId" value="managedRepositories[%{#attr.repository}].id"/>
123         </s:url>
124         <c:if test="${r.count > 1}">
125           <s:a href="%{sortUpRepositoryUrl}" cssClass="up" title="Move Repository Up">
126             <img src="${iconUpUrl}"/>
127           </s:a>
128         </c:if>
129         <c:if test="${r.count < numberOfRepos}">
130           <s:a href="%{sortDownRepositoryUrl}" cssClass="down" title="Move Repository Down">
131             <img src="${iconDownUrl}"/>
132           </s:a>
133         </c:if>
134         <s:a href="%{removeRepositoryUrl}" cssClass="delete" title="Delete Repository">
135           <img src="${iconDeleteUrl}"/>
136         </s:a>
137       </redback:ifAnyAuthorized>
138     </div>
139   
140     <h4>Repository</h4>
141     
142     <div class="managedRepo">
143       <img src="<c:url value="/images/archiva-splat-32.gif"/>"/>
144       <p class="id">${repository}</p>
145       <p class="name">${managedRepositories[repository].name}</p>
146       <p class="url"><a href="${baseUrl}/${managedRepositories[repository].id}/">${baseUrl}/${managedRepositories[repository].id}</a></p>
147     </div>
148   </div> <%-- repository --%> 
149   </c:forEach>
150
151 </div> <%-- repository group --%>
152 </c:forEach>
153 </div> <%-- admin --%>
154
155 </div> <%-- content area --%>
156 </c:otherwise>
157 </c:choose>