mirror of
https://github.com/apache/archiva.git
synced 2025-03-06 00:19:27 +00:00
[MRM-591]
-group defective artifacts by repository in the report git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@641103 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
10fc8cb69a
commit
ec197361ac
@ -45,6 +45,7 @@ public RepositoryProblemReport( RepositoryProblem repositoryProblem )
|
||||
setOrigin( repositoryProblem.getOrigin() );
|
||||
setPath( repositoryProblem.getPath() );
|
||||
setType( repositoryProblem.getType() );
|
||||
setRepositoryId( repositoryProblem.getRepositoryId() );
|
||||
}
|
||||
|
||||
public void setGroupURL( String groupURL )
|
||||
|
@ -28,19 +28,29 @@ public class RangeConstraint
|
||||
extends AbstractDeclarativeConstraint
|
||||
implements Constraint
|
||||
{
|
||||
private String sortColumn;
|
||||
|
||||
public RangeConstraint()
|
||||
{
|
||||
this.range = null;
|
||||
this.sortColumn = null;
|
||||
}
|
||||
|
||||
|
||||
public RangeConstraint( int[] range )
|
||||
{
|
||||
this.range = range;
|
||||
this.sortColumn = null;
|
||||
}
|
||||
|
||||
public RangeConstraint( int[] range, String sortColumn )
|
||||
{
|
||||
this.range = range;
|
||||
this.sortColumn = sortColumn;
|
||||
}
|
||||
|
||||
public String getSortColumn()
|
||||
{
|
||||
return null;
|
||||
return sortColumn;
|
||||
}
|
||||
|
||||
public String getWhereCondition()
|
||||
|
@ -51,11 +51,11 @@ public RepositoryProblemByGroupIdConstraint( int[] range, String desiredGroupId
|
||||
|
||||
public String getSortColumn()
|
||||
{
|
||||
return "artifactId";
|
||||
return "repositoryId";
|
||||
}
|
||||
|
||||
public String getWhereCondition()
|
||||
{
|
||||
return whereClause;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,8 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* @plexus.component role="com.opensymphony.xwork.Action" role-hint="generateReport"
|
||||
@ -85,6 +87,9 @@ public class GenerateReportAction
|
||||
private Collection<String> repositoryIds;
|
||||
|
||||
public static final String ALL_REPOSITORIES = "All Repositories";
|
||||
|
||||
protected Map<String, List<RepositoryProblemReport>> repositoriesMap =
|
||||
new TreeMap<String, List<RepositoryProblemReport>>();
|
||||
|
||||
public void prepare()
|
||||
{
|
||||
@ -118,9 +123,12 @@ public String execute()
|
||||
problemArtifactReport.setArtifactURL(
|
||||
contextPath + "/browse/" + problemArtifact.getGroupId() + "/" + problemArtifact.getArtifactId() );
|
||||
|
||||
addToList( problemArtifactReport );
|
||||
|
||||
// retained the reports list because this is the datasource for the jasper report
|
||||
reports.add( problemArtifactReport );
|
||||
}
|
||||
|
||||
|
||||
if ( reports.size() <= rowCount )
|
||||
{
|
||||
isLastPage = true;
|
||||
@ -194,7 +202,7 @@ else if ( repositoryId != null && ( !repositoryId.equals( "" ) && !repositoryId.
|
||||
}
|
||||
else
|
||||
{
|
||||
constraint = new RangeConstraint( range );
|
||||
constraint = new RangeConstraint( range, "repositoryId" );
|
||||
}
|
||||
|
||||
return constraint;
|
||||
@ -265,6 +273,16 @@ public boolean getIsLastPage()
|
||||
return isLastPage;
|
||||
}
|
||||
|
||||
public void setRepositoriesMap( Map<String, List<RepositoryProblemReport>> repositoriesMap )
|
||||
{
|
||||
this.repositoriesMap = repositoriesMap;
|
||||
}
|
||||
|
||||
public Map<String, List<RepositoryProblemReport>> getRepositoriesMap()
|
||||
{
|
||||
return repositoriesMap;
|
||||
}
|
||||
|
||||
public SecureActionBundle getSecureActionBundle()
|
||||
throws SecureActionException
|
||||
{
|
||||
@ -275,4 +293,21 @@ public SecureActionBundle getSecureActionBundle()
|
||||
|
||||
return bundle;
|
||||
}
|
||||
|
||||
private void addToList( RepositoryProblemReport repoProblemReport )
|
||||
{
|
||||
List<RepositoryProblemReport> problemsList = null;
|
||||
|
||||
if ( repositoriesMap.containsKey( repoProblemReport.getRepositoryId() ) )
|
||||
{
|
||||
problemsList = ( List<RepositoryProblemReport> ) repositoriesMap.get( repoProblemReport.getRepositoryId() );
|
||||
}
|
||||
else
|
||||
{
|
||||
problemsList = new ArrayList<RepositoryProblemReport>();
|
||||
repositoriesMap.put( repoProblemReport.getRepositoryId(), problemsList );
|
||||
}
|
||||
|
||||
problemsList.add( repoProblemReport );
|
||||
}
|
||||
}
|
||||
|
@ -32,23 +32,26 @@
|
||||
|
||||
<div id="contentArea">
|
||||
|
||||
<ww:set name="reports" value="reports"/>
|
||||
<c:forEach items="${reports}" var="report">
|
||||
|
||||
<p>
|
||||
<archiva:groupIdLink var="${report.groupId}" includeTop="true"/>
|
||||
|
||||
<c:set var="url">
|
||||
<ww:set name="reports" value="reports"/>
|
||||
|
||||
<c:forEach var="repository" items="${repositoriesMap}">
|
||||
<strong>Repository: ${repository.key}</strong>
|
||||
<c:forEach var="report" items='${repository.value}'>
|
||||
|
||||
<p>
|
||||
<archiva:groupIdLink var="${report.groupId}" includeTop="true"/>
|
||||
<c:set var="url">
|
||||
<ww:url action="browseArtifact" namespace="/">
|
||||
<ww:param name="groupId" value="%{'${report.groupId}'}"/>
|
||||
<ww:param name="artifactId" value="%{'${report.artifactId}'}"/>
|
||||
</ww:url>
|
||||
</c:set>
|
||||
<a href="${url}">${report.artifactId}</a> /
|
||||
<strong>${report.version}</strong>
|
||||
</p>
|
||||
|
||||
<blockquote>${report.message}</blockquote>
|
||||
</c:set>
|
||||
<a href="${url}">${report.artifactId}</a> /
|
||||
<strong>${report.version}</strong>
|
||||
</p>
|
||||
|
||||
<blockquote>${report.message}</blockquote>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
|
||||
<ww:set name="page" value="page"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user