[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
This commit is contained in:
Maria Odea B. Ching 2008-07-25 11:57:38 +00:00
parent 4aa6c9bab0
commit 6eab73646e
5 changed files with 59 additions and 12 deletions

View File

@ -131,6 +131,16 @@ public ArchivaProjectModel selectVersion( String principle, List<String> observa
return model;
}
public String getRepositoryId( String principle, List<String> observableRepositoryIds, String groupId,
String artifactId, String version )
throws ObjectNotFoundException, ArchivaDatabaseException
{
ArchivaArtifact pomArchivaArtifact =
getArtifact( principle, observableRepositoryIds, groupId, artifactId, version );
return pomArchivaArtifact.getModel().getRepositoryId();
}
private ArchivaArtifact getArtifact( String principle, List<String> observableRepositoryIds, String groupId,
String artifactId, String version )
throws ObjectNotFoundException, ArchivaDatabaseException

View File

@ -85,4 +85,9 @@ public ArchivaProjectModel selectVersion( String principle, List<String> observa
public List<ArchivaProjectModel> getUsedBy( String principle, List<String> observableRepositoryIds, String groupId,
String artifactId, String version )
throws ArchivaDatabaseException;
public String getRepositoryId( String principle, List<String> observableRepositoryIds, String groupId,
String artifactId, String version )
throws ObjectNotFoundException, ArchivaDatabaseException;
}

View File

@ -58,6 +58,8 @@ public class BrowseAction
private String artifactId;
private String repositoryId;
public String browse()
{
List<String> selectedRepos = getObservableRepos();
@ -168,4 +170,14 @@ public BrowsingResults getResults()
{
return results;
}
public String getRepositoryId(){
return repositoryId;
}
public void setRepositoryId(String repositoryId){
this.repositoryId = repositoryId;
}
}

View File

@ -41,6 +41,7 @@
* 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
@ -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 String reports()
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;
@ -271,4 +276,15 @@ public List getDependees()
{
return dependees;
}
public String getRepositoryId()
{
return repositoryId;
}
public void setRepositoryId( String repositoryId )
{
this.repositoryId = repositoryId;
}
}

View File

@ -44,6 +44,10 @@
</c:if>
<table class="infoTable">
<tr>
<th>Repository</th>
<td>${repositoryId}</td>
</tr>
<tr>
<th>Group ID</th>
<td>${model.groupId}</td>