this.userManagerImpl=ko.observable(userManagerImpl);
}
- ArchivaRuntimeConfigurationViewModel=function(archivaRuntimeConfiguration){
+ ArchivaRuntimeConfigurationViewModel=function(archivaRuntimeConfiguration,userManagerImplementationInformations){
this.archivaRuntimeConfiguration=ko.observable(archivaRuntimeConfiguration);
- self=this;
+ this.userManagerImplementationInformations=ko.observable(userManagerImplementationInformations);
+ var self=this;
saveArchivaRuntimeConfiguration=function(){
$.log("saveArchivaRuntimeConfiguration");
}
}
+ UserManagerImplementationInformation=function(beanId,descriptionKey){
+ this.beanId=beanId;
+ this.descriptionKey=descriptionKey;
+ this.description= $.i18n.prop(descriptionKey);
+ }
+
+ mapUserManagerImplementationInformations=function(data){
+ return $.map(data, function(item) {
+ return mapUserManagerImplementationInformation(item);
+ });
+ }
+
+ mapUserManagerImplementationInformation=function(data){
+ if(data==null){
+ return null;
+ }
+ return new UserManagerImplementationInformation(data.beanId,data.descriptionKey);
+ }
+
displayRuntimeConfiguration=function(){
$.log("displayRuntimeConfiguration");
var mainContent = $("#main-content");
mainContent.html(mediumSpinnerImg());
-
- $.ajax("restServices/archivaServices/archivaRuntimeConfigurationService/archivaRuntimeConfiguration", {
+ $.ajax("restServices/archivaServices/archivaRuntimeConfigurationService/userManagerImplementationInformation", {
type: "GET",
dataType: 'json',
success: function(data) {
- var archivaRuntimeConfiguration = mapArchivaRuntimeConfiguration(data);
- var archivaRuntimeConfigurationViewModel = new ArchivaRuntimeConfigurationViewModel(archivaRuntimeConfiguration);
- mainContent.html( $( "#runtime-configuration-main" ).tmpl( ) );
- ko.applyBindings(archivaRuntimeConfigurationViewModel,$("#runtime-configuration-content" ).get(0));
+ var userManagerImplementationInformations=mapUserManagerImplementationInformations(data);
+ $.ajax("restServices/archivaServices/archivaRuntimeConfigurationService/archivaRuntimeConfiguration", {
+ type: "GET",
+ dataType: 'json',
+ success: function(data) {
+ var archivaRuntimeConfiguration = mapArchivaRuntimeConfiguration(data);
+ var archivaRuntimeConfigurationViewModel =
+ new ArchivaRuntimeConfigurationViewModel(archivaRuntimeConfiguration,userManagerImplementationInformations);
+ mainContent.html( $( "#runtime-configuration-main" ).tmpl( ) );
+ ko.applyBindings(archivaRuntimeConfigurationViewModel,$("#runtime-configuration-content" ).get(0));
+ }
+ });
+
}
});