diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/archiva.css b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/archiva.css index e93392117..79d3daa94 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/archiva.css +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/archiva.css @@ -16,7 +16,9 @@ * specific language governing permissions and limitations * under the License. */ - +body { + background-color: #a0a0a0; +} /* medium-spinner */ #medium-spinner { z-index: 20001; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/legacy/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/legacy/main.js new file mode 100644 index 000000000..7de78f71a --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/legacy/main.js @@ -0,0 +1,317 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +define("archiva/admin/repository/legacy/main", ["jquery", 'i18n','knockout'], + function(jquery,i18n,ko) { + + showMenu = function(administrationMenuItems) { + administrationMenuItems.push( + { + text: $.i18n.prop('menu.legacy-artifact-support'), + id: "menu-legacy-support-list-a", + href: "#legacy", + redback: "{permissions: ['archiva-manage-configuration']}", + func: function() { + displayLegacyArtifactPathSupport() + } + }); + } + + + //------------------------- + // legacy path part + //------------------------- + + LegacyArtifactPath = function(path, groupId, artifactId, version, classifier, type, update) { + //private String path; + this.path = ko.observable(path); + + /** + * The artifact reference, as " [groupId] : + * [artifactId] : [version] : [classifier] : [type] ". + */ + //private String artifact; + //this.artifact=ko.observable(artifact); + this.update = update; + //private String groupId; + this.groupId = ko.observable(groupId); + + //private String artifactId; + this.artifactId = ko.observable(artifactId); + + //private String version; + this.version = ko.observable(version); + + //private String classifier; + this.classifier = ko.observable(classifier); + + //private String type; + this.type = ko.observable(type); + + this.modified = ko.observable(); + + this.artifact = ko.computed(function() { + var artifactValue = ""; + if (this.groupId()) { + artifactValue += this.groupId(); + } + if (this.artifactId()) { + artifactValue += ":" + this.artifactId(); + } + if (this.version()) { + artifactValue += ":" + this.version(); + } + if (this.classifier()) { + artifactValue += ":" + this.classifier(); + } + if (this.type()) { + artifactValue += ":" + this.type(); + } + return artifactValue; + }, this); + }; + + mapLegacyArtifactPaths = function(data) { + if (data) { + return $.isArray(data) ? $.map(data, function(item) { + return mapLegacyArtifactPath(item); + }) : [mapLegacyArtifactPath(data)]; + } + return []; + }; + + mapLegacyArtifactPath = function(data) { + return data ? new LegacyArtifactPath(data.path, data.groupId, data.artifactId, data.version, data.classifier, data.type) : null; + }; + + activateLegacyArtifactPathFormValidation = function() { + var theForm = $("#main-content").find("#legacy-artifact-paths-edit-form"); + var validator = theForm.validate({ + showErrors: function(validator, errorMap, errorList) { + customShowError("#main-content #legacy-artifact-paths-edit-form", validator, errorMap, errorMap); + } + }); + }; + + LegacyArtifactPathViewModel = function(legacyArtifactPath, update, legacyArtifactPathsViewModel) { + var self = this; + this.update = update; + this.legacyArtifactPath = legacyArtifactPath; + this.legacyArtifactPathsViewModel = legacyArtifactPathsViewModel; + + this.display = function() { + var mainContent = $("#main-content"); + ko.applyBindings(self, mainContent.find("#legacy-artifact-paths-edit").get(0)); + mainContent.find("#legacy-artifact-paths-view-tabs-li-edit a").html($.i18n.prop("edit")); + activateLegacyArtifactPathFormValidation(); + activateLegacyArtifactPathsEditTab(); + }; + + displayGrid = function() { + activateLegacyArtifactPathsGridTab(); + }; + + calculatePath = function() { + var path = ""; + if (self.legacyArtifactPath.groupId()) { + path += self.legacyArtifactPath.groupId() + "/jars/"; + } + if (self.legacyArtifactPath.artifactId()) { + path += self.legacyArtifactPath.artifactId(); + } + if (self.legacyArtifactPath.version()) { + path += "-" + self.legacyArtifactPath.version(); + } + if (self.legacyArtifactPath.classifier()) { + path += "-" + self.legacyArtifactPath.classifier(); + } + if (self.legacyArtifactPath.type()) { + path += "." + self.legacyArtifactPath.type(); + } + self.legacyArtifactPath.path(path); + }; + + this.save = function() { + var theForm = $("#main-content").find("#legacy-artifact-paths-edit-form"); + if (!theForm.valid()) { + return; + } + // do that on server side + /*if (theForm.find("#artifact" ).val() + !=theForm.find("#path" ).val()){ + var errorList=[{ + message: $.i18n.prop("path must match artifact"), + element: theForm.find("#path" ).get(0) + }]; + customShowError("#main-content #legacy-artifact-paths-edit-form", null, null, errorList); + return; + }*/ + // TODO call id exists if add ? + clearUserMessages(); + $.log("save ok"); + if (self.update) { + $.log("update"); + } else { + $.ajax("restServices/archivaServices/archivaAdministrationService/addLegacyArtifactPath", + { + type: "POST", + contentType: 'application/json', + data: ko.toJSON(self.legacyArtifactPath), + dataType: 'json', + success: function(data) { + self.legacyArtifactPath.modified(false); + self.legacyArtifactPathsViewModel.legacyArtifactPaths.push(self.legacyArtifactPath); + displaySuccessMessage($.i18n.prop('legacy-artifact-path.added', self.legacyArtifactPath.path())); + activateLegacyArtifactPathsGridTab(); + }, + error: function(data) { + var res = $.parseJSON(data.responseText); + displayRestError(res); + } + } + ); + } + } + }; + + LegacyArtifactPathsViewModel = function() { + var self = this; + this.legacyArtifactPaths = ko.observableArray([]); + + this.gridViewModel = new ko.simpleGrid.viewModel({ + data: self.legacyArtifactPaths, + columns: [ + { + headerText: $.i18n.prop('legacy-artifact-paths.path'), + rowText: "path" + }, + { + headerText: $.i18n.prop('legacy-artifact-paths.artifact'), + rowText: "artifact" + } + ], + pageSize: 5, + gridUpdateCallBack: function(networkProxy) { + $("#main-content").find("#legacy-artifact-paths-table").find("[title]").tooltip(); + } + }); + + + editLegacyArtifactPath = function(legacyArtifactPath) { + var legacyArtifactPathViewModel = new LegacyArtifactPathViewModel(legacyArtifactPath, true); + legacyArtifactPathViewModel.display(); + }; + + removeLegacyArtifactPath = function(legacyArtifactPath) { + + openDialogConfirm( + function() { + + $.ajax("restServices/archivaServices/archivaAdministrationService/deleteLegacyArtifactPath?path=" + encodeURIComponent(legacyArtifactPath.path()), + { + type: "GET", + dataType: 'json', + success: function(data) { + self.legacyArtifactPaths.remove(legacyArtifactPath); + displaySuccessMessage($.i18n.prop('legacy-artifact-path.removed', legacyArtifactPath.path())); + activateLegacyArtifactPathsGridTab(); + }, + error: function(data) { + var res = $.parseJSON(data.responseText); + displayRestError(res); + }, + complete: function() { + closeDialogConfirm(); + } + } + ); + }, $.i18n.prop('ok'), $.i18n.prop('cancel'), $.i18n.prop('legacy-artifact-path.delete.confirm', legacyArtifactPath.path()), + $("#legacy-artifact-path-delete-warning-tmpl").tmpl(legacyArtifactPath)); + + }; + + updateLegacyArtifactPath = function(legacyArtifactPath) { + + } + + }; + + displayLegacyArtifactPathSupport = function() { + screenChange(); + var mainContent = $("#main-content"); + mainContent.html(mediumSpinnerImg()); + + $.ajax("restServices/archivaServices/archivaAdministrationService/getLegacyArtifactPaths", { + type: "GET", + dataType: 'json', + success: function(data) { + mainContent.html($("#legacy-artifact-path-main").tmpl()); + var legacyArtifactPathsViewModel = new LegacyArtifactPathsViewModel(); + var legacyPaths = mapLegacyArtifactPaths(data); + $.log("legacyPaths:" + legacyPaths.length); + legacyArtifactPathsViewModel.legacyArtifactPaths(legacyPaths); + ko.applyBindings(legacyArtifactPathsViewModel, mainContent.find("#legacy-artifact-paths-view").get(0)); + + mainContent.find("#legacy-artifact-paths-view-tabs").on('show', function(e) { + if ($(e.target).attr("href") == "#legacy-artifact-paths-edit") { + var viewModel = new LegacyArtifactPathViewModel(new LegacyArtifactPath(), false, legacyArtifactPathsViewModel); + viewModel.display(); + activateLegacyArtifactPathFormValidation(); + clearUserMessages(); + } + if ($(e.target).attr("href") == "#legacy-artifact-paths-view") { + mainContent.find("#legacy-artifact-paths-view-tabs-li-edit a").html($.i18n.prop("add")); + clearUserMessages(); + } + + }); + + + activateLegacyArtifactPathsGridTab(); + } + }); + + + }; + + + activateLegacyArtifactPathsGridTab = function() { + var mainContent = $("#main-content"); + mainContent.find("#legacy-artifact-paths-view-tabs-li-edit").removeClass("active"); + mainContent.find("#legacy-artifact-paths-edit").removeClass("active"); + + mainContent.find("#legacy-artifact-paths-view-tabs-li-grid").addClass("active"); + mainContent.find("#legacy-artifact-paths-view").addClass("active"); + mainContent.find("#legacy-artifact-paths-view-tabs-li-edit a").html($.i18n.prop("add")); + + }; + + activateLegacyArtifactPathsEditTab = function() { + var mainContent = $("#main-content"); + mainContent.find("#legacy-artifact-paths-view-tabs-li-grid").removeClass("active"); + mainContent.find("#legacy-artifact-paths-view").removeClass("active"); + + mainContent.find("#legacy-artifact-paths-view-tabs-li-edit").addClass("active"); + mainContent.find("#legacy-artifact-paths-edit").addClass("active"); + }; + + + + + } +); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/main.js new file mode 100644 index 000000000..f2e8cc03f --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/main.js @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +define("archiva/admin/repository/maven2/main",["jquery",'i18n'], + function() { + showMenu = function(administrationMenuItems) { + administrationMenuItems.push( + {text: $.i18n.prop('menu.repository.groups'), + id: "menu-repository-groups-list-a", + href: "#repositorygroup", + redback: "{permissions: ['archiva-manage-configuration']}", + func: function() { + displayRepositoryGroups() + } + }); + administrationMenuItems.push({text: $.i18n.prop('menu.repositories'), id: "menu-repositories-list-a", href: "#repositorylist", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { + displayRepositoriesGrid() + }}); + administrationMenuItems.push({text: $.i18n.prop('menu.proxy-connectors'), id: "menu-proxy-connectors-list-a", href: "#proxyconnectors", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { + displayProxyConnectors() + }}); + administrationMenuItems.push({text: $.i18n.prop('menu.proxy-connectors-rules'), id: "menu.proxy-connectors-rules-list-a", href: "#proxyconnectorsrules", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { + displayProxyConnectorsRules() + }}); + + }; + } + +); \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js index 9e07b3dd4..55fc14a22 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js @@ -20,283 +20,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" "knockout.sortable","jquery.ui","jquery.validate","bootstrap","select2","knockout.select2"] , function(jquery,i18n,utils,jqueryTmpl,ko,simpleGrid,sortable,jqueryUi,validate,bootstrap,select2) { - //------------------------- - // legacy path part - //------------------------- - - LegacyArtifactPath=function(path,groupId,artifactId,version,classifier,type,update){ - //private String path; - this.path=ko.observable(path); - - /** - * The artifact reference, as " [groupId] : - * [artifactId] : [version] : [classifier] : [type] ". - */ - //private String artifact; - //this.artifact=ko.observable(artifact); - this.update=update; - //private String groupId; - this.groupId=ko.observable(groupId); - - //private String artifactId; - this.artifactId=ko.observable(artifactId); - - //private String version; - this.version=ko.observable(version); - - //private String classifier; - this.classifier=ko.observable(classifier); - - //private String type; - this.type=ko.observable(type); - - this.modified=ko.observable(); - - this.artifact = ko.computed(function() { - var artifactValue=""; - if (this.groupId()){ - artifactValue+=this.groupId(); - } - if (this.artifactId()){ - artifactValue+=":"+this.artifactId(); - } - if (this.version()){ - artifactValue+=":"+this.version(); - } - if (this.classifier()){ - artifactValue+=":"+this.classifier(); - } - if (this.type()){ - artifactValue+=":"+this.type(); - } - return artifactValue; - }, this); - }; - - mapLegacyArtifactPaths=function(data){ - if (data){ - return $.isArray(data)? $.map(data,function(item){ - return mapLegacyArtifactPath(item); - }):[mapLegacyArtifactPath(data)]; - } - return []; - }; - - mapLegacyArtifactPath=function(data){ - return data?new LegacyArtifactPath(data.path,data.groupId,data.artifactId,data.version,data.classifier,data.type):null; - }; - - activateLegacyArtifactPathFormValidation=function(){ - var theForm=$("#main-content" ).find("#legacy-artifact-paths-edit-form"); - var validator = theForm.validate({ - showErrors: function(validator, errorMap, errorList) { - customShowError("#main-content #legacy-artifact-paths-edit-form",validator,errorMap,errorMap); - } - }); - }; - - LegacyArtifactPathViewModel=function(legacyArtifactPath,update,legacyArtifactPathsViewModel){ - var self=this; - this.update=update; - this.legacyArtifactPath=legacyArtifactPath; - this.legacyArtifactPathsViewModel=legacyArtifactPathsViewModel; - - this.display=function(){ - var mainContent=$("#main-content"); - ko.applyBindings(self,mainContent.find("#legacy-artifact-paths-edit" ).get(0)); - mainContent.find("#legacy-artifact-paths-view-tabs-li-edit a").html($.i18n.prop("edit")); - activateLegacyArtifactPathFormValidation(); - activateLegacyArtifactPathsEditTab(); - }; - - displayGrid=function(){ - activateLegacyArtifactPathsGridTab(); - }; - - calculatePath=function(){ - var path=""; - if (self.legacyArtifactPath.groupId()){ - path+=self.legacyArtifactPath.groupId()+"/jars/"; - } - if (self.legacyArtifactPath.artifactId()){ - path+=self.legacyArtifactPath.artifactId(); - } - if (self.legacyArtifactPath.version()){ - path+="-"+self.legacyArtifactPath.version(); - } - if (self.legacyArtifactPath.classifier()){ - path+="-"+self.legacyArtifactPath.classifier(); - } - if (self.legacyArtifactPath.type()){ - path+="."+self.legacyArtifactPath.type(); - } - self.legacyArtifactPath.path(path); - }; - - this.save=function(){ - var theForm=$("#main-content" ).find("#legacy-artifact-paths-edit-form"); - if (!theForm.valid()){ - return; - } - // do that on server side - /*if (theForm.find("#artifact" ).val() - !=theForm.find("#path" ).val()){ - var errorList=[{ - message: $.i18n.prop("path must match artifact"), - element: theForm.find("#path" ).get(0) - }]; - customShowError("#main-content #legacy-artifact-paths-edit-form", null, null, errorList); - return; - }*/ - // TODO call id exists if add ? - clearUserMessages(); - $.log("save ok"); - if (self.update){ - $.log("update"); - }else { - $.ajax("restServices/archivaServices/archivaAdministrationService/addLegacyArtifactPath", - { - type: "POST", - contentType: 'application/json', - data: ko.toJSON(self.legacyArtifactPath), - dataType: 'json', - success: function(data) { - self.legacyArtifactPath.modified(false); - self.legacyArtifactPathsViewModel.legacyArtifactPaths.push(self.legacyArtifactPath); - displaySuccessMessage($.i18n.prop('legacy-artifact-path.added',self.legacyArtifactPath.path())); - activateLegacyArtifactPathsGridTab(); - }, - error: function(data) { - var res = $.parseJSON(data.responseText); - displayRestError(res); - } - } - ); - } - } - }; - - LegacyArtifactPathsViewModel=function(){ - var self=this; - this.legacyArtifactPaths=ko.observableArray([]); - - this.gridViewModel = new ko.simpleGrid.viewModel({ - data: self.legacyArtifactPaths, - columns: [ - { - headerText: $.i18n.prop('legacy-artifact-paths.path'), - rowText: "path" - }, - { - headerText: $.i18n.prop('legacy-artifact-paths.artifact'), - rowText: "artifact" - } - ], - pageSize: 5, - gridUpdateCallBack: function(networkProxy){ - $("#main-content").find("#legacy-artifact-paths-table" ).find("[title]").tooltip(); - } - }); - - - editLegacyArtifactPath=function(legacyArtifactPath){ - var legacyArtifactPathViewModel=new LegacyArtifactPathViewModel(legacyArtifactPath,true); - legacyArtifactPathViewModel.display(); - }; - - removeLegacyArtifactPath=function(legacyArtifactPath){ - - openDialogConfirm( - function(){ - - $.ajax("restServices/archivaServices/archivaAdministrationService/deleteLegacyArtifactPath?path="+encodeURIComponent(legacyArtifactPath.path()), - { - type: "GET", - dataType: 'json', - success: function(data) { - self.legacyArtifactPaths.remove(legacyArtifactPath); - displaySuccessMessage($.i18n.prop('legacy-artifact-path.removed',legacyArtifactPath.path())); - activateLegacyArtifactPathsGridTab(); - }, - error: function(data) { - var res = $.parseJSON(data.responseText); - displayRestError(res); - }, - complete: function(){ - closeDialogConfirm(); - } - } - ); - }, $.i18n.prop('ok'), $.i18n.prop('cancel'), $.i18n.prop('legacy-artifact-path.delete.confirm',legacyArtifactPath.path()), - $("#legacy-artifact-path-delete-warning-tmpl" ).tmpl(legacyArtifactPath)); - - }; - - updateLegacyArtifactPath=function(legacyArtifactPath){ - - } - - }; - - displayLegacyArtifactPathSupport=function(){ - screenChange(); - var mainContent=$("#main-content"); - mainContent.html(mediumSpinnerImg()); - - $.ajax("restServices/archivaServices/archivaAdministrationService/getLegacyArtifactPaths", { - type: "GET", - dataType: 'json', - success: function(data){ - mainContent.html($("#legacy-artifact-path-main").tmpl()); - var legacyArtifactPathsViewModel=new LegacyArtifactPathsViewModel(); - var legacyPaths=mapLegacyArtifactPaths(data); - $.log("legacyPaths:"+legacyPaths.length); - legacyArtifactPathsViewModel.legacyArtifactPaths(legacyPaths); - ko.applyBindings(legacyArtifactPathsViewModel,mainContent.find("#legacy-artifact-paths-view" ).get(0)); - - mainContent.find("#legacy-artifact-paths-view-tabs").on('show', function (e) { - if ($(e.target).attr("href")=="#legacy-artifact-paths-edit") { - var viewModel = new LegacyArtifactPathViewModel(new LegacyArtifactPath(),false,legacyArtifactPathsViewModel); - viewModel.display(); - activateLegacyArtifactPathFormValidation(); - clearUserMessages(); - } - if ($(e.target).attr("href")=="#legacy-artifact-paths-view") { - mainContent.find("#legacy-artifact-paths-view-tabs-li-edit a").html($.i18n.prop("add")); - clearUserMessages(); - } - - }); - - - activateLegacyArtifactPathsGridTab(); - } - }); - - - }; - - - activateLegacyArtifactPathsGridTab=function(){ - var mainContent = $("#main-content"); - mainContent.find("#legacy-artifact-paths-view-tabs-li-edit").removeClass("active"); - mainContent.find("#legacy-artifact-paths-edit").removeClass("active"); - - mainContent.find("#legacy-artifact-paths-view-tabs-li-grid").addClass("active"); - mainContent.find("#legacy-artifact-paths-view").addClass("active"); - mainContent.find("#legacy-artifact-paths-view-tabs-li-edit a").html($.i18n.prop("add")); - - }; - - activateLegacyArtifactPathsEditTab=function(){ - var mainContent = $("#main-content"); - mainContent.find("#legacy-artifact-paths-view-tabs-li-grid").removeClass("active"); - mainContent.find("#legacy-artifact-paths-view").removeClass("active"); - - mainContent.find("#legacy-artifact-paths-view-tabs-li-edit").addClass("active"); - mainContent.find("#legacy-artifact-paths-edit").addClass("active"); - }; - + //--------------------------- // repository scanning part diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js index ec039f6ea..717c5a4e9 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js @@ -224,25 +224,29 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa { text : $.i18n.prop('menu.artifacts.upload') , id: "menu-find-upload-a", href: "#upload" , redback: "{permissions: ['archiva-upload-repository']}", func: function(){displayUploadArtifact(true)}} ]); this.administrationMenuItems = ko.observableArray([ - { text : $.i18n.prop('menu.administration') , id: null}, - { text : $.i18n.prop('menu.repository.groups') , id: "menu-repository-groups-list-a" , href: "#repositorygroup" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRepositoryGroups()}}, - { text : $.i18n.prop('menu.repositories') , id: "menu-repositories-list-a" , href: "#repositorylist" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRepositoriesGrid()}}, - { text : $.i18n.prop('menu.proxy-connectors') , id: "menu-proxy-connectors-list-a" , href: "#proxyconnectors" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayProxyConnectors()}}, - { text : $.i18n.prop('menu.proxy-connectors-rules') , id: "menu.proxy-connectors-rules-list-a" , href: "#proxyconnectorsrules" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayProxyConnectorsRules()}}, - { text : $.i18n.prop('menu.network-proxies') , id: "menu-network-proxies-list-a" , href: "#networkproxies" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayNetworkProxies()}}, - { text : $.i18n.prop('menu.legacy-artifact-support') , id: "menu-legacy-support-list-a" , href: "#legacy" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayLegacyArtifactPathSupport()}}, - { text : $.i18n.prop('menu.repository-scanning') , id: "menu-repository-scanning-list-a" , href: "#scanningList" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRepositoryScanning()}}, - { text : $.i18n.prop('menu.runtime-configuration') , id: "menu-runtime-configuration-list-a" , href: "#runtimeconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRuntimeConfiguration()}}, - { text : $.i18n.prop('menu.system-status') , id: "menu-system-status-list-a" , href: "#status" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displaySystemStatus()}}, - { text : $.i18n.prop('menu.ui-configuration') , id: "menu-ui-configuration-list-a" , href: "#uiconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayUiConfiguration()}}, - { text : $.i18n.prop('menu.reports') , id: "menu-report-list-a" , href: "#reports" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayReportsPage()}} - ]); + {text: $.i18n.prop('menu.administration'), id: null} ]); + + + var myrepplugins = "archiva/admin/repository/legacy/main|archiva/admin/repository/maven2/main"; + $.each(myrepplugins.split("|"), function(key, value) { + alert(value); + require([value], function() { + showMenu(self.administrationMenuItems); + }); + + }); + self.administrationMenuItems.push({ text : $.i18n.prop('menu.network-proxies') , id: "menu-network-proxies-list-a" , href: "#networkproxies" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayNetworkProxies()}}); + self.administrationMenuItems.push({ text : $.i18n.prop('menu.repository-scanning') , id: "menu-repository-scanning-list-a" , href: "#scanningList" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRepositoryScanning()}}); + self.administrationMenuItems.push({ text : $.i18n.prop('menu.runtime-configuration') , id: "menu-runtime-configuration-list-a" , href: "#runtimeconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRuntimeConfiguration()}}); + self.administrationMenuItems.push({ text : $.i18n.prop('menu.system-status') , id: "menu-system-status-list-a" , href: "#status" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displaySystemStatus()}}); + self.administrationMenuItems.push({ text : $.i18n.prop('menu.ui-configuration') , id: "menu-ui-configuration-list-a" , href: "#uiconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayUiConfiguration()}}); + self.administrationMenuItems.push({ text : $.i18n.prop('menu.reports') , id: "menu-report-list-a" , href: "#reports" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayReportsPage()}}); - this.usersMenuItems = ko.observableArray([ + this.usersMenuItems = ko.observableArray([ { text : $.i18n.prop('menu.users') , id: null}, - { text : $.i18n.prop('menu.users.manage') , id: "menu-users-list-a" , href: "#users" , redback: "{permissions: ['archiva-manage-users']}", func: function(){displayUsersGrid()}}, - { text : $.i18n.prop('menu.users.roles') , id: "menu-roles-list-a" , href: "#roles" , redback: "{permissions: ['archiva-manage-users']}", func: function(){displayRolesGrid()}}, - { text : $.i18n.prop('menu.users-runtime-configuration') , id: "menu-redback-runtime-configuration-list-a" , href: "#redbackruntimeconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRedbackRuntimeConfiguration()}} + { text : $.i18n.prop('menu.users.manage') , id: "menu-users-list-a" , href: "#users" , redback: "{permissions: ['archiva-manage-users']}", func: function(){displayUsersGrid();}}, + { text : $.i18n.prop('menu.users.roles') , id: "menu-roles-list-a" , href: "#roles" , redback: "{permissions: ['archiva-manage-users']}", func: function(){displayRolesGrid();}}, + { text : $.i18n.prop('menu.users-runtime-configuration') , id: "menu-redback-runtime-configuration-list-a" , href: "#redbackruntimeconfig" , redback: "{permissions: ['archiva-manage-configuration']}", func: function(){displayRedbackRuntimeConfiguration();}} ]); this.docsMenuItems = ko.observableArray([