diff options
author | Joakim Erdfelt <joakime@apache.org> | 2006-10-26 22:04:46 +0000 |
---|---|---|
committer | Joakim Erdfelt <joakime@apache.org> | 2006-10-26 22:04:46 +0000 |
commit | 188548089d47c4d3cad9025a46046f79b7023443 (patch) | |
tree | c0353bb6affb45d8a8cc1ff3ac9be4a29e908634 /archiva-webapp | |
parent | 90da8e7205a0eb4f4f570473a68926107a7d192c (diff) | |
download | archiva-188548089d47c4d3cad9025a46046f79b7023443.tar.gz archiva-188548089d47c4d3cad9025a46046f79b7023443.zip |
* Adding distinction between repo.id and repo.urlName.
* Adding copy-paste block for repositories.
* Adding copy-paste block for dependency.
* Adding webdav url link in repository config.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@468167 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-webapp')
6 files changed, 70 insertions, 8 deletions
diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccess.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccess.java index 3970478f0..3ae46df9c 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccess.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccess.java @@ -88,7 +88,7 @@ public class RepositoryAccess public class RequestPath { - String repoId; + String repoName; String path; } @@ -125,11 +125,11 @@ public class RepositoryAccess return; } - RepositoryConfiguration repoconfig = config.getRepositoryById( reqpath.repoId ); + RepositoryConfiguration repoconfig = config.getRepositoryByUrlName( reqpath.repoName ); if ( repoconfig == null ) { - routeToErrorPage( response, "Invalid Repository ID." ); + routeToErrorPage( response, "Invalid Repository URL." ); return; } @@ -247,7 +247,7 @@ public class RepositoryAccess // Find the first 'path' of the pathInfo. // Default: "/pathid" -> "pathid" - ret.repoId = requestPathInfo.substring( 1 ); + ret.repoName = requestPathInfo.substring( 1 ); ret.path = "/"; // Find first element, if slash exists. @@ -255,7 +255,7 @@ public class RepositoryAccess if ( slash > 0 ) { // Filtered: "/central/org/apache/maven/" -> "central" - ret.repoId = requestPathInfo.substring( 1, slash ); + ret.repoName = requestPathInfo.substring( 1, slash ); String repoPath = requestPathInfo.substring( slash ); diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf b/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf index 3bcf34061..220257acf 100644 --- a/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/managedRepositoryForm.jspf @@ -16,6 +16,7 @@ <%@ taglib prefix="ww" uri="/webwork" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<ww:textfield name="urlName" label="URL Name" size="50" required="true"/> <ww:textfield name="name" label="Name" size="50" required="true" /> <ww:textfield name="directory" label="Directory" size="100" required="true"/> <ww:select list="#@java.util.LinkedHashMap@{'default' : 'Maven 2.x Repository', 'legacy' : 'Maven 1.x Repository'}" diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/index.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/index.jsp index 3e82d910a..b9fe197be 100644 --- a/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/index.jsp +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/index.jsp @@ -79,6 +79,8 @@ </table> </c:if> +<c:set var="urlbase">${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}/repository/</c:set> + <div> <div style="float: right"> <%-- TODO replace with icons --%> @@ -120,6 +122,10 @@ <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> @@ -135,11 +141,42 @@ </tr> <tr> <th>Snapshots Included</th> - <td class="${repository.includeSnapshots ? 'doneMark' : 'errorMark'}"></td> + <td class="${repository.includeSnapshots ? 'doneMark' : 'errorMark'} booleanIcon"> ${repository.includeSnapshots}</td> </tr> <tr> <th>Indexed</th> - <td class="${repository.indexed ? 'doneMark' : 'errorMark'}"></td> + <td class="${repository.indexed ? 'doneMark' : 'errorMark'} booleanIcon"> ${repository.indexed}</td> + </tr> + <tr> + <th>POM Snippet</th> + <td> +<pre class="pom"> +<project> + ... + <distributionManagement> + <${repository.includeSnapshots ? 'snapshotRepository' : 'repository'}> + <id>${repository.id}</id> + <url>dav:${urlbase}${repository.urlName}</url> + </${repository.includeSnapshots ? 'snapshotRepository' : 'repository'}> + </distributionManagement> + + <repositories> + <repository> + <id>${repository.id}</id> + <name>${repository.name}</name> + <url>${urlbase}${repository.urlName}</url> + <releases> + <enabled>${repository.includeSnapshots ? 'false' : 'true'}</enabled> + </releases> + <snapshots> + <enabled>${repository.includeSnapshots ? 'true' : 'false'}</enabled> + </snapshots> + </repository> + </repositories> + ... +</project> +</pre> + </td> </tr> </table> </div> diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf b/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf index d2ce2cad1..fe3af8982 100644 --- a/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf @@ -99,6 +99,18 @@ --%> </table> +<c:if test="${model.packaging != 'pom'}"> +<h2>POM Dependency Snippet</h2> +<pre class="pom"> + <dependency> + <groupId>${model.groupId}</groupId> + <artifactId>${model.artifactId}</artifactId> + <version>${model.version}</version><c:if test="${model.packaging != 'jar'}"> + <type>${model.packaging}</type></c:if> + </dependency> +</pre> +</c:if> + <c:if test="${!empty(model.url) || model.organization != null || !empty(model.licenses) || model.issueManagement != null || model.ciManagement != null}"> diff --git a/archiva-webapp/src/main/webapp/css/maven-theme.css b/archiva-webapp/src/main/webapp/css/maven-theme.css index 8f1d8fc4b..6823a115a 100644 --- a/archiva-webapp/src/main/webapp/css/maven-theme.css +++ b/archiva-webapp/src/main/webapp/css/maven-theme.css @@ -170,6 +170,18 @@ dt { background-image: url( ../images/icon_info_sml.gif ); } +.booleanIcon { + padding-left: 20px; + height: 20px; +} + +pre.pom { + font-size: 0.9em; + border: 1px solid #ddddff; + background-color: #f8f8ff; + padding: 5px; +} + #leftColumn { padding: 4px 4px 4px 4px; overflow: hidden; diff --git a/archiva-webapp/src/test/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccessTest.java b/archiva-webapp/src/test/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccessTest.java index 124bca8df..a9b73fda0 100644 --- a/archiva-webapp/src/test/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccessTest.java +++ b/archiva-webapp/src/test/java/org/apache/maven/archiva/web/servlet/repository/RepositoryAccessTest.java @@ -44,7 +44,7 @@ public class RepositoryAccessTest assertNotNull( requestPath ); - assertEquals( expectedId, requestPath.repoId ); + assertEquals( expectedId, requestPath.repoName ); assertEquals( expectedPath, requestPath.path ); } |