[MRM-144] clean up artifact links

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@451586 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2006-09-30 12:11:16 +00:00
parent 6bfba959b8
commit 6b21148ea3
4 changed files with 125 additions and 169 deletions

View 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">
@ -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)}">

View File

@ -18,7 +18,6 @@
<%@ 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"/>
@ -36,17 +35,8 @@
<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>
<my:showArtifactLink groupId="${node.artifact.groupId}" artifactId="${node.artifact.artifactId}"
version="${node.artifact.version}"/>
</li>
<c:set var="prevDepth" value="${node.depth}"/>
</c:forEach>

View 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>
@ -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>

View File

@ -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>