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
throw e;
}
}
-
+
}
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;
}
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
* @plexus.requirement role-hint="default"
*/
private RepositoryBrowsing repoBrowsing;
-
+
/**
* @plexus.requirement
*/
private UserRepositories userRepositories;
-
+
/* .\ Input Parameters \.________________________________________ */
private String groupId;
private String version;
+ private String repositoryId;
+
/* .\ Exposed Output Objects \.__________________________________ */
/**
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 )
{
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;
return SUCCESS;
}
-
+
private String getPrincipal()
{
return ArchivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() );
}
-
+
private List<String> getObservableRepos()
{
try
{
return dependees;
}
+
+ public String getRepositoryId()
+ {
+ return repositoryId;
+ }
+
+ public void setRepositoryId( String repositoryId )
+ {
+ this.repositoryId = repositoryId;
+ }
+
}