return;
});
- this.get('#artifact:repositoryId/:groupId/:artifactId/:version',function(context){
+ this.get('#artifact/: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;
+ generalDisplayArtifactDetailsVersionView(groupId,artifactId,version,repositoryId);
- if(!version){
- displayBrowseArtifactDetail(splitted[0],splitted[1]);//,null,null);
- } else {
- generalDisplayArtifactDetailsVersionView(groupId,artifactId,version,repositoryId);
- }
});
this.get('#browse/:groupId',function(context){
var groupId = this.params.groupId;
artifactVersionDetailViewModel.display();
}
+ goToBrowseArtifactDetail=function(groupId, artifactId){
+ $.log("goToBrowseArtifactDetail:"+groupId+":"+artifactId);
+ displayBrowseGroupId(groupId,null,null);
+ displayArtifactDetail(groupId,artifactId,null,null);
+ }
+
+ /**
+ *
+ */
+ displayBrowseGroupId=function(groupId,repositoryId,artifactId){
+ clearUserMessages();
+ $.log("displayBrowseGroupId:"+groupId+":"+repositoryId);
+ userRepositoriesCall(
+ function(data){
+ var mainContent = $("#main-content");
+ mainContent.html($("#browse-tmpl" ).tmpl());
+ mainContent.find("#browse_result").html(mediumSpinnerImg());
+ var parentBrowseViewModel=new BrowseViewModel(null,null,null,repositoryId);
+ var url="restServices/archivaServices/browseService/browseGroupId/"+encodeURIComponent(groupId);
+ if (repositoryId){
+ url+="?repositoryId="+repositoryId;
+ mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:repositoryId}));
+ }else{
+ mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:""}));
+ }
+ displayGroupDetail(groupId,parentBrowseViewModel,url,repositoryId);
+ }
+ );
+
+ }
+
/**
*
* @param groupId
* @param restUrl
*/
displayArtifactDetail=function(groupId,artifactId,parentBrowseViewModel,restUrl){
+ $.log("displayArtifactDetail:"+groupId+":"+artifactId);
var artifactDetailViewModel=new ArtifactDetailViewModel(groupId,artifactId);
var mainContent = $("#main-content");
mainContent.find("#browse_artifact_detail" ).hide();
var artifactId=values[values.length-1];
displayArtifactDetail(groupId,artifactId,self);
} else {
- displayBrowseGroupIdFromAutoComplete(ui.item.name);
+ var selectedRepo=getSelectedBrowsingRepository();
+ var location ="#browse";
+ if (selectedRepo){
+ location+="~"+selectedRepo;
+ }
+ location+="/"+ui.item.name;
+ window.sammyArchivaApplication.setLocation(location);
+ //displayBrowseGroupIdFromAutoComplete(ui.item.name);
}
return false;
}
displayGroupDetail(groupId,parentBrowseViewModel,null);
}
- /**
- * called if browser url contains queryParam browse=groupId
- * @param groupId
- */
- displayBrowseGroupId=function(groupId,repositoryId){
- clearUserMessages();
- $.log("displayBrowseGroupId:"+groupId+":"+repositoryId);
- userRepositoriesCall(
- function(data){
- var mainContent = $("#main-content");
- mainContent.html($("#browse-tmpl" ).tmpl());
- mainContent.find("#browse_result").html(mediumSpinnerImg());
- var parentBrowseViewModel=new BrowseViewModel(null,null,null,repositoryId);
- var url="restServices/archivaServices/browseService/browseGroupId/"+encodeURIComponent(groupId);
- if (repositoryId){
- url+="?repositoryId="+repositoryId;
- mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:repositoryId}));
- }else{
- mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:""}));
- }
- displayGroupDetail(groupId,parentBrowseViewModel,url,repositoryId);
- }
- );
-
- }
-
displayBrowseArtifactDetail=function(groupId, artifactId){
$.log("displayBrowseArtifactDetail");
window.sammyArchivaApplication.setLocation("#artifact/"+groupId+"/"+artifactId);
}
- goToBrowseArtifactDetail=function(groupId, artifactId){
- $.log("displayBrowseArtifactDetail");
- displayBrowseGroupId(groupId);
- displayArtifactDetail(groupId,artifactId,null,null);
- }
-
mapBrowseResultEntries=function(data){
$.log("mapBrowseResultEntries");
if (data.browseResultEntries) {