From 6eab73646ed19f23324d3c995f28542e0729c946 Mon Sep 17 00:00:00 2001 From: "Maria Odea B. Ching" Date: Fri, 25 Jul 2008 11:57:38 +0000 Subject: [MRM-817] submitted by Gwen Harold Autencio -in the artifact information tab, display the repo id where the artifact came from git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@679767 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/archiva/web/action/BrowseAction.java | 12 +++++++ .../archiva/web/action/ShowArtifactAction.java | 38 +++++++++++++++------- .../webapp/WEB-INF/jsp/include/artifactInfo.jspf | 4 +++ 3 files changed, 43 insertions(+), 11 deletions(-) (limited to 'archiva-modules/archiva-web/archiva-webapp') diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java index fc0f4757d..7dee82270 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java @@ -57,6 +57,8 @@ public class BrowseAction private String groupId; private String artifactId; + + private String repositoryId; public String browse() { @@ -168,4 +170,14 @@ public class BrowseAction { return results; } + + public String getRepositoryId(){ + + return repositoryId; + } + + public void setRepositoryId(String repositoryId){ + + this.repositoryId = repositoryId; + } } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java index 286d32561..97dca610e 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java @@ -38,9 +38,10 @@ import com.opensymphony.xwork.ActionContext; import com.opensymphony.xwork.Validateable; /** - * Browse the repository. - * + * Browse the repository. + * * TODO change name to ShowVersionedAction to conform to terminology. + * * @plexus.component role="com.opensymphony.xwork.Action" role-hint="showArtifactAction" */ public class ShowArtifactAction @@ -53,12 +54,12 @@ public class ShowArtifactAction * @plexus.requirement role-hint="default" */ private RepositoryBrowsing repoBrowsing; - + /** * @plexus.requirement */ private UserRepositories userRepositories; - + /* .\ Input Parameters \.________________________________________ */ private String groupId; @@ -67,6 +68,8 @@ public class ShowArtifactAction private String version; + private String repositoryId; + /* .\ Exposed Output Objects \.__________________________________ */ /** @@ -89,16 +92,17 @@ public class ShowArtifactAction private List dependencies; /** - * Show the versioned project information tab. - * - * TODO: Change name to 'project' + * Show the versioned project information tab. TODO: Change name to 'project' */ public String artifact() throws ObjectNotFoundException, ArchivaDatabaseException { try { - this.model = repoBrowsing.selectVersion( getPrincipal(), getObservableRepos(), groupId, artifactId, version ); + this.model = + repoBrowsing.selectVersion( getPrincipal(), getObservableRepos(), groupId, artifactId, version ); + this.repositoryId = + repoBrowsing.getRepositoryId( getPrincipal(), getObservableRepos(), groupId, artifactId, version ); } catch ( ObjectNotFoundException oe ) { @@ -142,7 +146,8 @@ public class ShowArtifactAction throws ObjectNotFoundException, ArchivaDatabaseException { System.out.println( "#### In reports." ); - // TODO: hook up reports on project - this.reports = artifactsDatabase.findArtifactResults( groupId, artifactId, version ); + // TODO: hook up reports on project - this.reports = artifactsDatabase.findArtifactResults( groupId, artifactId, + // version ); System.out.println( "#### Found " + reports.size() + " reports." ); return SUCCESS; @@ -171,12 +176,12 @@ public class ShowArtifactAction return SUCCESS; } - + private String getPrincipal() { return ArchivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() ); } - + private List getObservableRepos() { try @@ -271,4 +276,15 @@ public class ShowArtifactAction { return dependees; } + + public String getRepositoryId() + { + return repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } + } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf index 124968aa5..c440fea84 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf @@ -44,6 +44,10 @@ + + + + -- cgit v1.2.3
Repository${repositoryId}
Group ID ${model.groupId}