From b9bc7bc3dcbdbf10e55d87d53b479c0910d7a1bd Mon Sep 17 00:00:00 2001 From: skygo Date: Tue, 7 May 2013 21:42:38 +0000 Subject: [PATCH] clean maven2repository module to focus only on layout in webapp make some order hypothesis git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-1756@1480100 13f79535-47bb-0310-9956-ffa450edef68 --- .../rest/api/services/PluginsService.java | 12 ++++--- .../repository/{maven2 => 10maven2}/main.js | 10 +++--- .../repository/{legacy => 20legacy}/main.js | 10 +++--- .../src/main/webapp/js/archiva/main.js | 36 +++++++++---------- .../webapp/js/archiva/repository-groups.js | 2 +- .../archiva/admin/repository/maven2d/main.js | 35 ------------------ 6 files changed, 36 insertions(+), 69 deletions(-) rename archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/{maven2 => 10maven2}/main.js (88%) rename archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/{legacy => 20legacy}/main.js (99%) delete mode 100644 archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/resources/js/archiva/admin/repository/maven2d/main.js diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PluginsService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PluginsService.java index 27f8df0a6..4468d614b 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PluginsService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PluginsService.java @@ -35,11 +35,13 @@ import javax.ws.rs.core.MediaType; public interface PluginsService { - @Path( "getAdminPlugins" ) + @Path( "getAdminPlugins" ) @GET - @Produces( { MediaType.TEXT_PLAIN } ) + @Produces( + { + MediaType.TEXT_PLAIN + } ) @RedbackAuthorization( noRestriction = true ) - String getAdminPlugins( ) - throws ArchivaRestServiceException; - + String getAdminPlugins() + throws ArchivaRestServiceException; } 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/10maven2/main.js similarity index 88% rename from archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/main.js rename to archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/main.js index f2e8cc03f..3be9c5c6f 100644 --- 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/10maven2/main.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva/admin/repository/maven2/main",["jquery",'i18n'], +define("archiva/admin/repository/10maven2/main",["jquery",'i18n'], function() { showMenu = function(administrationMenuItems) { administrationMenuItems.push( @@ -25,17 +25,17 @@ define("archiva/admin/repository/maven2/main",["jquery",'i18n'], href: "#repositorygroup", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { - displayRepositoryGroups() + displayRepositoryGroups(); } }); administrationMenuItems.push({text: $.i18n.prop('menu.repositories'), id: "menu-repositories-list-a", href: "#repositorylist", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { - displayRepositoriesGrid() + 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() + 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() + displayProxyConnectorsRules(); }}); }; 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/20legacy/main.js similarity index 99% rename from archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/legacy/main.js rename to archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/20legacy/main.js index 7de78f71a..907cdf02e 100644 --- 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/20legacy/main.js @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -define("archiva/admin/repository/legacy/main", ["jquery", 'i18n','knockout'], +define("archiva/admin/repository/20legacy/main", ["jquery", 'i18n','knockout'], function(jquery,i18n,ko) { showMenu = function(administrationMenuItems) { @@ -27,10 +27,10 @@ define("archiva/admin/repository/legacy/main", ["jquery", 'i18n','knockout'], href: "#legacy", redback: "{permissions: ['archiva-manage-configuration']}", func: function() { - displayLegacyArtifactPathSupport() + displayLegacyArtifactPathSupport(); } }); - } + }; //------------------------- @@ -186,7 +186,7 @@ define("archiva/admin/repository/legacy/main", ["jquery", 'i18n','knockout'], } ); } - } + }; }; LegacyArtifactPathsViewModel = function() { @@ -247,7 +247,7 @@ define("archiva/admin/repository/legacy/main", ["jquery", 'i18n','knockout'], updateLegacyArtifactPath = function(legacyArtifactPath) { - } + }; }; 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 ccf7416d2..f470c3156 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 @@ -232,11 +232,11 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa dataType: 'text', success: function(data) { $.each(data.split("|"), function(key, value) { - require([value], function() { - showMenu(self.administrationMenuItems); - }); - - }); + require([value], function() { + showMenu(self.administrationMenuItems); + }); + + }); } }); //var myrepplugins = "archiva/admin/repository/legacy/main|archiva/admin/repository/maven2/main"; @@ -777,7 +777,7 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa $("#main-content" ).html($("#welcome" ).tmpl({runtimeInfo: window.archivaRuntimeInfo})); drawQuickSearchAutocomplete("#quick-search-autocomplete-welcome"); }); - } + }; userLoggedCallbackFn=function(user){ $.log("userLoggedCallbackFn:"+ (user?user.username():null)); @@ -901,18 +901,18 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa } ); }, - select: function( event, ui ) { - $.log("select artifactId:"+ui.item.artifactId); - window.sammyArchivaApplication.setLocation("#quicksearch~"+ui.item.artifactId); - } - }).data( "autocomplete" )._renderItem = function( ul, item ) { - return $( "
  • " ) - .data( "item.autocomplete", item ) - .append( "" + item.artifactId + "" ) - .appendTo( ul ); - }; - - } + select: function(event, ui) { + $.log("select artifactId:" + ui.item.artifactId); + window.sammyArchivaApplication.setLocation("#quicksearch~" + ui.item.artifactId); + } + }).data("autocomplete")._renderItem = function(ul, item) { + return $("
  • ") + .data("item.autocomplete", item) + .append("" + item.artifactId + "") + .appendTo(ul); + }; + + }; }); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/repository-groups.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/repository-groups.js index ce567c882..e49fd1f75 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/repository-groups.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/repository-groups.js @@ -245,7 +245,7 @@ function(jquery,i18n,jqueryTmpl,bootstrap,jqueryValidate,jqueryUi,ko) { } ); - } + }; this.addRepositoryGroup=function(repositoryGroup){ clearUserMessages(); diff --git a/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/resources/js/archiva/admin/repository/maven2d/main.js b/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/resources/js/archiva/admin/repository/maven2d/main.js deleted file mode 100644 index fae0c5af0..000000000 --- a/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/resources/js/archiva/admin/repository/maven2d/main.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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/maven2d/main",["jquery",'i18n'], - function() { - showMenu = function(administrationMenuItems) { - administrationMenuItems.push( - {text: "dummymaven", - id: "menu-repository-groups-list-aa", - href: "#repositorygroupd", - redback: "{permissions: ['archiva-manage-configuration']}", - func: function() { - alert('Ah! We are the ruthless Pilou-Pilou warriors. I know not very archiva but it not final yet'); - } - }); - - }; - } - -); \ No newline at end of file -- 2.39.5