mirror of
https://github.com/apache/archiva.git
synced 2025-02-21 01:15:08 +00:00
[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:
parent
4aa6c9bab0
commit
6eab73646e
@ -130,7 +130,17 @@ 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
|
||||
@ -295,5 +305,5 @@ private ArchivaProjectModel getProjectModel( String groupId, String artifactId,
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -57,6 +57,8 @@ public class BrowseAction
|
||||
private String groupId;
|
||||
|
||||
private String artifactId;
|
||||
|
||||
private String repositoryId;
|
||||
|
||||
public String browse()
|
||||
{
|
||||
@ -168,4 +170,14 @@ public BrowsingResults getResults()
|
||||
{
|
||||
return results;
|
||||
}
|
||||
|
||||
public String getRepositoryId(){
|
||||
|
||||
return repositoryId;
|
||||
}
|
||||
|
||||
public void setRepositoryId(String repositoryId){
|
||||
|
||||
this.repositoryId = repositoryId;
|
||||
}
|
||||
}
|
||||
|
@ -38,9 +38,10 @@
|
||||
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 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;
|
||||
@ -171,12 +176,12 @@ public String dependencyTree()
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
private String getPrincipal()
|
||||
{
|
||||
return ArchivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() );
|
||||
}
|
||||
|
||||
|
||||
private List<String> getObservableRepos()
|
||||
{
|
||||
try
|
||||
@ -271,4 +276,15 @@ public List getDependees()
|
||||
{
|
||||
return dependees;
|
||||
}
|
||||
|
||||
public String getRepositoryId()
|
||||
{
|
||||
return repositoryId;
|
||||
}
|
||||
|
||||
public void setRepositoryId( String repositoryId )
|
||||
{
|
||||
this.repositoryId = repositoryId;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user