]> source.dussan.org Git - archiva.git/commitdiff
[MRM-144] clean up artifact links
authorBrett Porter <brett@apache.org>
Sat, 30 Sep 2006 12:11:16 +0000 (12:11 +0000)
committerBrett Porter <brett@apache.org>
Sat, 30 Sep 2006 12:11:16 +0000 (12:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@451586 13f79535-47bb-0310-9956-ffa450edef68

archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactDependencies.jspf
archiva-webapp/src/main/webapp/WEB-INF/jsp/include/dependencyTree.jspf
archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp
archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag [new file with mode: 0644]

index 32477f58a4248545f402a83d636ab84691b5cdb3..3f15e6bed5166f796db4914c94e8223f258657af 100644 (file)
@@ -1,5 +1,6 @@
 <%@ taglib prefix="ww" uri="/webwork" %>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>
 
 <%-- TODO: paginate! --%>
 <c:forEach items="${dependencies}" var="dependency">
     <a href="${url}">${dependency.artifactId}</a>
   </h3>
 
-  <%-- TODO! use CSS, share with search results --%>
   <p>
-            <span style="font-size: x-small">
-              <%-- TODO! share with browse as a tag --%>
-              <c:set var="cumulativeGroup" value=""/>
-              <c:forTokens items="${dependency.groupId}" delims="." var="part">
-                <c:choose>
-                  <c:when test="${empty(cumulativeGroup)}">
-                    <c:set var="cumulativeGroup" value="${part}"/>
-                  </c:when>
-                  <c:otherwise>
-                    <c:set var="cumulativeGroup" value="${cumulativeGroup}.${part}"/>
-                  </c:otherwise>
-                </c:choose>
-                <c:set var="url">
-                  <ww:url action="browseGroup" namespace="/">
-                    <ww:param name="groupId" value="%{'${cumulativeGroup}'}"/>
-                  </ww:url>
-                </c:set>
-                <a href="${url}">${part}</a> /
-              </c:forTokens>
-              <strong>${dependency.artifactId}</strong>
-              | <strong>Version(s):</strong>
-              <c:choose>
-                <c:when test="${!empty(dependency.version)}">
-                  <c:set var="url">
-                    <ww:url action="showArtifact" namespace="/">
-                      <ww:param name="groupId" value="%{'${dependency.groupId}'}"/>
-                      <ww:param name="artifactId" value="%{'${dependency.artifactId}'}"/>
-                      <c:if test="${!empty(dependency.version)}">
-                        <ww:param name="version" value="%{'${dependency.version}'}"/>
-                      </c:if>
-                    </ww:url>
-                  </c:set>
-                  <a href="${url}">${dependency.version}</a>
-                </c:when>
-                <c:otherwise>
-                  <c:forEach items="${dependency.versions}" var="version" varStatus="i">
-                    <c:set var="url">
-                      <ww:url action="showArtifact" namespace="/">
-                        <ww:param name="groupId" value="%{'${dependency.groupId}'}"/>
-                        <ww:param name="artifactId" value="%{'${dependency.artifactId}'}"/>
-                        <ww:param name="version" value="%{'${version}'}"/>
-                      </ww:url>
-                    </c:set>
-                    <a href="${url}">${version}</a>
-                    <c:if test="${!i.last}">,</c:if>
-                  </c:forEach>
-                </c:otherwise>
-              </c:choose>
-              <c:if test="${!empty(dependency.scope)}">
-                | <strong>Scope:</strong> ${dependency.scope}
-              </c:if>
-              <c:if test="${!empty(dependency.classifier)}">
-                | <strong>Classifier:</strong> ${dependency.classifier}
-              </c:if>
-            </span>
+    <my:showArtifactLink groupId="${dependency.groupId}" artifactId="${dependency.artifactId}"
+                         version="${dependency.version}" versions="${dependency.versions}" scope="${dependency.scope}"
+                         classifier="${dependency.classifier}"/>
   </p>
 </c:forEach>
 <c:if test="${empty(dependencies)}">
index a86b779a3212c7e6f5936ad1e248624b810beb19..55a9ecc5128cd4c2792122c510d124404cda2943 100644 (file)
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>
 
-
 <ul>
-  <c:set var="prevDepth" value="1"/>
-  <ww:set name="dependencyTree" value="dependencyTree"/>
-  <c:forEach items="${dependencyTree}" var="node">
-    <c:choose>
-      <c:when test="${node.depth < prevDepth}">
-        </ul>
-        <li>
-      </c:when>
-      <c:when test="${node.depth > prevDepth}">
-        <ul>
-        <li>
-      </c:when>
-      <c:otherwise>
-        <li>
-      </c:otherwise>
-    </c:choose>
-    <c:set var="url">
-      <ww:url action="showArtifact" namespace="/">
-        <ww:param name="groupId" value="%{'${node.artifact.groupId}'}"/>
-        <ww:param name="artifactId" value="%{'${node.artifact.artifactId}'}"/>
-        <ww:param name="version" value="%{'${node.artifact.version}'}"/>
-      </ww:url>
-    </c:set>
-    <a href="${url}">
-      <%-- TODO! show this like the other dependencies: g / g1 / g2 / artifactId / version --%>
-      <c:out value="${node.artifact.dependencyConflictId}"/>
-    </a>
-    </li>
-    <c:set var="prevDepth" value="${node.depth}" />
-  </c:forEach>
+<c:set var="prevDepth" value="1"/>
+<ww:set name="dependencyTree" value="dependencyTree"/>
+<c:forEach items="${dependencyTree}" var="node">
+  <c:choose>
+    <c:when test="${node.depth < prevDepth}">
+      </ul>
+      <li>
+    </c:when>
+    <c:when test="${node.depth > prevDepth}">
+      <ul>
+      <li>
+    </c:when>
+    <c:otherwise>
+      <li>
+    </c:otherwise>
+  </c:choose>
+  <my:showArtifactLink groupId="${node.artifact.groupId}" artifactId="${node.artifact.artifactId}"
+                       version="${node.artifact.version}"/>
+  </li>
+  <c:set var="prevDepth" value="${node.depth}"/>
+</c:forEach>
 </ul>
   
\ No newline at end of file
index 2d234144c095a850946972e1a2a587267da26b6a..f44b2bc378dd76109b513904141e1f6069c9f3df 100644 (file)
@@ -19,6 +19,7 @@
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 <%@ taglib prefix="pss" uri="/plexusSecuritySystem" %>
+<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>
 
 <html>
 <head>
@@ -34,7 +35,7 @@
 
 <div id="contentArea">
 
-<pss:ifAnyAuthorized permissions="archiva-generate-reports">
+<pss:ifAnyAuthorized permissions="archiva-access-reports">
   <ww:form action="reports" namespace="/admin">
     <ww:select list="reports" label="Report" name="reportGroup" onchange="document.reports.submit();"/>
     <ww:select list="configuration.repositories" listKey="id" listValue="name" label="Repository" headerKey="-"
@@ -55,7 +56,7 @@
     --%>
   <c:choose>
     <c:when test="${!database.inProgress}">
-      <pss:ifAuthorized permission="archiva-generate-reports">
+      <pss:ifAuthorized permission="archiva-access-reports">
         <ww:url id="regenerateReportUrl" action="runReport" namespace="/admin">
           <ww:param name="repositoryId">${database.repository.id}</ww:param>
           <ww:param name="reportGroup" value="reportGroup"/>
@@ -84,8 +85,9 @@
       ${database.numNotices}
 
       <span style="font-size: x-small">
-        <%-- TODO! use better formatting here --%>
-        Last updated: ${database.reporting.lastModified},
+        <jsp:useBean id="date" class="java.util.Date"/>
+        <c:set target="${date}" property="time" value="${database.reporting.lastModified}"/>
+        Last updated: <fmt:formatDate type="both" value="${date}" />,
         execution time: <fmt:formatNumber maxFractionDigits="0" value="${database.reporting.executionTime / 60000}"/> minutes
         <fmt:formatNumber maxFractionDigits="0" value="${(database.reporting.executionTime / 1000) % 60}"/> seconds
       </span>
 </p>
 
   <%-- TODO need to protect iterations against concurrent modification exceptions by cloning the lists synchronously --%>
-  <%-- TODO! factor out common parts, especially artifact rendering tag --%>
   <%-- TODO! paginate (displaytag?) --%>
 <c:if test="${!empty(database.reporting.artifacts)}">
   <h3>Artifacts</h3>
       </c:forEach>
     </ul>
     <p style="text-indent: 3em;">
-          <span style="font-size: x-small">
-            <%-- TODO! share with browse as a tag --%>
-          <c:set var="cumulativeGroup" value=""/>
-          <c:forTokens items="${artifact.groupId}" delims="." var="part">
-            <c:choose>
-              <c:when test="${empty(cumulativeGroup)}">
-                <c:set var="cumulativeGroup" value="${part}"/>
-              </c:when>
-              <c:otherwise>
-                <c:set var="cumulativeGroup" value="${cumulativeGroup}.${part}"/>
-              </c:otherwise>
-            </c:choose>
-            <c:set var="url">
-              <ww:url action="browseGroup" namespace="/">
-                <ww:param name="groupId" value="%{'${cumulativeGroup}'}"/>
-              </ww:url>
-            </c:set>
-            <a href="${url}">${part}</a> /
-          </c:forTokens>
-          <strong>${artifact.artifactId}</strong>
-          | <strong>Version:</strong>
-          <c:set var="url">
-            <ww:url action="showArtifact" namespace="/">
-              <ww:param name="groupId" value="%{'${artifact.groupId}'}"/>
-              <ww:param name="artifactId" value="%{'${artifact.artifactId}'}"/>
-              <c:if test="${!empty(artifact.version)}">
-                <ww:param name="version" value="%{'${artifact.version}'}"/>
-              </c:if>
-            </ww:url>
-          </c:set>
-          <a href="${url}">${artifact.version}</a>
-          <c:if test="${!empty(artifact.classifier)}">
-            | <strong>Classifier:</strong> ${artifact.classifier}
-          </c:if>
-        </span>
+      <my:showArtifactLink groupId="${artifact.groupId}" artifactId="${artifact.artifactId}"
+                           version="${artifact.version}" classifier="${artifact.classifier}"/>
     </p>
     <%-- TODO!
               <td>
       </c:forEach>
     </ul>
     <p style="text-indent: 3em;">
-          <span style="font-size: x-small">
-            <%-- TODO! share with browse as a tag --%>
-          <c:set var="cumulativeGroup" value=""/>
-          <c:forTokens items="${metadata.groupId}" delims="." var="part" varStatus="i">
-            <c:choose>
-              <c:when test="${empty(cumulativeGroup)}">
-                <c:set var="cumulativeGroup" value="${part}"/>
-              </c:when>
-              <c:otherwise>
-                <c:set var="cumulativeGroup" value="${cumulativeGroup}.${part}"/>
-              </c:otherwise>
-            </c:choose>
-            <c:set var="url">
-              <ww:url action="browseGroup" namespace="/">
-                <ww:param name="groupId" value="%{'${cumulativeGroup}'}"/>
-              </ww:url>
-            </c:set>
-            <a href="${url}">${part}</a>
-            <c:if test="${!i.last}">
-              /
-            </c:if>
-          </c:forTokens>
-              <c:if test="${!empty(metadata.artifactId)}">
-                <c:set var="url">
-                  <ww:url action="browseArtifact" namespace="/">
-                    <ww:param name="groupId" value="%{'${metadata.groupId}'}"/>
-                    <ww:param name="artifactId" value="%{'${metadata.artifactId}'}"/>
-                  </ww:url>
-                </c:set>
-                / <a href="${url}">${metadata.artifactId}</a>
-              </c:if>
-<c:if test="${!empty(metadata.version)}"> | <strong>Version:</strong>
-  <c:set var="url">
-    <ww:url action="showArtifact" namespace="/">
-      <ww:param name="groupId" value="%{'${metadata.groupId}'}"/>
-      <ww:param name="artifactId" value="%{'${metadata.artifactId}'}"/>
-      <ww:param name="version" value="%{'${metadata.version}'}"/>
-    </ww:url>
-  </c:set>
-  <a href="${url}">${metadata.version}</a>
-</c:if>       
-        </span>
+      <my:showArtifactLink groupId="${metadata.groupId}" artifactId="${metadata.artifactId}"
+                           version="${metadata.version}"/>
     </p>
     <%-- TODO!
               <td>
diff --git a/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag b/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag
new file mode 100644 (file)
index 0000000..789c2de
--- /dev/null
@@ -0,0 +1,90 @@
+<%--
+  ~ 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 uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ attribute name="groupId" required="true" %>
+<%@ attribute name="artifactId" %>
+<%@ attribute name="version" %>
+<%@ attribute name="classifier" %>
+<%@ attribute name="scope" %>
+<%@ attribute name="versions" %>
+
+<span style="font-size: x-small">
+  <c:set var="cumulativeGroup" value=""/>
+  <c:forTokens items="${groupId}" delims="." var="part" varStatus="i">
+    <c:choose>
+      <c:when test="${empty(cumulativeGroup)}">
+        <c:set var="cumulativeGroup" value="${part}"/>
+      </c:when>
+      <c:otherwise>
+        <c:set var="cumulativeGroup" value="${cumulativeGroup}.${part}"/>
+      </c:otherwise>
+    </c:choose>
+    <c:set var="url">
+      <ww:url action="browseGroup" namespace="/">
+        <ww:param name="groupId" value="%{'${cumulativeGroup}'}"/>
+      </ww:url>
+    </c:set>
+    <a href="${url}">${part}</a>
+    <c:if test="${!i.last}">
+      /
+    </c:if>
+  </c:forTokens>
+  <c:if test="${!empty(artifactId)}">
+    <c:set var="url">
+      <ww:url action="browseArtifact" namespace="/">
+        <ww:param name="groupId" value="%{'${groupId}'}"/>
+        <ww:param name="artifactId" value="%{'${artifactId}'}"/>
+      </ww:url>
+    </c:set>
+    / <a href="${url}">${artifactId}</a>
+  </c:if>
+  | <strong>Version(s):</strong>
+  <c:choose>
+    <c:when test="${!empty(version)}">
+      <c:set var="url">
+        <ww:url action="showArtifact" namespace="/">
+          <ww:param name="groupId" value="%{'${groupId}'}"/>
+          <ww:param name="artifactId" value="%{'${artifactId}'}"/>
+          <c:if test="${!empty(version)}">
+            <ww:param name="version" value="%{'${version}'}"/>
+          </c:if>
+        </ww:url>
+      </c:set>
+      <a href="${url}">${version}</a>
+    </c:when>
+    <c:otherwise>
+      <c:forEach items="${versions}" var="v" varStatus="i">
+        <c:set var="url">
+          <ww:url action="showArtifact" namespace="/">
+            <ww:param name="groupId" value="%{'${groupId}'}"/>
+            <ww:param name="artifactId" value="%{'${artifactId}'}"/>
+            <ww:param name="version" value="%{'${v}'}"/>
+          </ww:url>
+        </c:set>
+        <a href="${url}">${v}</a>
+        <c:if test="${!i.last}">,</c:if>
+      </c:forEach>
+    </c:otherwise>
+  </c:choose>
+  <c:if test="${!empty(scope)}">
+    | <strong>Scope:</strong> ${scope}
+  </c:if>
+  <c:if test="${!empty(classifier)}">
+    | <strong>Classifier:</strong> ${classifier}
+  </c:if>
+</span>