]> source.dussan.org Git - archiva.git/commitdiff
clean maven2repository module to focus only on layout in webapp
authorskygo <skygo@unknown>
Tue, 7 May 2013 21:42:38 +0000 (21:42 +0000)
committerskygo <skygo@unknown>
Tue, 7 May 2013 21:42:38 +0000 (21:42 +0000)
make some order hypothesis

git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-1756@1480100 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/PluginsService.java
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/main.js [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/20legacy/main.js [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/legacy/main.js [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/maven2/main.js [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/repository-groups.js
archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/resources/js/archiva/admin/repository/maven2d/main.js [deleted file]

index 27f8df0a6c46003dc44de5578ef6c591a6002e24..4468d614bccde9a106b5206fa8e093f60e9c2707 100644 (file)
@@ -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/10maven2/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/10maven2/main.js
new file mode 100644 (file)
index 0000000..3be9c5c
--- /dev/null
@@ -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/10maven2/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/admin/repository/20legacy/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/20legacy/main.js
new file mode 100644 (file)
index 0000000..907cdf0
--- /dev/null
@@ -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/20legacy/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/legacy/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/repository/legacy/main.js
deleted file mode 100644 (file)
index 7de78f7..0000000
+++ /dev/null
@@ -1,317 +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/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
deleted file mode 100644 (file)
index f2e8cc0..0000000
+++ /dev/null
@@ -1,44 +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/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
index ccf7416d20f78abaf93bf5fcceb15ea3e620ee4a..f470c3156f75141cac1de9cc12e10a0fbe1b9607 100644 (file)
@@ -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 $( "<li></li>" )
-                                                               .data( "item.autocomplete", item )
-                                                               .append( "<a>" + item.artifactId + "</a>" )
-                                                               .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 $("<li></li>")
+                    .data("item.autocomplete", item)
+                    .append("<a>" + item.artifactId + "</a>")
+                    .appendTo(ul);
+        };
+
+    };
 
 
 });
index ce567c88272a4b3fa75fbfe7be4859ab40e41d92..e49fd1f75af1ea47cf79e766ba4a42a74f457a63 100644 (file)
@@ -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 (file)
index fae0c5a..0000000
+++ /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