diff options
author | Olivier Lamy <olamy@apache.org> | 2012-05-28 22:52:58 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-05-28 22:52:58 +0000 |
commit | 994e72b0185eb78a85051b6441453566b2537b83 (patch) | |
tree | 997b3d222f55923cee8d79b6d4b263b274cc9eaf /archiva-modules/archiva-web | |
parent | 823b816f5283e5490b38daa3a8387a72df74e6e6 (diff) | |
download | archiva-994e72b0185eb78a85051b6441453566b2537b83.tar.gz archiva-994e72b0185eb78a85051b6441453566b2537b83.zip |
artifact content view: display snapshot versions
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1343416 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web')
5 files changed, 18 insertions, 13 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java index fb590de9e..4954ee336 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultFileUploadService.java @@ -372,7 +372,7 @@ public class DefaultFileUploadService String filename = artifactPath.substring( lastIndex + 1 ); if ( VersionUtil.isSnapshot( version ) ) { - filename = filename.replaceAll( "SNAPSHOT", timestamp + "-" + newBuildNumber ); + filename = filename.replaceAll( VersionUtil.SNAPSHOT, timestamp + "-" + newBuildNumber ); } boolean fixChecksums = diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js index c38ce483f..b2ca397ca 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js @@ -281,13 +281,17 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock mainContent.find("#artifact_content_tree").html(""); mainContent.find("#artifact-content-text" ).html(""); var idValue = $(this ).attr("id"); - var classifier=idValue.substringBeforeLast(":"); - var type = idValue.substringAfterLast(":"); - $.log("click:" + idValue + " -> " + classifier + ":" + type ); + var splitted = idValue.split(":"); + + var classifier=splitted[0];//idValue.substringBeforeLast(":"); + var version=splitted[1]; + var type = splitted[2]; + + $.log("click:" + idValue + " -> " + classifier + ":" + type + ":" + version); if (type=="pom"){ $.log("show pom"); var pomContentUrl = "restServices/archivaServices/browseService/artifactContentText/"+encodeURIComponent(self.groupId); - pomContentUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(self.version); + pomContentUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(version); pomContentUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository()); pomContentUrl+="&t=pom"; mainContent.find("#artifact-content-text" ).html(smallSpinnerImg()); @@ -304,7 +308,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock return; } var entriesUrl = "restServices/archivaServices/browseService/artifactContentEntries/"+encodeURIComponent(self.groupId); - entriesUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(self.version); + entriesUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(version); entriesUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository()); if(classifier){ entriesUrl+="&c="+encodeURIComponent(classifier); @@ -315,7 +319,7 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock },function(file) { $.log("file:"+file.substringBeforeLast("/")+',classifier:'+classifier); var fileContentUrl = "restServices/archivaServices/browseService/artifactContentText/"+encodeURIComponent(self.groupId); - fileContentUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(self.version); + fileContentUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(version); fileContentUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository()); if(type){ fileContentUrl+="&t="+encodeURIComponent(type); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html index 8af92748d..41e6fff19 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html @@ -811,8 +811,8 @@ <div class="span4"> <ul id="artifact-content-list-files"> {{each artifactDownloadInfos}} - <li id="${$value.classifier}:${$value.type}"> - <a href="#">${$value.type}</a> + <li id="${$value.classifier}:${$value.version}:${$value.type}"> + <a href="#">${$value.type}:${$value.version}</a> </li> {{/each}} </ul> diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/MergeAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/MergeAction.java index 6f43b8a70..201c1cbbe 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/MergeAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/MergeAction.java @@ -26,15 +26,16 @@ import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin; import org.apache.archiva.audit.AuditEvent; import org.apache.archiva.audit.Auditable; +import org.apache.archiva.common.utils.VersionUtil; import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.metadata.repository.filter.Filter; import org.apache.archiva.metadata.repository.filter.IncludesFilter; +import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; import org.apache.archiva.scheduler.repository.RepositoryTask; import org.apache.archiva.stagerepository.merge.Maven2RepositoryMerger; -import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; @@ -296,7 +297,7 @@ public class MergeAction for ( ArtifactMetadata metadata : sourceArtifacts ) { - if ( metadata.getProjectVersion().contains( "SNAPSHOT" ) ) + if ( metadata.getProjectVersion().contains( VersionUtil.SNAPSHOT ) ) { artifactsWithOutSnapshots.add( metadata ); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/UploadAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/UploadAction.java index 3e83626f9..421f8ba1a 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/UploadAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/archiva/web/action/UploadAction.java @@ -35,6 +35,7 @@ import org.apache.archiva.maven2.metadata.MavenMetadataReader; import org.apache.archiva.model.ArchivaRepositoryMetadata; import org.apache.archiva.model.ArtifactReference; import org.apache.archiva.model.SnapshotVersion; +import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.RepositoryContentFactory; import org.apache.archiva.repository.RepositoryException; @@ -54,7 +55,6 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Writer; -import org.apache.archiva.redback.components.taskqueue.TaskQueueException; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; @@ -343,7 +343,7 @@ public class UploadAction String filename = artifactPath.substring( lastIndex + 1 ); if ( VersionUtil.isSnapshot( version ) ) { - filename = filename.replaceAll( "SNAPSHOT", timestamp + "-" + newBuildNumber ); + filename = filename.replaceAll( VersionUtil.SNAPSHOT, timestamp + "-" + newBuildNumber ); } boolean fixChecksums = |