mirror of https://github.com/apache/archiva.git
fix download link in jsp webapp
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1349787 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0db6c1faa2
commit
235030c2bd
|
@ -140,6 +140,17 @@ public class Artifact
|
|||
*/
|
||||
private String size;
|
||||
|
||||
/**
|
||||
* @since 1.4-M3
|
||||
*/
|
||||
private String type;
|
||||
|
||||
|
||||
/**
|
||||
* @since 1.4-M3
|
||||
*/
|
||||
private String path;
|
||||
|
||||
|
||||
public Artifact()
|
||||
{
|
||||
|
@ -374,6 +385,26 @@ public class Artifact
|
|||
this.size = size;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType( String type )
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getPath()
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath( String path )
|
||||
{
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
@ -400,6 +431,9 @@ public class Artifact
|
|||
sb.append( ", classifier='" ).append( classifier ).append( '\'' );
|
||||
sb.append( ", packaging='" ).append( packaging ).append( '\'' );
|
||||
sb.append( ", fileExtension='" ).append( fileExtension ).append( '\'' );
|
||||
sb.append( ", size='" ).append( size ).append( '\'' );
|
||||
sb.append( ", type='" ).append( type ).append( '\'' );
|
||||
sb.append( ", path='" ).append( path ).append( '\'' );
|
||||
sb.append( '}' );
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public class ArtifactDownloadInfoBuilder
|
|||
public Artifact build()
|
||||
{
|
||||
ArtifactReference ref = new ArtifactReference();
|
||||
ref.setArtifactId( artifactMetadata.getId() );
|
||||
ref.setArtifactId( artifactMetadata.getProject() );
|
||||
ref.setGroupId( artifactMetadata.getNamespace() );
|
||||
ref.setVersion( artifactMetadata.getVersion() );
|
||||
|
||||
|
@ -85,7 +85,9 @@ public class ArtifactDownloadInfoBuilder
|
|||
artifact.setRepositoryId( artifactMetadata.getRepositoryId() );
|
||||
artifact.setClassifier( classifier );
|
||||
artifact.setPackaging( type );
|
||||
artifact.setType( type );
|
||||
artifact.setFileExtension( extension );
|
||||
artifact.setPath( managedRepositoryContent.toPath( ref ) );
|
||||
// TODO: find a reusable formatter for this
|
||||
double s = this.artifactMetadata.getSize();
|
||||
String symbol = "b";
|
||||
|
|
|
@ -218,6 +218,7 @@ public class ShowArtifactAction
|
|||
l = new ArrayList<Artifact>();
|
||||
this.artifacts.put( artifact.getVersion(), l );
|
||||
}
|
||||
|
||||
ArtifactDownloadInfoBuilder builder = new ArtifactDownloadInfoBuilder().forArtifactMetadata(
|
||||
artifact ).withManagedRepositoryContent(
|
||||
repositoryFactory.getManagedRepositoryContent( repositoryId ) );
|
||||
|
|
|
@ -171,11 +171,11 @@
|
|||
<c:set var="packageName">POM</c:set>
|
||||
</c:when>
|
||||
<%-- These types aren't usually set in the POM yet, so we fudge them for the well known ones --%>
|
||||
<c:when test="${a.type == 'maven-archetype' or a.namespace == 'org.apache.maven.archetypes'}">
|
||||
<c:when test="${a.type == 'maven-archetype' or a.groupId == 'org.apache.maven.archetypes'}">
|
||||
<c:url var="imageUrl" value="/images/download-type-archetype.png"/>
|
||||
<c:set var="packageName">Maven Archetype</c:set>
|
||||
</c:when>
|
||||
<c:when test="${a.type == 'maven-skin' or a.namespace == 'org.apache.maven.skins'}">
|
||||
<c:when test="${a.type == 'maven-skin' or a.groupId == 'org.apache.maven.skins'}">
|
||||
<c:url var="imageUrl" value="/images/download-type-skin.png"/>
|
||||
<c:set var="packageName">Maven Skin</c:set>
|
||||
</c:when>
|
||||
|
@ -209,8 +209,10 @@
|
|||
</c:choose>
|
||||
<c:url var="url" value="/repository/${a.repositoryId}/${a.path}" />
|
||||
<tr>
|
||||
<td><a href="${url}" title="Download ${a.id}"><img src="${imageUrl}" alt="" width="24" height="24"/></a></td>
|
||||
<td class="type"><a href="${url}" title="Download ${a.id}">${packageName}</a></td>
|
||||
<td>
|
||||
<a href="${url}" title="Download ${a.artifactId}"><img src="${imageUrl}" alt="" width="24" height="24"/></a>
|
||||
</td>
|
||||
<td class="type"><a href="${url}" title="Download ${a.artifactId}">${packageName}</a></td>
|
||||
<td class="size">${a.size}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
|
Loading…
Reference in New Issue