// format groupId:artifactId org.apache.maven.plugins:maven-jar-plugin
// or groupId:artifactId:version org.apache.maven.plugins:maven-jar-plugin:2.3.1
this.get('#artifact/:groupId/:artifactId',function(context){
- var groupId= this.params['groupId'];
- var artifactId= this.params['artifactId'];
+ var groupId= this.params.groupId;
+ var artifactId= this.params.artifactId;
$.log("get #artifact:"+groupId+":"+artifactId);
goToBrowseArtifactDetail(groupId,artifactId);//,null,null);
return;
});
this.get('#artifact: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'];
+ var repositoryId = this.params.repositoryId;
+ var groupId= this.params.groupId;
+ var artifactId= this.params.artifactId;
+ var version= this.params.version;
if(!version){
displayBrowseArtifactDetail(splitted[0],splitted[1]);//,null,null);
}
});
this.get('#browse/:groupId',function(context){
- var groupId = this.params['groupId'];
+ var groupId = this.params.groupId;
if (groupId){
displayBrowseGroupId(groupId);
} else {
displayBrowse(true);
}
});
+ this.get('#browse~:repositoryId/:groupId',function(context){
+ var groupId = this.params.groupId;
+ var repositoryId = this.params.repositoryId;
+ $.log("repositoryId:"+repositoryId);
+ if (groupId){
+ displayBrowseGroupId(groupId);
+ } else {
+ displayBrowse(true);
+ }
+ });
+ this.get('#browse~:repositoryId',function(context){
+ var repositoryId = this.params.repositoryId;
+ $.log("repositoryId:"+repositoryId);
+ displayBrowse(true,repositoryId);
+ });
this.get('#:folder', function () {
var folder = this.params.folder;
self.activeMenuId(folder);
}
browseRoot=function(){
- /*var url="restServices/archivaServices/browseService/rootGroups";
var selectedRepo=getSelectedBrowsingRepository();
- if (selectedRepo){
- url+="?repositoryId="+encodeURIComponent(selectedRepo);
+
+ if(selectedRepo) {
+ window.sammyArchivaApplication.setLocation("#browse~"+selectedRepo);
+ } else {
+ window.sammyArchivaApplication.setLocation("#browse");
}
- displayGroupDetail(null,null,url);*/
- window.sammyArchivaApplication.setLocation("#browse");
}
/**
* call from menu entry to display root level
+ * @param freshView redisplay everything
+ * @param repositoryId if any repository selected
*/
- displayBrowse=function(freshView){
+ displayBrowse=function(freshView,repositoryId){
screenChange();
var mainContent = $("#main-content");
if(freshView){
type: "GET",
dataType: 'json',
success: function(data) {
- mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:""}));
- var url="restServices/archivaServices/browseService/rootGroups"
+ mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:repositoryId}));
+ var url="restServices/archivaServices/browseService/rootGroups";
+ if(repositoryId){
+ url+="?repositoryId="+repositoryId;
+ }
$.ajax(url, {
type: "GET",
dataType: 'json',
changeBrowseRepository=function(){
var selectedRepository=getSelectedBrowsingRepository();
- $.log("changeBrowseRepository:"+selectedRepository);
- displayGroupDetail(null,null,"restServices/archivaServices/browseService/rootGroups?repositoryId="+encodeURIComponent(selectedRepository));
+ //$.log("changeBrowseRepository:"+selectedRepository);
+ //displayGroupDetail(null,null,"restServices/archivaServices/browseService/rootGroups?repositoryId="+encodeURIComponent(selectedRepository));
+ window.sammyArchivaApplication.setLocation("#browse~"+selectedRepository);
}
getSelectedBrowsingRepository=function(){