From 98c2719d08b7d1791eb2080b4488bba810044608 Mon Sep 17 00:00:00 2001 From: Charles du Jeu Date: Fri, 18 Sep 2009 16:33:23 +0000 Subject: [PATCH] Lot of changes in the user editor git-svn-id: https://svn.argeo.org/commons/trunk@2973 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../org/argeo/security/ria/RolesApplet.js | 28 +- .../org/argeo/security/ria/SecurityAPI.js | 4 +- .../argeo/security/ria/UserEditorApplet.js | 327 +++++++++++++++--- .../org/argeo/security/ria/UsersApplet.js | 37 +- .../ria/components/CoworkerNatureImpl.js | 15 +- .../security/ria/components/INaturePane.js | 13 +- .../security/ria/components/NaturesManager.js | 39 +++ .../ria/components/SimpleUserNatureImpl.js | 35 +- .../org/argeo/security/ria/model/Nature.js | 5 +- .../org/argeo/security/ria/model/User.js | 13 + .../org.argeo.security.ria/dialog-apply.png | Bin 0 -> 872 bytes .../org.argeo.security.ria/dialog-cancel.png | Bin 0 -> 786 bytes .../document-properties-22.png | Bin 0 -> 925 bytes .../org.argeo.security.ria/identity.png | Bin 0 -> 5091 bytes .../preferences-users.png | Bin 0 -> 1870 bytes 15 files changed, 429 insertions(+), 87 deletions(-) create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/components/NaturesManager.js create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/dialog-apply.png create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/dialog-cancel.png create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/document-properties-22.png create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/identity.png create mode 100644 security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/preferences-users.png diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js index 6cd0b4399..da45d965b 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/RolesApplet.js @@ -126,7 +126,7 @@ qx.Class.define("org.argeo.security.ria.RolesApplet", this._selectionToValues(this.table.getSelectionModel(), this.getViewSelection()); }, this); - this.rolesUsersStub = {"ROLE_ADMIN":["root","mbaudier"],"ROLE_USER":["mbaudier","cdujeu"]}; + this.rolesUsersStub = {"ROLE_ADMIN":["gandalf"],"ROLE_USER":["demo","frodo","gandalf"]}; this.toggleButton = new qx.ui.form.ToggleButton("Filter", "org.argeo.security.ria/go-next.png"); this.toggleButton.set({ @@ -157,8 +157,14 @@ qx.Class.define("org.argeo.security.ria.RolesApplet", }); this.saveButton.addListener("execute", function(){ - alert("Saving changes..."); - this.setGuiMode(this.initialState); + if(!this.usersAppletReference){ + this.setGuiMode(this.initialState); + return; + } + var newSelection = this.usersAppletReference.getViewSelection().getNodes(); + var diff = this._selectionDiff(this.getChooserOriginalSelection(), newSelection); + this.saveRoleModifications(diff.deltaPlus, diff.deltaMinus); + this.setGuiMode(this.initialState); }, this); this.cancelButton.addListener("execute", function(){ if(!this.getChooserSelectionModified()){ @@ -224,13 +230,17 @@ qx.Class.define("org.argeo.security.ria.RolesApplet", } }, + saveRoleModifications : function(deltaPlus, deltaMinus){ + console.log(deltaPlus); + console.log(deltaMinus); + }, + monitorChooserSelectionChanges : function(event){ if(!this.usersAppletReference || this.getChooserSelectionModified()) return; var initialSelection = this.getChooserOriginalSelection(); var crtSelection = event.getTarget().getNodes(); if(!qx.lang.Array.equals(initialSelection.sort(), crtSelection.sort())){ - this.setChooserSelectionModified(true); - console.log("Changed!"); + this.setChooserSelectionModified(true); this.saveButton.setEnabled(true); } }, @@ -282,6 +292,14 @@ qx.Class.define("org.argeo.security.ria.RolesApplet", return values; }, + _selectionDiff : function(initialSelection, modifiedSelection){ + var deltaMinus = qx.lang.Array.clone(initialSelection); + var deltaPlus = qx.lang.Array.clone(modifiedSelection); + qx.lang.Array.exclude(deltaPlus, initialSelection); + qx.lang.Array.exclude(deltaMinus, modifiedSelection); + return {deltaPlus : deltaPlus, deltaMinus : deltaMinus}; + }, + /** * Load a given row : the data passed must be a simple data array. * @param data {Element} The text xml description. diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/SecurityAPI.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/SecurityAPI.js index e4f3e846e..e138d861b 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/SecurityAPI.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/SecurityAPI.js @@ -2,7 +2,7 @@ qx.Class.define("org.argeo.security.ria.SecurityAPI", { extend : qx.core.Object, statics : { - DEFAULT_CONTEXT : "org.argeo.security.ria", + DEFAULT_CONTEXT : "/org.argeo.security.webapp", USERS_LIST_SERVICE : "getUsersList.security", USER_EXISTS_SERVICE : "userExists.security", @@ -31,7 +31,7 @@ qx.Class.define("org.argeo.security.ria.SecurityAPI", { getServiceRequest : function(serviceName) { var serviceManager = org.argeo.ria.remote.RequestManager.getInstance(); return serviceManager.getRequest( - org.argeo.slc.ria.SlcApi.DEFAULT_CONTEXT + "/" + serviceName, + org.argeo.security.ria.SecurityAPI.DEFAULT_CONTEXT + "/" + serviceName, "GET", "application/json"); }, diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UserEditorApplet.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UserEditorApplet.js index 772cf2e7f..2d51a172e 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UserEditorApplet.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UserEditorApplet.js @@ -36,14 +36,62 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", menu : "Users", toolbar : "user", callback : function(e){ - + // CALL SERVICE AND GET UP TO DATE USER + this.saveUser(); }, - selectionChange : function(viewName, data){ + selectionChange : function(viewName, data){ if(viewName != "editor") return; var iApplet = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById("editor").getContent(); - if(iApplet == null) this.setEnabled(true); this.setEnabled(iApplet.getModified()); - //this.setEnabled(!(data == null || !data.length || data.length > 1)); + }, + command : null + }, + "add_nature" : { + label : "Add Nature ...", + icon : "org.argeo.security.ria/list-add.png", + shortcut : null, + enabled : true, + menu : "Natures", + toolbar : null, + callback : function(e){ + }, + submenuCallback : function(commandClass){ + this._addNatureTab(commandClass, null, true); + }, + submenu : [ + {"label" : "Totot", "icon":"","commandId" : "toto"}, + {"label" : "Totot", "icon":"","commandId" : "toto"} + ], + selectionChange : function(viewName, data){ + if(viewName != "editor") return; + var iApplet = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById("editor").getContent(); + if(iApplet && iApplet.getCurrentNatureTabs() && iApplet.getAvailableNatures() + && iApplet.getCurrentNatureTabs().length < qx.lang.Object.getLength(iApplet.getAvailableNatures())){ + this.setEnabled(true); + }else{ + this.setEnabled(false); + } + }, + command : null + }, + "remove_nature" : { + label : "Remove Nature", + icon : "org.argeo.security.ria/list-remove.png", + shortcut : null, + enabled : true, + menu : "Natures", + toolbar : null, + callback : function(e){ + this.removeSelectedTab(); + }, + selectionChange : function(viewName, data){ + if(viewName != "editor") return; + var iApplet = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById("editor").getContent(); + if(iApplet && iApplet.getSelectedNatureTab() && iApplet.getSelectedNatureTab().getUserData("NATURE_CLASS")){ + this.setEnabled(true); + }else{ + this.setEnabled(false); + } }, command : null }, @@ -57,7 +105,7 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", callback : function(e){ // Call service to delete var iApplet = org.argeo.ria.components.ViewsManager.getInstance().getViewPaneById("editor").getContent(); - if(!iApplet.getModified()){ + if(!iApplet.getModified() && !iApplet.getNaturesModified()){ this.getView().closeCurrent(); return; } @@ -78,7 +126,11 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", }, modified : { init : false, - apply : "_applyModified" + apply : "_applyDetailsModified" + }, + naturesModified : { + init : false, + apply : "_applyNaturesModified" }, rolesList : { @@ -87,6 +139,16 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", instanceLabel : {init:"Editor"}, loaded : { init : false + }, + currentNatureTabs : { + }, + availableNatures : { + }, + selectedNatureTab : { + nullable : true + }, + currentUser : { + } }, @@ -106,13 +168,28 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", this.setInstanceLabel("User " + data); } this.setView(viewPane); - this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId())); + this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId())); + + this.naturesManager = new org.argeo.security.ria.components.NaturesManager(); + var detectedNatures = this.naturesManager.getDetectedNatures(); + this.setAvailableNatures(detectedNatures); // TOOLBAR this.buttonGB = new qx.ui.container.Composite(new qx.ui.layout.HBox(5, "right")); this.add(this.buttonGB); + this.setCurrentNatureTabs([]); + this.naturesTab = new qx.ui.tabview.TabView("top"); + this.naturesTab.addListener("changeSelected", function(e){ + this.setSelectedNatureTab(e.getData()); + this.getViewSelection().triggerEvent(); + }, this); + + this.basicPage = new qx.ui.tabview.Page("Basic Information"); + this.basicPage.setLayout(new qx.ui.layout.VBox(5)); + // GROUPBOXES + this.basicGB = new qx.ui.groupbox.GroupBox("Base Informations"); var grid = new qx.ui.layout.Grid(5,5); this.basicGB.setLayout(grid); @@ -125,13 +202,8 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", this.passGB.setLayout(new qx.ui.layout.VBox()); this._initializeGroupBox(this.passGB); - this.naturesGB = new qx.ui.groupbox.GroupBox("User Natures"); - this.naturesGB.setLayout(new qx.ui.layout.Dock()); - this._initializeGroupBox(this.naturesGB); - this.add(this.basicGB); this.add(this.passGB); - this.add(this.naturesGB, {flex:1}); // FIELDS this.usernameField = new qx.ui.form.TextField(); @@ -146,23 +218,137 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", this.passPane = new org.argeo.security.ria.components.PasswordCredentialImpl(); this.passGB.add(this.passPane.getContainer()); - this.naturesTab = new qx.ui.tabview.TabView("top"); + //this.naturesTab.add(this.basicPage); + this.natureButtonGB = new qx.ui.container.Composite(new qx.ui.layout.HBox(5, "right")); + this.natureButtonGB.setMarginTop(15); + this.add(this.natureButtonGB); - this.simpleNature = new org.argeo.security.ria.components.SimpleUserNatureImpl(); - var page1 = new qx.ui.tabview.Page(this.simpleNature.getNatureLabel()); - page1.setLayout(new qx.ui.layout.Dock()); - page1.add(this.simpleNature.getContainer(), {edge:"center"}); - this.naturesTab.add(page1); + + this.add(this.naturesTab, {flex:1}); - this.coWorkerNature = new org.argeo.security.ria.components.CoworkerNatureImpl(); - var page2 = new qx.ui.tabview.Page(this.coWorkerNature.getNatureLabel()); - page2.setLayout(new qx.ui.layout.Dock()); - page2.add(this.coWorkerNature.getContainer(), {edge:"center"}); - this.naturesTab.add(page2); + this.naturesTab.setVisibility("excluded"); + this.fakePane = new qx.ui.container.Composite(new qx.ui.layout.Canvas()); + this.fakePane.setVisibility("visible"); + this.fakePane.setDecorator("tabview-pane"); + this.fakePane.setMarginTop(30); + this.add(this.fakePane, {flex:1}); - this.naturesGB.add(this.naturesTab, {edge:"center"}); + title = new qx.ui.basic.Atom("User Details", "org.argeo.security.ria/preferences-users.png"); + title.setFont(qx.bom.Font.fromString("16px sans-serif bold")); + this.buttonGB.add(title); + this.buttonGB.add(new qx.ui.core.Spacer(), {flex:1}); + + var title2 = new qx.ui.basic.Atom("User Natures", "org.argeo.security.ria/identity.png"); + title2.setFont(qx.bom.Font.fromString("16px sans-serif bold")); + this.natureButtonGB.add(title2); + this.natureButtonGB.add(new qx.ui.core.Spacer(), {flex:1}); + }, + + saveUser : function(){ + var user = this.getCurrentUser(); + user.setName(this.usernameField.getValue()); + user.setRoles((this.rolesField.getValue()||"").split(",")); + // GO TO AND RETURN FROM SERVER + user.setNatures([ + { + "email" : "", + "firstName" : "", + "lastName" : "", + "type" : "org.argeo.security.nature.SimpleUserNature" + }] + ); + this.partialRefreshUser(user, ["details","natures"]); + this.setModified(false); + }, + + _addNatureTab : function(natureClass, natureData, select){ + var crtTabs = this.getCurrentNatureTabs(); + if(qx.lang.Array.contains(crtTabs, natureClass.NATURE_TYPE)){ + this.error("There can only be one instance of a given nature type!"); + return null; + } + if(!this.naturesTab.isVisible()){ + if(this.fakePane) this.fakePane.setVisibility("excluded"); + this.naturesTab.setVisibility("visible"); + } + var page = new qx.ui.tabview.Page("Nature : " + natureClass.NATURE_LABEL); + page.setLayout(new qx.ui.layout.Dock()); + page.setUserData("NATURE_CLASS", natureClass); + var newClass = new natureClass(); + page.add(newClass.getContainer(), {edge:"center"}); + + buttons = new qx.ui.container.Composite(new qx.ui.layout.HBox(5, "center")); + var editB = new qx.ui.form.Button("Edit this Nature", "org.argeo.security.ria/document-properties-22.png"); + var saveB = new qx.ui.form.Button("Save", "org.argeo.security.ria/dialog-apply.png"); + var cancelB = new qx.ui.form.Button("Cancel", "org.argeo.security.ria/dialog-cancel.png"); + buttons.add(editB); + buttons.add(saveB); + buttons.add(cancelB); + page.add(buttons, {edge:"south"}); + editB.addListener("execute", function(){ + newClass.setEditMode(true); + editB.setVisibility("excluded"); + saveB.setVisibility("visible"); + cancelB.setVisibility("visible"); + }); + cancelB.addListener("execute", function(){ + newClass.setEditMode(false); + editB.setVisibility("visible"); + saveB.setVisibility("excluded"); + cancelB.setVisibility("excluded"); + }); + saveB.addListener("execute", function(){ + // SAVE CURRENT NATURE + this.setNaturesModified(false); + newClass.setEditMode(false); + editB.setVisibility("visible"); + saveB.setVisibility("excluded"); + cancelB.setVisibility("excluded"); + }, this); + if(natureData){ + newClass.setData(natureData); + cancelB.execute(); + }else{ + editB.execute(); + } + this.naturesTab.add(page); + crtTabs.push(natureClass.NATURE_TYPE); + this.getViewSelection().triggerEvent(); + newClass.addListener("modified", function(){ + this.setNaturesModified(true); + }, this); + if(select){ + this.naturesTab.setSelected(page); + } + return page; + }, + + _removeNatureTab : function(natureClass){ + this.naturesTab.getChildren().forEach(function(el){ + if(el.getUserData("NATURE_CLASS") == natureClass){ + this.naturesTab.remove(el); + qx.lang.Array.remove(this.getCurrentNatureTabs(), natureClass.NATURE_TYPE); + this.getViewSelection().triggerEvent(); + } + }, this); + if(this.naturesTab.getChildren().length == 0){ + this.naturesTab.setVisibility("excluded"); + this.fakePane.setVisibility("visible"); + } + }, + + removeSelectedTab : function(){ + var selected = this.naturesTab.getSelected(); + this._removeNatureTab(selected.getUserData("NATURE_CLASS")); + }, + + removeAllTabs : function(){ + while(this.naturesTab.getSelected()){ + this._removeNatureTab(this.naturesTab.getSelected().getUserData("NATURE_CLASS")); + } + }, _attachListeners : function(){ this.usernameField.addListener("changeValue", function(){ @@ -174,12 +360,6 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", this.passPane.addListener("modified", function(){ this.setModified(true); }, this); - this.simpleNature.addListener("modified", function(){ - this.setModified(true); - }, this); - this.coWorkerNature.addListener("modified", function(){ - this.setModified(true); - }, this); }, _initializeGroupBox: function(groupBox){ @@ -187,32 +367,91 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet", groupBox.getChildrenContainer().setPadding(8); }, - _applyModified : function(value){ + _applyDetailsModified : function(value){ if(value) this.getViewSelection().triggerEvent(); }, + _applyNaturesModified : function(value){ + if(value) this.getViewSelection().triggerEvent(); + }, + + loadUserData : function(user){ + this.setCurrentUser(user); + this.usernameField.setValue(user.getName()); + this.usernameField.setReadOnly(true); + this.rolesField.setValue(user.getRoles()); + var userNatureTabs = this.naturesManager.detectNaturesInData(user.getNatures()); + if(userNatureTabs.length){ + userNatureTabs.forEach(function(el){ + this._addNatureTab(el.NATURE_CLASS, el.NATURE_DATA); + }, this); + } + }, + + partialRefreshUser : function(user, target){ + if(!qx.lang.Array.isArray(target)) target = [target]; + + if(qx.lang.Array.contains(target,"natures")){ + this.removeAllTabs(); + var userNatureTabs = this.naturesManager.detectNaturesInData(user.getNatures()); + if(userNatureTabs.length){ + userNatureTabs.forEach(function(el){ + this._addNatureTab(el.NATURE_CLASS, el.NATURE_DATA); + }, this); + } + } + if(qx.lang.Array.contains(target,"details")){ + this.setInstanceLabel("User "+user.getName()); + this.usernameField.setValue(user.getName()); + this.rolesField.setValue(user.getRoles()); + this.usernameField.setReadOnly(true); + } + }, + /** * Load a given row : the data passed must be a simple data array. * @param data {Element} The text xml description. */ - load : function(userData){ + load : function(user){ if(this.getLoaded()){ return; } - if(userData){ - this.usernameField.setValue(userData); - } this.setRolesList(["ROLE_ADMIN", "ROLE_USER"]); - this._attachListeners(); - var title = new qx.ui.basic.Atom(this.getInstanceLabel(), "org.argeo.security.ria/preferences-user.png"); - title.setFont(qx.bom.Font.fromString("16px sans-serif bold")); - this.buttonGB.add(title); - this.buttonGB.add(new qx.ui.core.Spacer(), {flex:1}); + + // MUST BE DONE AFTER COMMANDS ARE INITIALIZED! var commands = this.getCommands(); - var button = new qx.ui.form.Button("Save", "org.argeo.security.ria/document-save.png", commands["save_user"].command); - var button2 = new qx.ui.form.Button("Close", "org.argeo.security.ria/window-close.png", commands["close"].command); - this.buttonGB.add(button); - this.buttonGB.add(button2); + var saveButton = commands["save_user"].command.getFormButton(); + var closeButton = commands["close"].command.getFormButton(); + var removeButton = commands["remove_nature"].command.getFormButton(); + var natureButton = commands["add_nature"].command.getFormButton(); + + var detectedNatures = this.getAvailableNatures(); + var newMenu = []; + for(var key in detectedNatures){ + newMenu.push({"label" : detectedNatures[key].NATURE_LABEL, "icon":"", "commandId" : detectedNatures[key]}); + } + commands["add_nature"].command.setMenu(newMenu); + + natureButton.setShow("icon"); + removeButton.setShow("icon"); + saveButton.setShow("icon"); + closeButton.setShow("icon"); + + this.buttonGB.add(saveButton); + this.buttonGB.add(closeButton); + this.natureButtonGB.add(natureButton); + this.natureButtonGB.add(removeButton); + + if(user){ + this.loadUserData(user); + this._attachListeners(); + }else{ + this.setCurrentUser(new org.argeo.security.ria.model.User()); + this._attachListeners(); + this.setModified(true); + } + + this.setLoaded(true); }, diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js index f5e13c121..9438113ff 100644 --- a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js +++ b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/class/org/argeo/security/ria/UsersApplet.js @@ -73,9 +73,10 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", callback : function(e){ // Call service to delete var crtUser = this.getViewSelection().getNodes()[0]; + var userObject = this.getUsersList()[crtUser]; var classObj = org.argeo.security.ria.UserEditorApplet; var iView = org.argeo.ria.components.ViewsManager.getInstance().initIViewClass(classObj, "editor", crtUser); - iView.load(crtUser); + iView.load(userObject); }, selectionChange : function(viewName, data){ if(viewName != "users") return; @@ -95,6 +96,10 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", nullable:false, check:"org.argeo.ria.components.ViewSelection" }, + usersList : { + check : "Map", + event : "changeUsersList" + }, instanceId : {init:""}, instanceLabel : {init:""} }, @@ -109,6 +114,7 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", this.setView(viewPane); this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId())); + this.setUsersList({}); this.toolBar = new qx.ui.toolbar.ToolBar(); this.toolBarPart = new qx.ui.toolbar.Part(); this.toolBar.add(this.toolBarPart); @@ -132,7 +138,9 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", this.table.addListener("cellDblclick", function(cellEvent){ this.getCommands()["edit_user"].command.execute(); }, this); - + this.addListener("changeUsersList", function(){ + this._updateTableModel(); + }, this); this.setGuiMode("clear"); }, @@ -175,14 +183,33 @@ qx.Class.define("org.argeo.security.ria.UsersApplet", * @param data {Element} The text xml description. */ load : function(){ - var data = [["root", "ROLE_ADMIN"], ["mbaudier", "ROLE_ADMIN,ROLE_USER"], ["cdujeu","ROLE_USER"], ["anonymous", ""]]; - this.tableModel.setData(data); var commands = this.getCommands(); this.toolBarPart.add(commands["new_user"].command.getToolbarButton()); this.toolBarPart.add(commands["delete_user"].command.getToolbarButton()); this.toolBarPart.add(commands["edit_user"].command.getToolbarButton()); this.toolBar.setShow("icon"); - + + var request = org.argeo.security.ria.SecurityAPI.getListUsersService(); + request.addListener("completed", function(response){ + var jSon = response.getContent(); + var usMap = {}; + for(var i=0;iry!dkWHB1D^L(XLkRYT=@=k_x2DCM3fw$E>lNrk3SY-bT}$%b9cj7NK~j zNWl-j&CmBgyu9Db{}W>jYf;>qP}en>s>wudie6PPl~azCEcwa~mW@#rRjvw{+>~Y9 zY;3J9uhmuLS7?mc#+y`02mT98Wt0(@6ZgEPs7A8e?J$@PI8}U#6CL6$a+3o9_<0wq z$)we5o6LIikZ;IW#TuBh2)durEIF3;s{BKGo7IZ3(J=r(AQ->~!v>9IvxS=nCO1Xv zY`RyaJNBh$c`cfnA2buuE;c9VR6!f9nbr<>UWvh)n1sp638*T=_~-=cJ@w4rGk&7K zp}%Jq>^kNWq$H_x_ttGGnKmbY2nt9fr8$%B=?N*A3i!eCKz6DFkd@+A_4OmFrX#jw zo42IE6>E+&Vk$fiHNqe&BJO$~;_Ex#8KqIVGS4!`7>J03YT;Sl7H2_rx)YqpffE2; z!_e*Z;eGd@TwIhX#3Y%Zs4CP55KCs-XD=ZVHGx3X z2xOffVhn>>XT%SW79R(`U0w;gNb&69QPN6&sk3BHYKFFG7^b+J{2B`e#K6`kEd%{RMfb>BKp0!LGfu}F^={p#O@|Yi y;1=pvnqAm`H&h14zd#vdOMAQ;wSIq)D+-BIREI0000jk`4p~x)2wFV~fh>Wv9ivZ@j)4Z4n+g z-23kN?)Sd?-9MtL>_x=(gcV5aRvZxN0Q!M8g;u~9m{pjG!PH&Vw>!<1T2|Z^Y1xEf zfy;pG^6!yfkh`b)?VrSVL{7$G3TUu~eP9uAfTjq?vOw>E>a;z$&EvdCOA4l3Xm9}+ zN*-MGVc($Yi9yxo6dZD(*M${>X>?%hzQ}_T~{qceS9R6-h_GJ2!KM@4YQ#Y#UAv#Aa0=G zrUN;%R9whE5y?i0uc@xNkPUGjbX%*h5Vx7GABU$ss^w7;WNV4}Q4#tg%Io0O=GN!w zuv1a&LaX`nVvq5(Pqknx_aOf~qP!*KbHuYo`aS~=t zv1w8yZBM+QTJR#|uMPQxh~q-D883!&Y>#Jvi>7}L7`MsKsure2P|Nda5e~z;Y$;s` z@s;EDPNY-djTvA04egz(YeZsJBx{i)P}1ONs=%p?>IVQ+wUQs<@f@hhmkW@#>tW78 z*20B3VPm%4y#0ZX%f`#|ahU%sa;0c_UKDX0Sa+dho%7WM4A@*%kI+|)dq}2N=?9Vi&TMU3SCjsnu_iC5^QKU!HvoYBo&GR z3xD8YOSn-rVprn-i3EU%#0mBx1$ZV?K%Ldr5m@H~KY*X6-7x(P;Ja!4zn>ff_-W0j QYybcN07*qoM6N<$g3jw@p#T5? literal 0 HcmV?d00001 diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/document-properties-22.png b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/document-properties-22.png new file mode 100644 index 0000000000000000000000000000000000000000..4a94ed982125ebde36a016643e72a1dd9a211573 GIT binary patch literal 925 zcmV;O17iG%P)7m;dMM=!$65eE#QJRUb++O`cM07M`n5K`;$ zpV>6ogqj9j*Ovpxfng;QFijIe5QGrlVfS?XQD*46Bf0}lgMR}PQGS?+plRPhK?HK+ zX}|^3@4!UawBkpJU2vK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Y<#K5WHxfU;A>Q literal 0 HcmV?d00001 diff --git a/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/preferences-users.png b/security/runtime/org.argeo.security.ria/src/argeo-ria-lib/security/resource/org.argeo.security.ria/preferences-users.png new file mode 100644 index 0000000000000000000000000000000000000000..53f3a2858fdf334cd6374baaa41fccedadac806e GIT binary patch literal 1870 zcmV-U2eJ5xP)fGh~o$vd9-#M2N5uWGZ&(-_?1AzS`4|R8UFZ3eL zde?C~h>(4ln>?)o^zPohd;C8IU~_5Ua&j8+j_t!@^zw}aDWo4xeFgQ*LIOiZTAObF3I-l$7?>oMI+s@xT zE5NK8IDGhxm)qOgR+W{-Y^5|f=ddge*L7jr4giDJ)@A;J+PWWicX!o3E5NK8D2v5@ zluFh6N(nH=K?D#Hj4=fx2qCe&wRQfjo40=Z-tl)CfD$R?7ZVRB|FExf-^C{Zm@x%i zU0rO?@YVE% zi|0=|mbYW;)~)iXBM^@x7Kub0r33&#DF((Eh%_uq!5G5VyFNRPd@td2a5n~nG0Y>4eZ=`;KA7VSdMcJr8KmbkWxShi69WTdGl7p z_x*YE=g((S%7Q*DI8LY!B0@YKw>#R`ZhY(L>py&I004L}Hg+3ekWxVi2_Xce3=jl) zTp7Gv+uG7%3lRVawLwJCTEiGqyk64K5R3TH-OmItdiU--eP{YqG#Y`FVFZF8fDi)4 zXpeJV5Tl0H8cInB5kN`-trd*XP)eb^qN4Jt0S+BL)X><}a?ta9`}~Cqh(@E}+$uVB zU6(7R3XVfZLWqI|kWxaa(7cioudA!eoekjMM0oU_qZ?MYtor4;wd)i2@27F;(qHk( zsZ*#*CQ(yUgS-&9KQ<--R-&~6V+;Vn7z>Pr>oLYaYX!$~aqoUQbKt-M@k9XK-Q8tN z8teD2U$;IXr9eeR1sWS05sgMLGIAFK1AhSlU<~7#$xOtyIFnMs7z4|)3NR?>z<>yp zPTw1xD+SX4Vu|RhFTAjEUJ&HLdAOQ|3l|_3D?>%aJmm9v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