Author: brett
Date: Sat Sep 30 05:11:16 2006
New Revision: 451586

URL: http://svn.apache.org/viewvc?view=rev&rev=451586
Log:
[MRM-144] clean up artifact links

Added:
    
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag
Modified:
    
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactDependencies.jspf
    
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/dependencyTree.jspf
    
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp

Modified: 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactDependencies.jspf
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactDependencies.jspf?view=diff&rev=451586&r1=451585&r2=451586
==============================================================================
--- 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactDependencies.jspf
 (original)
+++ 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactDependencies.jspf
 Sat Sep 30 05:11:16 2006
@@ -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">
@@ -25,63 +26,10 @@
     <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)}">

Modified: 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/dependencyTree.jspf
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/dependencyTree.jspf?view=diff&rev=451586&r1=451585&r2=451586
==============================================================================
--- 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/dependencyTree.jspf
 (original)
+++ 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/dependencyTree.jspf
 Sat Sep 30 05:11:16 2006
@@ -18,37 +18,27 @@
 <%@ 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>
   

Modified: 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp?view=diff&rev=451586&r1=451585&r2=451586
==============================================================================
--- 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp
 (original)
+++ 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/reports.jsp
 Sat Sep 30 05:11:16 2006
@@ -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>
@@ -99,7 +101,6 @@
 </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>
@@ -116,41 +117,8 @@
       </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>
@@ -179,48 +147,8 @@
       </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>

Added: 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag
URL: 
http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag?view=auto&rev=451586
==============================================================================
--- 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag
 (added)
+++ 
maven/archiva/trunk/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag
 Sat Sep 30 05:11:16 2006
@@ -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>


Reply via email to