From 9f9d3f9450c6109b0c2dd9b9f30e03f9c733d917 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 18 Feb 2013 20:32:28 +0000 Subject: [PATCH] ui for change rbac manager impl git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1447480 13f79535-47bb-0310-9956-ffa450edef68 --- .../RedbackImplementationInformations.java | 69 ------------------- .../main/webapp/js/archiva/general-admin.js | 11 +-- .../js/templates/archiva/general-admin.html | 23 ++++++- 3 files changed, 27 insertions(+), 76 deletions(-) delete mode 100644 archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RedbackImplementationInformations.java diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RedbackImplementationInformations.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RedbackImplementationInformations.java deleted file mode 100644 index 7bdafb48f..000000000 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RedbackImplementationInformations.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.apache.archiva.rest.api.model; -/* - * 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. - */ - -import javax.xml.bind.annotation.XmlRootElement; -import java.util.List; - -/** - * @author Olivier Lamy - * @since 1.4-M4 - */ -@XmlRootElement( name = "redbackImplementationInformations" ) -public class RedbackImplementationInformations -{ - private List userManagerImplementationInformations; - - private List rbacManagerImplementationInformations; - - public RedbackImplementationInformations() - { - // no op - } - - public RedbackImplementationInformations( - List userManagerImplementationInformations, - List rbacManagerImplementationInformations ) - { - this.userManagerImplementationInformations = userManagerImplementationInformations; - this.rbacManagerImplementationInformations = rbacManagerImplementationInformations; - } - - public List getUserManagerImplementationInformations() - { - return userManagerImplementationInformations; - } - - public void setUserManagerImplementationInformations( - List userManagerImplementationInformations ) - { - this.userManagerImplementationInformations = userManagerImplementationInformations; - } - - public List getRbacManagerImplementationInformations() - { - return rbacManagerImplementationInformations; - } - - public void setRbacManagerImplementationInformations( - List rbacManagerImplementationInformations ) - { - this.rbacManagerImplementationInformations = rbacManagerImplementationInformations; - } -} 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 1de494da4..90b561b0c 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 @@ -1368,10 +1368,11 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" return null; } - RedbackRuntimeConfigurationViewModel=function(redbackRuntimeConfiguration,userManagerImplementationInformations){ + RedbackRuntimeConfigurationViewModel=function(redbackRuntimeConfiguration,userManagerImplementationInformations,rbacManagerImplementationInformations){ var self=this; this.redbackRuntimeConfiguration=ko.observable(redbackRuntimeConfiguration); - this.userManagerImplementationInformations=ko.observable(userManagerImplementationInformations); + this.userManagerImplementationInformations=ko.observableArray(userManagerImplementationInformations); + this.rbacManagerImplementationInformations=ko.observableArray(rbacManagerImplementationInformations); this.usedUserManagerImpls=ko.observableArray([]); @@ -1697,18 +1698,20 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" var mainContent = $("#main-content"); mainContent.html(mediumSpinnerImg()); - $.ajax("restServices/archivaServices/redbackRuntimeConfigurationService/redbackImplementationInformations", { + $.ajax("restServices/archivaServices/redbackRuntimeConfigurationService/redbackImplementationsInformations", { type: "GET", dataType: 'json', success: function(data) { var userManagerImplementationInformations=data?mapManagerImplementationInformations(data.userManagerImplementationInformations):[]; + var rbacManagerImplementationInformations=data?mapManagerImplementationInformations(data.rbacManagerImplementationInformations):[]; + $.log("rbacManagerImplementationInformations:"+rbacManagerImplementationInformations.length); $.ajax("restServices/archivaServices/redbackRuntimeConfigurationService/redbackRuntimeConfiguration", { type: "GET", dataType: 'json', success: function(data) { var redbackRuntimeConfiguration = mapRedbackRuntimeConfiguration(data); var redbackRuntimeConfigurationViewModel = - new RedbackRuntimeConfigurationViewModel(redbackRuntimeConfiguration,userManagerImplementationInformations); + new RedbackRuntimeConfigurationViewModel(redbackRuntimeConfiguration,userManagerImplementationInformations,rbacManagerImplementationInformations); var groups=[]; var useLdap = $.inArray("ldap",redbackRuntimeConfiguration.usedUserManagerImpls)>0 diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html index 43d87876e..dafb04dfb 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/general-admin.html @@ -988,14 +988,31 @@
${$.i18n.prop('redback.runtime.user-managers.impls.choosed')}
+ data-bind="sortable: { template: 'redback-runtime-general-content-impl-informations', data:usedUserManagerImpls,afterMove: userManagerImplMoved}">
${$.i18n.prop('redback.runtime.user-managers.impls.available')}
+ data-bind="sortable: {template: 'redback-runtime-general-content-impl-informations',data:availableUserManagerImpls,afterMove: userManagerImplMoved}"> +
+
+ + +
+
+
+
${$.i18n.prop('redback.runtime.rbac-managers.impls.choosed')}
+
+
+
+ +
+
${$.i18n.prop('redback.runtime.rbac-managers.impls.available')}
+
@@ -1232,7 +1249,7 @@ -