mirror of https://github.com/apache/archiva.git
browsing download artifacts content is now navigable
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1378030 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fc50439f7f
commit
7a447503fd
|
@ -393,6 +393,32 @@ function(jquery,ui,sammy,tmpl) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.get('#artifact-details-download-content/:groupId/:artifactId/:version',function(context){
|
||||||
|
|
||||||
|
var repositoryId = this.params.repositoryId;
|
||||||
|
var groupId= this.params.groupId;
|
||||||
|
var artifactId= this.params.artifactId;
|
||||||
|
var version= this.params.version;
|
||||||
|
|
||||||
|
checkArtifactDetailContent(groupId,artifactId,version,null,"artifact-details-download-content-a","artifact-details-download-content",
|
||||||
|
function(groupId,artifactId,version,artifactVersionDetailViewModel){
|
||||||
|
displayArtifactDownloadContent(artifactVersionDetailViewModel);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.get('#artifact-details-download-content~:repositoryId/:groupId/:artifactId/:version',function(context){
|
||||||
|
|
||||||
|
var repositoryId = this.params.repositoryId;
|
||||||
|
var groupId= this.params.groupId;
|
||||||
|
var artifactId= this.params.artifactId;
|
||||||
|
var version= this.params.version;
|
||||||
|
checkArtifactDetailContent(groupId,artifactId,version,repositoryId,"artifact-details-download-content-a","artifact-details-download-content",
|
||||||
|
function(groupId,artifactId,version,artifactVersionDetailViewModel){
|
||||||
|
displayArtifactDownloadContent(artifactVersionDetailViewModel);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
this.get('#artifact-dependency-tree/:groupId/:artifactId/:version',function(context){
|
this.get('#artifact-dependency-tree/:groupId/:artifactId/:version',function(context){
|
||||||
|
|
||||||
|
|
|
@ -329,19 +329,16 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(e.target).attr("href")=="#artifact-details-download-content") {
|
if ($(e.target).attr("href")=="#artifact-details-download-content") {
|
||||||
mainContent.find("#artifact-details-download-content" ).html(smallSpinnerImg());
|
var location ="#artifact-details-download-content";
|
||||||
var artifactDownloadInfosUrl = "restServices/archivaServices/browseService/artifactDownloadInfos/"+encodeURIComponent(self.groupId);
|
if (self.repositoryId){
|
||||||
artifactDownloadInfosUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(self.version);
|
location+="~"+self.repositoryId;
|
||||||
artifactDownloadInfosUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
}
|
||||||
$.get(artifactDownloadInfosUrl,function(data){
|
location+="/"+self.groupId+"/"+self.artifactId+"/"+self.version;
|
||||||
var artifactDetailsDownloadViewModel = new ArtifactDetailsDownloadViewModel(mapArtifacts(data),self);
|
|
||||||
mainContent.find("#artifact-details-download-content" ).attr("data-bind",'template:{name:"artifact-details-download-content_tmpl"}');
|
window.sammyArchivaApplication.setLocation(location);
|
||||||
ko.applyBindings(artifactDetailsDownloadViewModel,mainContent.find("#artifact-details-download-content" ).get(0));
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($(e.target).attr("href")=="#artifact-details-files-content") {
|
if ($(e.target).attr("href")=="#artifact-details-files-content") {
|
||||||
//displayArtifactFilesContent(self);
|
|
||||||
var location ="#artifact-details-files-content";
|
var location ="#artifact-details-files-content";
|
||||||
if (self.repositoryId){
|
if (self.repositoryId){
|
||||||
location+="~"+self.repositoryId;
|
location+="~"+self.repositoryId;
|
||||||
|
@ -520,11 +517,25 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
displayArtifactFilesContent=function(self){
|
displayArtifactDownloadContent=function(artifactVersionDetailViewModel){
|
||||||
|
var mainContent=$("#main-content");
|
||||||
|
mainContent.find("#artifact-details-download-content" ).html(smallSpinnerImg());
|
||||||
|
var artifactDownloadInfosUrl = "restServices/archivaServices/browseService/artifactDownloadInfos/"+encodeURIComponent(artifactVersionDetailViewModel.groupId);
|
||||||
|
artifactDownloadInfosUrl+="/"+encodeURIComponent(artifactVersionDetailViewModel.artifactId)+"/"+encodeURIComponent(artifactVersionDetailViewModel.version);
|
||||||
|
artifactDownloadInfosUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
||||||
|
$.get(artifactDownloadInfosUrl,function(data){
|
||||||
|
var artifactDetailsDownloadViewModel = new ArtifactDetailsDownloadViewModel(mapArtifacts(data),artifactVersionDetailViewModel);
|
||||||
|
mainContent.find("#artifact-details-download-content" ).attr("data-bind",'template:{name:"artifact-details-download-content_tmpl"}');
|
||||||
|
ko.applyBindings(artifactDetailsDownloadViewModel,mainContent.find("#artifact-details-download-content" ).get(0));
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
displayArtifactFilesContent=function(artifactVersionDetailViewModel){
|
||||||
var mainContent = $("#main-content");
|
var mainContent = $("#main-content");
|
||||||
mainContent.find("#artifact-details-files-content" ).html(smallSpinnerImg());
|
mainContent.find("#artifact-details-files-content" ).html(smallSpinnerImg());
|
||||||
var artifactDownloadInfosUrl = "restServices/archivaServices/browseService/artifactDownloadInfos/"+encodeURIComponent(self.groupId);
|
var artifactDownloadInfosUrl = "restServices/archivaServices/browseService/artifactDownloadInfos/"+encodeURIComponent(artifactVersionDetailViewModel.groupId);
|
||||||
artifactDownloadInfosUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(self.version);
|
artifactDownloadInfosUrl+="/"+encodeURIComponent(artifactVersionDetailViewModel.artifactId)+"/"+encodeURIComponent(artifactVersionDetailViewModel.version);
|
||||||
artifactDownloadInfosUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
artifactDownloadInfosUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
||||||
|
|
||||||
$.get(artifactDownloadInfosUrl,function(data){
|
$.get(artifactDownloadInfosUrl,function(data){
|
||||||
|
@ -542,8 +553,8 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
|
||||||
$.log("click:" + idValue + " -> " + classifier + ":" + type + ":" + version);
|
$.log("click:" + idValue + " -> " + classifier + ":" + type + ":" + version);
|
||||||
if (type=="pom"){
|
if (type=="pom"){
|
||||||
$.log("show pom");
|
$.log("show pom");
|
||||||
var pomContentUrl = "restServices/archivaServices/browseService/artifactContentText/"+encodeURIComponent(self.groupId);
|
var pomContentUrl = "restServices/archivaServices/browseService/artifactContentText/"+encodeURIComponent(artifactVersionDetailViewModel.groupId);
|
||||||
pomContentUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(version);
|
pomContentUrl+="/"+encodeURIComponent(artifactVersionDetailViewModel.artifactId)+"/"+encodeURIComponent(version);
|
||||||
pomContentUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
pomContentUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
||||||
pomContentUrl+="&t=pom";
|
pomContentUrl+="&t=pom";
|
||||||
mainContent.find("#artifact-content-text" ).html(smallSpinnerImg());
|
mainContent.find("#artifact-content-text" ).html(smallSpinnerImg());
|
||||||
|
@ -559,8 +570,8 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var entriesUrl = "restServices/archivaServices/browseService/artifactContentEntries/"+encodeURIComponent(self.groupId);
|
var entriesUrl = "restServices/archivaServices/browseService/artifactContentEntries/"+encodeURIComponent(artifactVersionDetailViewModel.groupId);
|
||||||
entriesUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(version);
|
entriesUrl+="/"+encodeURIComponent(artifactVersionDetailViewModel.artifactId)+"/"+encodeURIComponent(version);
|
||||||
entriesUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
entriesUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
||||||
if(classifier){
|
if(classifier){
|
||||||
entriesUrl+="&c="+encodeURIComponent(classifier);
|
entriesUrl+="&c="+encodeURIComponent(classifier);
|
||||||
|
@ -570,8 +581,8 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
|
||||||
root: ""
|
root: ""
|
||||||
},function(file) {
|
},function(file) {
|
||||||
$.log("file:"+file.substringBeforeLast("/")+',classifier:'+classifier);
|
$.log("file:"+file.substringBeforeLast("/")+',classifier:'+classifier);
|
||||||
var fileContentUrl = "restServices/archivaServices/browseService/artifactContentText/"+encodeURIComponent(self.groupId);
|
var fileContentUrl = "restServices/archivaServices/browseService/artifactContentText/"+encodeURIComponent(artifactVersionDetailViewModel.groupId);
|
||||||
fileContentUrl+="/"+encodeURIComponent(self.artifactId)+"/"+encodeURIComponent(version);
|
fileContentUrl+="/"+encodeURIComponent(artifactVersionDetailViewModel.artifactId)+"/"+encodeURIComponent(version);
|
||||||
fileContentUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
fileContentUrl+="?repositoryId="+encodeURIComponent(getSelectedBrowsingRepository());
|
||||||
if(type){
|
if(type){
|
||||||
fileContentUrl+="&t="+encodeURIComponent(type);
|
fileContentUrl+="&t="+encodeURIComponent(type);
|
||||||
|
|
Loading…
Reference in New Issue