From: Mathieu Baudier Date: Thu, 23 Apr 2009 16:35:47 +0000 (+0000) Subject: Move to src X-Git-Tag: argeo-slc-2.1.7~1983 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=f8c052c61a8fef587356befed9e1c450376292b0;p=gpl%2Fargeo-slc.git Move to src git-svn-id: https://svn.argeo.org/slc/trunk@2332 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/Manifest.json b/server/org.argeo.slc.ria/src/argeo-ria-src/Manifest.json new file mode 100644 index 000000000..9c6d5e8a4 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/Manifest.json @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "org.argeo.ria", + + "summary" : "Slc Webui", + "description" : "Argeo Rich Internet Application", + + "homepage" : "http://www.argeo.org/", + + "license" : "LGPL", + "authors" : + [ + { + "name" : "Charles du Jeu", + "email" : "charles.dujeu@gmail.com" + } + ], + + "version" : "trunk", + "qooxdoo-versions": ["0.8"] + }, + + "provides" : + { + "namespace" : "org.argeo.ria", + "encoding" : "utf-8", + "class" : "class", + "resource" : "resource", + "translation" : "translation", + "type" : "application" + } +} + diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/Application.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/Application.js new file mode 100644 index 000000000..a1e5901f1 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/Application.js @@ -0,0 +1,278 @@ +/* ************************************************************************ + + Copyright: 2008 Argeo + + License: LGPL + + Authors: Charles du Jeu + +************************************************************************ */ + +/* ************************************************************************ + +#asset(slc/*) + +************************************************************************ */ + +/** + * This is the main application class of an Argeo RIA. + */ +qx.Class.define("org.argeo.ria.Application", +{ + extend : qx.application.Standalone, + + statics : { + INSTANCE : null + }, + + properties : { + /** + * Available perspective detected in the current compilation. + */ + perspectives : { + check : "Map", + init : {} + }, + /** + * Currently layouted perspective label + */ + activePerspectiveName : { + check : "String", + init : "" + }, + /** + * Currently layouted perspective. + */ + activePerspective : { + init : null + }, + /** + * Basic command associated to the application, applicable to all perspectives. + */ + commandsDefinitions : { + init : { + "stop" : { + label : "Stop", + icon : "resource/slc/process-stop.png", + shortcut : "Control+s", + enabled : false, + menu : null, + toolbar : "list", + callback : function(e){}, + command : null + }, + "switchperspective" : { + label : "Switch Perspective", + icon : "resource/slc/view-pane-tree.png", + shortcut : "", + enabled : true, + menu : "View", + toolbar : false, + submenu : [], + submenuCallback : function(commandId){ + // Defer execution to assure that the submenu is closed + // before it is rebuilt. + qx.event.Timer.once(function(){ + org.argeo.ria.Application.INSTANCE.loadPerspective(commandId); + }, this, 10); + }, + callback : function(e){}, + command : null + }, + "log" : { + label : "Show Console", + icon : "resource/slc/help-contents.png", + shortcut : "", + enabled : true, + menu : "View", + menuPosition: "last", + toolbar : false, + callback : function(e){ + org.argeo.ria.components.Logger.getInstance().toggle(); + }, + command : null + }, + "help" : { + label : "About...", + icon : "resource/slc/help-about.png", + shortcut : "Control+h", + enabled : true, + menu : "View", + toolbar : false, + callback : function(e){ + var win = new org.argeo.ria.components.Modal("About SLC", null, "SLC is a product from Argeo."); + win.attachAndShow(); + }, + command : null + } + } + } + }, + + members : + { + /** + * This method contains the initial application code and gets called + * during startup of the application + */ + main : function() + { + // Call super class + this.base(arguments); + this.self(arguments).INSTANCE = this; + this.views = {}; + + var viewsManager = org.argeo.ria.components.ViewsManager.getInstance(); + viewsManager.setApplicationRoot(this.getRoot()); + + /* + var appli = this; + qx.bom.Event.addNativeListener(window, "unload", function(){ + // TODO : Close perspective if one is open. + if(appli.getActivePerspective()){ + alert(appli.getActivePerspective()); + appli.getActivePerspective().remove(org.argeo.ria.components.ViewsManager.getInstance()); + } + }); + */ + // Enable logging in debug variant + if (qx.core.Variant.isSet("qx.debug", "on")) + { + qx.log.appender.Native; + qx.log.appender.Console; + } + var winLogger = org.argeo.ria.components.Logger.getInstance(); + this.getRoot().add(winLogger); + qx.log.Logger.register(winLogger); + + // Main layout + var layout = new qx.ui.layout.VBox(); + var container = new qx.ui.container.Composite(layout); + viewsManager.setViewPanesContainer(container); + // Document is the application root + this.getRoot().add(container, {left:0,right:0,top:0,bottom:0}); + + // Find available perspectives + var allPerspectives = {}; + for(var key in qx.Bootstrap.$$registry){ + if(qx.Class.hasInterface(qx.Bootstrap.$$registry[key], org.argeo.ria.components.IPerspective)){ + allPerspectives[key] = qx.Bootstrap.$$registry[key]; + } + } + var perspectiveNumber = qx.lang.Object.getLength(allPerspectives); + if(!perspectiveNumber){ + this.error("Cannot find a perspective for startup!"); + return; + } + this.setPerspectives(allPerspectives); + // Choose startup perspective, delete switch menu if only one perspective. + if(perspectiveNumber <= 1){ + delete this.getCommandsDefinitions()["switchperspective"]; + this.setActivePerspectiveName(qx.lang.Object.getKeys(allPerspectives)[0]); + } + else{ + var startupSetting; + try{ + startupSetting = qx.core.Setting.get("ria.StartupPerspective"); + }catch(e){} + if(startupSetting && allPerspectives[startupSetting]){ + this.setActivePerspectiveName(startupSetting); + }else{ + this.setActivePerspectiveName(qx.lang.Object.getKeys(allPerspectives)[0]); + } + this.rebuildPerspectiveMenus(); + } + + var menuBar = new qx.ui.menubar.MenuBar(); + var toolbar = new qx.ui.toolbar.ToolBar(); + var commandManager = org.argeo.ria.event.CommandsManager.getInstance(); + commandManager.init(this.getCommandsDefinitions()); + commandManager.createCommands(); + commandManager.registerMenuBar(menuBar); + commandManager.registerToolBar(toolbar); + toolbar.setShow("both"); + commandManager.addToolbarContextMenu(toolbar); + + var stopCommand = commandManager.getCommandById("stop"); + var serviceManager = org.argeo.ria.remote.RequestManager.getInstance(); + serviceManager.setStopCommand(stopCommand); + + container.add(menuBar); + container.add(toolbar); + + this.loadPerspective(); + }, + + /** + * Load a given perspective by its name. + * @param perspectiveName {String} Perspective to load + */ + loadPerspective : function(perspectiveName){ + if(perspectiveName){ + this.setActivePerspectiveName(perspectiveName); + this.rebuildPerspectiveMenus(); + }else{ + perspectiveName = this.getActivePerspectiveName(); + } + var viewsManager = org.argeo.ria.components.ViewsManager.getInstance(); + if(this.getActivePerspective()){ + this.getActivePerspective().remove(viewsManager); + } + var allPerspectives = this.getPerspectives(); + var perspectiveClass = allPerspectives[perspectiveName]; + if(!perspectiveClass){ + this.error("Cannot find class for startup perspective : "+perspectiveName); + return; + } + var perspective = new perspectiveClass; + perspective.initViewPanes(viewsManager); + perspective.initViews(viewsManager); + this.setActivePerspective(perspective); + }, + + /** + * After switching perspective, call this function to rebuild menu with the right selected. + */ + rebuildPerspectiveMenus : function(){ + var switchCommand = this.getCommandsDefinitions()["switchperspective"]; + switchCommand.submenu = []; + var allPerspectives = this.getPerspectives(); + for(var key in allPerspectives){ + switchCommand.submenu.push({ + "label":(allPerspectives[key].LABEL || key)+(key==this.getActivePerspectiveName()?" (current)":""), + "icon" :(allPerspectives[key].ICON || null), + "commandId":key, + "disabled" : (key==this.getActivePerspectiveName()?true:false) + }); + } + if(switchCommand.command){ // Command already created : force reload + switchCommand.command.clearMenus(); + switchCommand.command.setMenu(switchCommand.submenu); + } + }, + + /** + * Specific action of calling an external URL without triggering the "close()" method + * of Application. + * @param hrefValue {String} A download url that should reply with specific "attachment" header to avoid leaving the application. + */ + javascriptDownloadLocation: function(hrefValue){ + this.interruptClose = true; + document.location.href = hrefValue; + this.interruptClose = false; + }, + + /** + * Called at Application ending (closing the browser). + */ + close : function(){ + if(this.interruptClose) return ; + if(this.getActivePerspective()){ + this.getActivePerspective().remove(org.argeo.ria.components.ViewsManager.getInstance()); + } + this.base(arguments); + + } + + } +}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/__init__.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/__init__.js new file mode 100644 index 000000000..5ff6b2127 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/__init__.js @@ -0,0 +1,15 @@ +/** + * Generic package for the Argeo Rich Internet Application based on qooxdoo (www.qooxdoo.org). + * This is an empty application in itself, since it requires at least a basic implementation to be useful. + * + * + * The skeleton of an ArgeoRIA is the following : + * + * + GUI Application containing a menubar, a toolbar, and an empty space for custom Perspective. + * + * + Various managers : org.argeo.ria.components.ViewsManager for manipulating IView (VIEW), org.argeo.ria.event.CommandsManager + * for automatically wiring commands inside the application (CONTROLLER), and org.argeo.ria.remote.RequestManager for accessing the data (MODEL). + * + * + A simple configuration will allow to start your own Perspective inside the application. + * + */ \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js new file mode 100644 index 000000000..6841b700d --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js @@ -0,0 +1,150 @@ +/** + * A "dynamic" implementation of the standard TreeFolder class. + * + */ +qx.Class.define("org.argeo.ria.components.DynamicTreeFolder", { + extend : qx.ui.tree.TreeFolder, + + properties : { + /** + * The current state of the folder, usually "empty" => "loading" => "loaded" + */ + "state" : { + check : "String", + init : "empty", + apply : "_applyState" + }, + /** + * String to display as a child node during loading + */ + "loadingString" : { + check : "String", + init : "Loading..." + }, + /** + * Function that will load the children of this folder + */ + "loader" : { + check : "Function", + init : function(treeFolder){treeFolder.setLoaded();} + }, + /** + * Optionnal data describing the "drag" behaviour of the created children. + * First level is "file" or "folder", and for each of them, supported keys are "type" and "action". + */ + "dragData": { + check : "Map", + init : {} + } + }, + + /** + * Creates a new instance of DynamicTreeFolder + * @param label {String} Label of the folder + * @param loader {Function} Function that will load the children + * @param loadingString {String} String to display as a child node during loading + * @param dragData {Map} Optionnal data describing the "drag" behaviour of the created children. + */ + construct : function(label, loader, loadingString, dragData){ + this.base(arguments, label); + if(loader) this.setLoader(loader); + if(loadingString) this.setLoadingString(loadingString); + if(dragData) this.setDragData(dragData); + this.addListener("changeOpen", function(e){ + if(e.getData() && this.getState() == "loading"){ + this.load(); + } + }, this); + this.setState("loading"); + }, + + members : { + /** + * Add an item to the folder + * @param varargs {Mixed} One or many children to add + */ + add : function(varargs){ + this.base(arguments, varargs); + for (var i=0, l=arguments.length; iin charge of your panel to the main application zone + * (just below the toolbar). + * + * @param viewsManager {org.argeo.components.ViewsManager} the pane manager + * + */ + initViewPanes : function(viewsManager){return true;}, + /** + * Once the zones are available and initialized, initialize the views here + * and add them to viewPanes. Trigger initial data loading, etc. + * + * @param viewsManager {org.argeo.components.ViewsManager} the pane manager + * + */ + initViews : function(viewsManager){return true}, + /** + * Remove and destroy the perspective + * @param viewsManager {org.argeo.components.ViewsManager} the pane manager + */ + remove : function(viewsManager){return true} + } +}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/IView.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/IView.js new file mode 100644 index 000000000..4607788ee --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/IView.js @@ -0,0 +1,56 @@ +/** + * Interface for a standard 'view' of an argeo RIA. A view is an independant applet that + * will be integrated inside a ViewPane. + * If this view is to implement a selection (a list, a tree, etc) that will trigger changes on commands, + * it must trigger a viewSelection#changeSelection event. + * + * The typical lifecycle of an IView will be the following : + *
+ init(viewPane) : initialize basic GUI in the viewPane + *
+ getCommands() : wire the commands and add them to the toolbars/menubars + *
+ load(data) : loads the data itself. + * + * @author Charles du Jeu + */ +qx.Interface.define("org.argeo.ria.components.IView", { + + properties : { + /** + * The commands definition Map that will be automatically added and wired to the menubar and toolbar. + * See {@link org.argeo.ria.event.CommandsManager#definitions} for the keys to use for defining commands. + */ + commands : {}, + viewSelection : { + nullable:false, + check:"org.argeo.ria.components.ViewSelection" + }, + instanceId : {init:""}, + instanceLabel : {init:""} + }, + + members : { + /** + * The implementation should contain the GUI initialisation. + * This is the role of the manager to actually add the graphical component to the pane, + * so it's not necessary to do it here. + * @param viewPane {org.argeo.ria.components.ViewPane} The pane manager + * @param data {Mixed} Any object or data passed by the initiator of the view + * @return {Boolean} + */ + init : function(viewPane, data){return true;}, + /** + * The implementation should contain the real data loading (i.o. query...) + * @return {Boolean} + */ + load : function(){return true;}, + /** + * Whether this component is already contained in a scroller (return false) or not (return true). + * @return {Boolean} + */ + addScroll : function(){return true;}, + /** + * Called at destruction time + * Perform all the clean operations (stopping polling queries, etc.) + */ + close : function(){return true;} + } +}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/Logger.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/Logger.js new file mode 100644 index 000000000..33980a364 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/Logger.js @@ -0,0 +1,128 @@ +/** + * A modal window like console for the logs. + * Also opens a small alert window (qooxdoo, not native) on errors. + * + * @author : Charles du Jeu + */ +qx.Class.define("org.argeo.ria.components.Logger", +{ + type : "singleton", + extend : qx.ui.window.Window, + + construct : function(){ + this.base(arguments, "Logs", "resource/slc/help-contents.png"); + this.set({ + showMaximize : true, + showMinimize : false, + width: 550, + height: 300 + }); + this.setLayout(new qx.ui.layout.Dock(0,5)); + var buttonPane = new qx.ui.container.Composite(new qx.ui.layout.Canvas()); + var closeButton = new qx.ui.form.Button("Close"); + closeButton.addListener("execute", function(e){ + this.hide(); + }, this); + buttonPane.add(closeButton, {width:'20%',left:'40%'}); + this.add(buttonPane, {edge:'south'}); + this.setModal(false); + + var layout = new qx.ui.layout.VBox(2); + this._logPane = new qx.ui.container.Composite(layout); + var deco = new qx.ui.decoration.Single(1, 'solid', '#000000'); + deco.setBackgroundColor("#ffffff") + var scroller = new qx.ui.container.Scroll(this._logPane); + scroller.setDecorator(deco); + this.add(scroller, {edge:'center', width:'100%', height:'100%'}); + // Build style sheet content + var style = + [ + '.messages{font-size:0.9em}', + '.messages div{padding:0px 4px;}', + '.messages .offset{font-weight:bold;}', + '.messages .object{font-style:italic;}', + + '.messages .user-command{color:blue}', + '.messages .user-result{background:white}', + '.messages .user-error{background:#FFE2D5}', + '.messages .level-debug{background:white}', + '.messages .level-info{background:#DEEDFA}', + '.messages .level-warn{background:#FFF7D5}', + '.messages .level-error{background:#FFE2D5}', + '.messages .level-user{background:#E3EFE9}', + '.messages .type-string{color:black;font-weight:normal;}', + '.messages .type-number{color:#155791;font-weight:normal;}', + '.messages .type-boolean{color:#15BC91;font-weight:normal;}', + '.messages .type-array{color:#CC3E8A;font-weight:bold;}', + '.messages .type-map{color:#CC3E8A;font-weight:bold;}', + '.messages .type-key{color:#565656;font-style:italic}', + '.messages .type-class{color:#5F3E8A;font-weight:bold}', + '.messages .type-instance{color:#565656;font-weight:bold}', + '.messages .type-stringify{color:#565656;font-weight:bold}' + ]; + // Include stylesheet + qx.bom.Stylesheet.createElement(style.join("")); + + }, + + members : { + /** + * Adds a log in the GUI component. + * @param entry {Map} A log entry + */ + process : function(entry){ + var wrapper = qx.log.appender.Util.toHtml(entry); + var label = new qx.ui.basic.Label('
'+wrapper.innerHTML.replace(",","
")+'
'); + label.setRich(true); + if(entry.level == "error"){ + if(!this.alert){ + this.alert = new org.argeo.ria.components.Modal("Error"); + this.alert.setPersistent(true); + this.alert.addCloseButton(); + } + this.alert.addCenter(label.clone()); + this.alert.attachAndShow(); + }else if(entry.level == "info"){ + this.showLogAsPopup(label.clone()); + } + this._logPane.addAt(label, 0); + }, + /** + * Shows the GUI console and center it. + */ + toggle : function(){ + this.show(); + this.center(); + }, + + /** + * Show a given info log in a small popup right-top aligned. + * The popup will disappear after 5 seconds. + * @param content {qx.ui.basic.Label} The content of the popup to display + */ + showLogAsPopup:function(content){ + if(!this.popup){ + this.popup = new qx.ui.popup.Popup(new qx.ui.layout.Canvas()).set({ + backgroundColor: "#DFFAD3", + padding: [2, 4], + width: 350, + offset:0, + position: "right-top" + }); + } + this.popup.removeAll(); + this.popup.add(content); + var appRoot = org.argeo.ria.components.ViewsManager.getInstance().getApplicationRoot(); + appRoot.add(this.popup); + this.popup.show(); + this.popup.moveTo((qx.bom.Viewport.getWidth()-350), 0); + qx.event.Timer.once(function(){this.popup.hide();}, this, 5000); + } + }, + + destruct : function() + { + qx.log.Logger.unregister(this); + } + +}); diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/Modal.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/Modal.js new file mode 100644 index 000000000..3d2c2c81b --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/Modal.js @@ -0,0 +1,161 @@ +/** + * Generic modal popup window. + * It is layed out with a dock layout. When adding components to it, they are added as "center". + * @author Charles du Jeu + */ +qx.Class.define("org.argeo.ria.components.Modal", +{ + extend : qx.ui.window.Window, + + properties : { + persistent : { + check : "Boolean", + init : false + } + }, + + events : { + /** + * Triggered when the user clicks the "ok" button. + */ + "ok" : "qx.event.type.Event" + }, + /** + * + * @param caption {String} Title of the window + * @param icon {String} Icon of the window + * @param text {String} Default content of the window. + */ + construct : function(caption, icon, text){ + this.base(arguments, caption, icon); + this.set({ + showMaximize : false, + showMinimize : false, + width: 200, + height: 150 + }); + this.setLayout(new qx.ui.layout.Dock()); + this.setModal(true); + this.center(); + if(text){ + this.addLabel(text); + } + }, + + members : { + + addCenter : function(component){ + if(!this.getPersistent()){ + this.add(component, {edge : 'center', width:'100%'}); + }else{ + if(!this.centerScroller){ + this.centerScroller = new qx.ui.container.Composite(new qx.ui.layout.VBox(1)); + this.add(new qx.ui.container.Scroll(this.centerScroller), {edge : 'center', width:'100%', height:'100%'}); + } + this.centerScroller.add(component); + } + }, + + /** + * Display text inside the popup + * @param text {String} A string content for the popup + */ + addLabel:function(text){ + var label = new qx.ui.basic.Label(text); + label.setRich(true); + label.setTextAlign("center"); + this.addCenter(label); + this.addCloseButton(); + }, + /** + * Add a question and ok / cancel buttons + * @param text {String} The question to ask to the user + */ + addConfirm : function(text){ + var label = new qx.ui.basic.Label(text); + label.setRich(true); + label.setTextAlign("center"); + this.addCenter(label); + this.addOkCancel(); + }, + /** + * Display a component (panel) in the center of the popup + * @param panel {qx.ui.core.Widget} A gui component (will be set at width 100%). + */ + addContent: function(panel){ + this.addCenter(panel); + this.addCloseButton(); + }, + /** + * Automatically attach to the application root, then show. + */ + attachAndShow:function(){ + if(!this.attached){ + org.argeo.ria.components.ViewsManager.getInstance().getApplicationRoot().add(this); + this.attached = true; + } + this.show(); + }, + /** + * Adds a close button bottom-center aligned to the popup + */ + addCloseButton : function(){ + this.closeButton = new qx.ui.form.Button("Close"); + this.closeButton.addListener("execute", this._closeAndDestroy, this); + this.add(this.closeButton, {edge:'south'}); + }, + /** + * Adds two buttons bottom-center aligned (Ok and Cancel). + * Ok button has no listener by default, Cancel will close and destroy the popup. + */ + addOkCancel : function(){ + var buttonPane = new qx.ui.container.Composite(new qx.ui.layout.HBox(5, 'right')); + buttonPane.setAlignX("center"); + this.add(buttonPane, {edge:"south"}); + this.okButton = new qx.ui.form.Button("Ok"); + this.okButton.addListener("execute", function(e){ + this.fireEvent("ok"); + this._closeAndDestroy(); + }, this); + this.cancelButton = new qx.ui.form.Button("Cancel"); + this.cancelButton.addListener("execute", this._closeAndDestroy, this); + buttonPane.add(this.okButton); + buttonPane.add(this.cancelButton); + }, + /** + * Adds a prompt form to the popup : a question, followed by a text input. + * @param questionString {String} The question to ask to the user + * @param validationCallback {Function} Callback to apply : takes the text input value as unique argument. + * @param callbackContext {Object} Context for the callback, optional. + */ + makePromptForm:function(questionString, validationCallback, callbackContext){ + var label = new qx.ui.basic.Label(questionString); + label.setRich(true); + label.setTextAlign("center"); + this.add(label, {edge:'north'}); + var textField = new qx.ui.form.TextField(); + textField.setMarginTop(10); + textField.setMarginBottom(10); + this.add(textField, {edge:'center'}); + this.addOkCancel(); + if(callbackContext){ + validationCallback = qx.lang.Function.bind(validationCallback, callbackContext); + } + this.okButton.addListener("execute", function(e){ + var valid = validationCallback(textField.getValue()); + if(valid) this._closeAndDestroy(); + }, this); + }, + /** + * Close this modal window and destroy it. + */ + _closeAndDestroy : function(){ + this.hide(); + if(!this.getPersistent()){ + this.destroy(); + }else{ + if(this.centerScroller) this.centerScroller.removeAll(); + } + } + } +}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/TabbedViewPane.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/TabbedViewPane.js new file mode 100644 index 000000000..27742dd41 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/TabbedViewPane.js @@ -0,0 +1,183 @@ +/** + * A more elaborate views container than ViewPane, as it can handle multiple contents + * at once via a TabView. + * See {@link org.argeo.ria.components.ViewPane}. + */ +qx.Class.define("org.argeo.ria.components.TabbedViewPane", +{ + extend : qx.ui.container.Composite, + implement : [org.argeo.ria.components.ILoadStatusable], + + /** + * @param viewId {String} Unique id of this viewPane + * @param viewTitle {String} Readable Title of this viewPane + */ + construct : function(viewId, viewTitle){ + this.base(arguments); + this.setViewId(viewId); + this._defaultViewTitle = viewTitle; + this.setLayout(new qx.ui.layout.Canvas()); + this.blurredDecorator = new qx.ui.decoration.Uniform(1, "solid", "#000"); + this.blurredDecorator.setBackgroundImage("decoration/app-header.png"); + this.blurredDecorator.setBackgroundRepeat("scale"); + this.setDecorator(this.blurredDecorator); + + this.focusedDecorator = new qx.ui.decoration.Uniform(1, "solid", "#065fb2"); + this.focusedDecorator.setBackgroundImage("decoration/app-header.png"); + this.focusedDecorator.setBackgroundRepeat("scale"); + + this.tabView = new qx.ui.tabview.TabView(); + this.tabView.setAppearance("widget"); + // Empty mode + this.add(this.tabView, {top: 7, width:"100%", bottom:0}); + this.tabView.setBackgroundColor("#fff"); + this.tabView.setMarginTop(27); + + this.tabView.addListener("changeSelected", function(){ + this.fireEvent("changeSelection"); + }, this); + + + this.setFocusable(true); + this.addListener("click", function(e){ + this.fireDataEvent("changeFocus", this); + }, this); + + this.pageIds = {}; + }, + + properties : { + /** + * Unique id of the pane + */ + viewId : {init:""}, + /** + * Human-readable title for this view + */ + viewTitle : {init:"", event:"changeViewTitle"}, + /** + * Has its own scrollable content + */ + ownScrollable : {init: false, check:"Boolean"}, + /** + * Map of commands definition + * @see org.argeo.ria.event.Command + */ + commands : {init : null, nullable:true, check:"Map"} + + }, + + members : { + /** + * Checks if the pane already contains a given view, identified by its instance id + * @param contentId {Mixed} The instance id to check + * @return {Boolean} + */ + contentExists : function(contentId){ + if(this.pageIds[contentId]){ + this.tabView.setSelected(this.pageIds[contentId]); + return this.pageIds[contentId].getUserData("argeoria.iview"); + } + }, + /** + * Sets a new instance in the tabbed pane. + * @param content {org.argeo.ria.components.IView} The applet to add. + */ + setContent : function(content){ + if(!this.tabView.getChildren().length){ + this.tabView.setBackgroundColor("transparent"); + this.tabView.setMarginTop(0); + } + var contentId = content.getInstanceId(); + var page = new qx.ui.tabview.Page(content.getInstanceLabel()); + this.pageIds[contentId] = page; + page.setPadding(0); + page.setLayout(new qx.ui.layout.Canvas()); + page.add(content, {width:"100%", top:0, bottom:0}); + this.tabView.add(page); + page.setUserData("argeoria.iview", content); + content.getViewSelection().addListener("changeSelection", function(e){ + this.fireEvent("changeSelection"); + }, this); + this.tabView.setSelected(page); + }, + /** + * Get the currently selected tab content, if any. + * @return {org.argeo.ria.components.IView} The currently selected view. + */ + getContent : function(){ + if(this._getCrtPage()){ + return this._getCrtPage().getUserData("argeoria.iview"); + } + return null; + }, + /** + * Get the currently selected tab ViewSelection object. + * @return {org.argeo.ria.components.ViewSelection} The view selection object of the currently selected view. + */ + getViewSelection : function(){ + if(!this.getContent()) return null; + return this.getContent().getViewSelection(); + }, + /** + * Return the currently selected tab Page. + * @return {qx.ui.tabview.Page} The page + */ + _getCrtPage : function(){ + return this.tabView.getSelected(); + }, + /** + * Closes the currently selected view and remove all tabs components (button, page). + */ + closeCurrent : function(){ + var crtPage = this._getCrtPage(); + if(!crtPage) return; + var iView = crtPage.getUserData("argeoria.iview"); + var iViewInstance = iView.getInstanceId(); + iView.close(); + this.tabView.remove(crtPage); + delete(this.pageIds[iViewInstance]); + if(!this.tabView.getChildren().length){ // No more tabs : remove commands! + if(this.getCommands()){ + org.argeo.ria.event.CommandsManager.getInstance().removeCommands(this.getCommands(), this.getViewId()); + this.setCommands(null); + } + this.tabView.setBackgroundColor("#fff"); + this.tabView.setMarginTop(27); + } + }, + /** + * Call closeCurrent() recursively until there is no more page. + */ + empty : function(){ + var crtPage = this._getCrtPage(); + while(crtPage){ + this.closeCurrent(); + crtPage = this._getCrtPage(); + } + }, + /** + * Sets the tabView on "load" state. Nothing is done at the moment. + * @param load {Boolean} Load status + */ + setOnLoad : function(load){ + + }, + /** + * Sets a graphical indicator that this pane has the focus. A blue border. + */ + focus : function(){ + if(this.hasFocus) return; + this.fireEvent("changeSelection"); + this.setDecorator(this.focusedDecorator); + this.hasFocus = true; + }, + /** + * Remove a graphical focus indicator on this pane. + */ + blur : function(){ + this.hasFocus = false; + this.setDecorator(this.blurredDecorator); + } + } +}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js new file mode 100644 index 000000000..0ca43f32d --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js @@ -0,0 +1,250 @@ +/** + * A standard view container, referenced in the application by its unique id. + * It is managed by the ViewsManager singleton that works as the "View" part of an MVC model. + * @see org.argeo.ria.components.ViewsManager + * @author Charles + */ +qx.Class.define("org.argeo.ria.components.ViewPane", +{ + extend : qx.ui.container.Composite, + implement : [org.argeo.ria.components.ILoadStatusable], + + /** + * @param viewId {String} Unique id of this viewPane + * @param viewTitle {String} Readable Title of this viewPane + * @param splitPaneData {Map} Additionnal data to be used by splitpanes implementations. + */ + construct : function(viewId, viewTitle, splitPaneData){ + this.base(arguments); + this.setViewId(viewId); + this._defaultViewTitle = viewTitle; + this.setViewTitle(viewTitle); + if(splitPaneData){ + this.setSplitPaneData(splitPaneData); + } + this.setFocusable(true); + this.addListener("click", function(e){ + this.fireDataEvent("changeFocus", this); + }, this); + this.createGui(); + }, + + events : { + /** + * Trigger when the focus is changing + */ + "changeFocus" : "qx.event.type.Data", + /** + * Triggered when selection of content has changed. + */ + "changeSelection" : "qx.event.type.Event" + }, + + properties : + { + /** + * Unique id of the pane + */ + viewId : {init:""}, + /** + * Human-readable title for this view + */ + viewTitle : {init:"", event:"changeViewTitle"}, + /** + * Has its own scrollable content + */ + ownScrollable : {init: false, check:"Boolean"}, + /** + * Data concerning the split pane + */ + splitPaneData : {init : null, check:"Map"}, + /** + * Map of commands definition + * @see org.argeo.ria.event.Command + */ + commands : {init : null, nullable:true, check:"Map"}, + /** + * The real business content. + */ + content : { + init: null, + nullable : true, + check : "org.argeo.ria.components.IView", + apply : "_applyContent" + } + }, + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** + * Creates a standard GUI for the viewPane, including a container for an IView. + */ + createGui : function(){ + this.setLayout(new qx.ui.layout.VBox()); + this.header = new qx.ui.container.Composite(); + this.header.setLayout(new qx.ui.layout.Dock()); + this.loadImage = new qx.ui.basic.Image('resource/slc/ajax-loader.gif'); + this.header.set({appearance:"app-header", height:34}); + this.headerLabel = new qx.ui.basic.Label(this.getViewTitle()); + this.header.add(this.headerLabel, {edge:"west"}); + this.addListener("changeViewTitle", function(e){ + var newTitle = e.getData(); + if(newTitle != ""){ + this.headerLabel.setContent(newTitle); + if(e.getOldData() == ""){ + this.header.add(this.headerLabel, {edge:"west"}); + } + }else{ + this.header.remove(this.headerLabel); + } + }, this); + this.add(this.header); + this.setDecorator(new qx.ui.decoration.Single(1,"solid","#000")); + /* + // Open close button of splitPane, not very useful at the moment. + if(this.getSplitPaneData()){ + var data = this.getSplitPaneData(); + var imgName = (data.orientation=="horizontal"?"go-left":"go-bottom"); + var image = new qx.ui.basic.Image("resource/slc/"+imgName+".png"); + image.addListener("click", function(e){ + var image = e.getTarget(); + var data = this.getSplitPaneData(); + var functionDim = (data.orientation=="horizontal"?"Width":"Height"); + var objectToResize = data.object || this; + var crtDim = objectToResize["get"+functionDim](); + var minimize = (data.orientation=="horizontal"?"go-right":"go-top"); + var maximize = (data.orientation=="horizontal"?"go-left":"go-bottom"); + if(crtDim > data.min){ + objectToResize["set"+functionDim](data.min); + image.setSource("resource/slc/"+minimize+".png"); + this.origDimension = crtDim; + }else{ + if(this.origDimension){ + objectToResize["set"+functionDim](this.origDimension); + image.setSource("resource/slc/"+maximize+".png"); + } + } + }, this); + this.header.add(image,{edge:"east"}); + } + */ + }, + + /** + * Get the content ViewSelection object. + * @return {org.argeo.ria.components.ViewSelection} The view selection + */ + getViewSelection : function(){ + if(this.getContent()){ + return this.getContent().getViewSelection(); + } + return null; + }, + /** + * Checks if the pane already contains a given view, identified by its instance id + * @param iViewId {Mixed} The instance id to check + * @return {Boolean} + */ + contentExists : function(iViewId){ + if(this.getContent()){ + this.empty(); + } + return false; + }, + + /** + * Sets the content of this pane. + * @param content {org.argeo.ria.components.IView} An IView implementation + */ + _applyContent : function(content){ + if(content == null) return; + var addScrollable = (content.addScroll?content.addScroll():false); + if(addScrollable){ + this.setOwnScrollable(true); + this.scrollable = new qx.ui.container.Scroll(content); + this.add(this.scrollable, {flex: 1}); + }else{ + this.guiContent = content; + this.add(this.guiContent, {flex:1}); + } + content.getViewSelection().addListener("changeSelection", function(e){ + this.fireEvent("changeSelection"); + }, this); + }, + /** + * Adds a graphical component too the header of the view pane. + * It is added as "center" in the dock layout, and will override the view pane title label. + * For example, you can add your own title, or add a switch, or buttons, etc. + * @param component {qx.ui.core.Widget} The graphical component to add. + */ + addHeaderComponent : function(component){ + this.header.setPadding(4); + this.header.add(component, {edge:"center"}); + component.setTextColor("#1a1a1a"); + this.loadImage.setMargin(4); + }, + + /** + * Implementation of the ILoadStatusable interface. + * @see org.argeo.ria.components.ILoadStatusable + * @param load {Boolean} The loading status + */ + setOnLoad : function(load){ + if(load){ + this.header.add(this.loadImage, {edge:"east"}); + }else{ + this.header.remove(this.loadImage); + } + }, + + /** + * Call empty() method, since this pane can only handle one view. + */ + closeCurrent : function(){ + this.empty(); + }, + + /** + * Removes and destroy the IView content of this viewPane. + */ + empty: function(){ + if(this.getOwnScrollable() && this.scrollable){ + this.remove(this.scrollable); + }else if(this.guiContent){ + this.remove(this.guiContent); + } + if(this.getCommands()){ + org.argeo.ria.event.CommandsManager.getInstance().removeCommands(this.getCommands()); + this.setCommands(null); + } + if(this.getContent()){ + this.getContent().close(); + } + this.setViewTitle(this._defaultViewTitle); + this.setContent(null); + }, + /** + * Sets a graphical indicator that this pane has the focus. A blue border. + */ + focus : function(){ + if(this.hasFocus) return; + this.setDecorator(new qx.ui.decoration.Single(1,"solid","#065fb2")); + this.fireEvent("changeSelection"); + this.hasFocus = true; + }, + /** + * Remove a graphical focus indicator on this pane. + */ + blur : function(){ + this.hasFocus = false; + this.setDecorator(new qx.ui.decoration.Single(1,"solid","#000")); + } + + } +}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/ViewSelection.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/ViewSelection.js new file mode 100644 index 000000000..6c3e873ab --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/ViewSelection.js @@ -0,0 +1,85 @@ +/** + * Generic selection model associated to an IView content opened in a given ViewPane. + * It contains in an array any row/data/node, and triggers changeSelection data events. + * @author Charles du Jeu + */ +qx.Class.define("org.argeo.ria.components.ViewSelection", +{ + extend : qx.core.Object, + + /** + * @param viewId {String} The ViewPane unique id + */ + construct : function(viewId){ + this.base(arguments); + this.nodes = []; + this.setViewId(viewId); + }, + + properties : { + /** + * The viewPane unique id + */ + viewId : { + check : "String", + nullable: false + } + }, + + events : { + /** + * Triggered each time the selection changes. + */ + "changeSelection" : "qx.event.type.Data" + }, + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** + * Empty the selection + */ + clear : function(){ + this.nodes = []; + this.triggerEvent(); + }, + + /** + * Add a row or xml node or whatever + * @param node {mixed} Data to add to the selection + */ + addNode : function(node) { + this.nodes.push(node); + this.triggerEvent(); + }, + + /** + * The number of rows/nodes selected + * @return {Integer} + */ + getCount : function() { + return this.nodes.length; + }, + + /** + * Returns the content of the selection + * @return {Array} + */ + getNodes : function(){ + return this.nodes; + }, + + /** + * Creates and fire a data event changeSelection + */ + triggerEvent : function(){ + this.fireDataEvent("changeSelection", this); + } + + } +}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/ViewsManager.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/ViewsManager.js new file mode 100644 index 000000000..225bc693b --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/ViewsManager.js @@ -0,0 +1,112 @@ +/** + * The main "view" manager (in a standard MVC conception) of the application. + * It register various containers org.argeo.ria.components.viewPane and feed them with org.argeo.ria.components.IView implementations. + * It is a singleton and can thus be called by any part of the application. + * + * @author Charles du Jeu + */ +qx.Class.define("org.argeo.ria.components.ViewsManager", +{ + type : "singleton", + extend : qx.core.Object, + + properties : { + /** + * The application root (like Application.getRoot()), used to attach and show modal windows. + */ + applicationRoot : {init : null}, + /** + * The main container for the org.argeo.ria.components.ViewPane instances. + */ + viewPanesContainer : {init: null}, + /** + * Keeps the currently focused viewPane. + */ + currentFocus : {init :null} + }, + construct : function(){ + this.views = {}; + }, + members : { + /** + * Initialize and load a given IView implementation into a viewPane. + * The IView itself is returned. + * + * @param classObj {Clazz} The class object to instantiate + * @param viewPaneId {String} The unique ID of the view pane + * @param data {Mixed} Any data provided by the opener. + * @return {org.argeo.ria.components.IView} + */ + initIViewClass: function(classObj, viewPaneId, data){ + var viewPane = this.getViewPaneById(viewPaneId); + var iView = new classObj; + iView.init(viewPane, data); + var existingView = viewPane.contentExists(iView.getInstanceId()); + if(existingView){ + delete iView; + return existingView; + } + var commands = iView.getCommands(); + //viewPane.empty(); + if(commands){ + viewPane.setCommands(commands); + org.argeo.ria.event.CommandsManager.getInstance().addCommands(commands, "view:"+viewPaneId, viewPaneId); + } + viewPane.setContent(iView); + this.setViewPaneFocus(viewPane); + return iView; + }, + + /** + * Registers a new viewPane + * @param viewPane {org.argeo.ria.components.ViewPane} The new ViewPane instance + */ + registerViewPane : function(viewPane){ + this.views[viewPane.getViewId()] = viewPane; + viewPane.addListener("changeSelection", function(e){ + var viewSelection = e.getTarget().getViewSelection(); + if(!viewSelection) return; + org.argeo.ria.event.CommandsManager.getInstance().refreshCommands(viewSelection); + }); + viewPane.addListener("changeFocus", function(e){ + this.setViewPaneFocus(e.getTarget()); + }, this); + }, + /** + * Sets a given viewPane as the currently focused one. Blur the others. + * @param viewPane {org.argeo.ria.components.ViewPane} The viewPane (or TabbedViewPane) to focus on. + */ + setViewPaneFocus : function(viewPane){ + for(var key in this.views){ + this.views[key].blur(); + } + this.setCurrentFocus(viewPane); + viewPane.focus(); + }, + /** + * Returns a viewPane by its unique id. + * @param viewPaneId {String} The unique id + * @return {org.argeo.ria.components.ViewPane} + */ + getViewPaneById : function(viewPaneId){ + if(this.views[viewPaneId]) return this.views[viewPaneId]; + throw new Error("Cannot find view '"+viewPaneId+"'"); + }, + /** + * Returns a viewPane current viewSelection object + * @param viewPaneId {String} The unique id. + * @return {org.argeo.ria.components.ViewSelection} + */ + getViewPaneSelection : function(viewPaneId){ + return this.getViewPaneById(viewPaneId).getViewSelection(); + }, + /** + * Changes a viewPane title dynamically. + * @param viewPaneId {String} ViewPane unique Id. + * @param viewTitle {String} the new title for this viewPane. + */ + setViewPaneTitle : function(viewPaneId, viewTitle){ + this.getViewPaneById(viewPaneId).setViewTitle(viewTitle); + } + } +}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/__init__.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/__init__.js new file mode 100644 index 000000000..3f9efafa7 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/components/__init__.js @@ -0,0 +1,5 @@ +/** + * Package containing GUI components and main interfaces for GUI components to + * be used by any argeo RIA application. + * + */ \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/event/Command.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/event/Command.js new file mode 100644 index 000000000..77abef851 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/event/Command.js @@ -0,0 +1,248 @@ +/** + * The standard command for all actions. It registers keyboard shortcuts, centralizes + * command state, callback, etc. It is defined by command definitions that can be found + * in the CommandsManager. + */ + qx.Class.define("org.argeo.ria.event.Command", +{ + extend : qx.event.Command, + implement : [org.argeo.ria.components.ILoadStatusable], + + properties : { + /** + * Unique id of the command + */ + id : {init:""}, + /** + * Label of the command + */ + label : {init:""}, + /** + * Icon of the command + */ + icon : {init:""}, + /** + * Weather this command is a true/false state + */ + toggle : {init:false}, + /** + * It toggle button, initial state + */ + toggleInitialState : {init : false}, + /** + * Sub menu if needed + */ + menu : { + nullable: true, + event : "changeMenu" + }, + /** + * Callback associated to the submenu of the command + */ + menuCallback : {nullable:true}, + /** + * Context used when triggering menuCallback + */ + menuContext : {nullable:true} + }, + + /** + * @param id {String} Id of the command + * @param label {String} Label of the command + * @param icon {String} Icon of the command + * @param shortcut {String} Keyboard Shortcut (like alt+o, ctrl+z, etc..) + */ + construct : function(id, label, icon, shortcut){ + this.base(arguments, shortcut); + this.setId(id); + this.setLabel(label); + this.setIcon(icon); + this.menuClones = []; + this.callbacks = {}; + }, + + members : + { + /** + * Create a Button that suits a qx.ui.menu.MenuBar linked to this command + * @return {qx.ui.menu.Button} + */ + getMenuButton : function(){ + if(this.getToggle()){ + button = new qx.ui.menu.CheckBox(this.getLabel()); + this._registerToggleButtonListeners(button); + }else{ + var button = new qx.ui.menu.Button( + this.getLabel(), + this.getIcon(), + this, + this.getMenuClone() + ); + if(this.getMenu()){ + this.addListener("changeMenu", function(event){ + button.setMenu(this.getMenuClone()); + }, this); + } + } + this.addTooltip(button); + return button; + }, + + /** + * Create a Button that suits a qx.ui.toolbar.Toolbar part linked to this command. + * @return {qx.ui.toolbar.MenuButton} + */ + getToolbarButton : function(){ + var button; + if(this.getMenu()){ + button = new qx.ui.toolbar.MenuButton( + this.getLabel(), + this.getIcon(), + this.getMenuClone() + ); + this.addListener("changeMenu", function(event){ + button.setMenu(this.getMenuClone()); + }, this); + this.addListener("changeEnabled", function(e){ + this.setEnabled(e.getData()); + }, button); + button.setEnabled(this.getEnabled()); + }else if(this.getToggle()){ + button = new qx.ui.toolbar.CheckBox(this.getLabel(), this.getIcon()); + if(this.getToggleInitialState()){ + button.setChecked(true); + } + this._registerToggleButtonListeners(button); + }else{ + button = new qx.ui.toolbar.Button( + this.getLabel(), + this.getIcon(), + this + ); + } + this.addTooltip(button); + return button; + }, + + /** + * Register a given callback to be shared by one or more focusable part. + * @param callback {Function} A callback function + * @param focusablePartId {String} A string identifiing a focusable part. At the moment, it can only be "view:viewId" + */ + registerCallback : function(callback, focusablePartId){ + this.callbacks[focusablePartId] = callback; + }, + /** + * Return all the registered callbacks for this command. + * @return {Map} A map of callback, viewId => callBack. + */ + getCallbacks : function(){ + return this.callbacks; + }, + /** + * Remove a callback for a given focusable part. + * @param focusablePartId {String} A id like "view:viewId". + */ + removeCallback : function(focusablePartId){ + if(this.callbacks[focusablePartId]){ + delete this.callbacks[focusablePartId]; + } + }, + + /** + * Special tricks using UserData to enable/disable listeners to avoid loops... + * @param button {qx.ui.core.Widget} toolbar Checkbox or menu Checkbox button. + */ + _registerToggleButtonListeners : function(button){ + button.addListener("changeChecked", function(event){ + if(button.getUserData("disableListener")) return; + this.setUserData("slc.command.toggleState", event.getData()); + this.setUserData("slc.command.toggleStateSource", button); + this.fireEvent("execute"); + }, this); + this.addListener("execute", function(event){ + if(this.getUserData("slc.command.toggleStateSource") == button) return; + button.setUserData("disableListener", true); + button.setChecked(this.getUserData("slc.command.toggleState")); + button.setUserData("disableListener", false); + }, this); + }, + + /** + * Clones the command menu + * @return {qx.ui.menu.Menu} + */ + getMenuClone : function(){ + var menuClone = new qx.ui.menu.Menu(); + menuClone.setMinWidth(100); + var submenus = this.getMenu(); + if(!submenus) return; + for(var i=0;i + * { + * label : "", + * | The label of the action + * + * icon : "", + * | The icon image + * + * shortcut : "", + * | The keyboard shortcut, as defined in qooxdoo (Control+s, Alt+k, etc.). Warning, the letter must be lowercase. + * + * enabled : true, + * | Whether it is enabled or disabled at creation + * + * menu : ""|null, + * | The menu group to which the command will be added. If null, will not appear in the menus. + * + * menuPosition : "first"|"last" + * | Optional : force the menu group to be first or last in the menubar. + * + * toolbar : ""|null, + * | The toolbar group to which the command will be added. If null, will not appear in the toolbars. + * + * init : function(){}, + * | Optional function called at command creation. + * | Function context : the command itself + * + * callback : function(e){}, + * | The main callback to be triggered when command is executed. + * | Function context : the current class (not the command!) + * + * selectionChange : function(viewPaneId, xmlNodes){}, + * | Optional function called each time a selectionChange is detected in one of the active viewPane. + * | The origin viewPaneId and the new selection as a map of nodes are passed as arguments. + * | Function context : the command itself. + * + * submenu : [{label:"", icon:"", commandId:""}, ...], + * | If set, the command will create a submenu, being in a menu or in the toolbar. + * | The submenu is created with the various array entries, and the submenuCallback function + * | will be called with the 'commandId' parameter when a submenu entry is selected. + * + * submenuCallback : function(commandId){}, + * | Callback if command is a submenu (cf. above). + * | Function context : the current class/ + * + * command : null + * | For internal use only, caching the actual org.argeo.ria.event.Command object. + * } + * + * @see org.argeo.ria.event.Command for the definition Map details. + */ + definitions : { + init : {}, + check : "Map" + }, + /** + * For internal use + */ + initialDefinitions : { + init : {}, + check : "Map" + }, + /** + * Special command definitions that are shared between focusable parts. + */ + sharedDefinitions : { + init: {}, + check: "Map" + } + }, + + events : { + /** + * Triggered when the whole commands list is changed. Mainly used internally by the manager. + */ + "changedCommands" : "qx.event.type.Event" + }, + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** + * Initialize the manager with basic definitions. + * @param initDefinitions {Map} A map of commands definitions. + */ + init : function(initDefinitions){ + this.setDefinitions(initDefinitions); + this.setInitialDefinitions(qx.lang.Object.copy(initDefinitions)); + }, + + /** + * Creates all the objects (if they are not already existing) from the definitions maps. + */ + createCommands : function(){ + this.menus = {}; + this.toolbars = {}; + var defs = this.getDefinitions(); + var shared = this.getSharedDefinitions(); + for(var key in defs){ + var definition = defs[key]; + var command; + if(!definition.command){ + command = new org.argeo.ria.event.Command(key, definition.label, definition.icon, definition.shortcut); + if(definition.submenu){ + command.setMenu(definition.submenu); + if(definition.submenuCallback){ + command.setMenuCallback(definition.submenuCallback); + command.setMenuContext((definition.callbackContext?definition.callbackContext:null)); + } + } + command.setEnabled(definition.enabled); + if(definition.toggle){ + command.setToggle(true); + if(definition.toggleInitialState){ + command.setToggleInitialState(definition.toggleInitialState); + } + } + this._attachListener(command, definition.callback, definition.callbackContext); + if(definition.init){ + var binded = qx.lang.Function.bind(definition.init, command); + binded(); + } + definition.command = command; + }else{ + command = definition.command; + if(shared[key]){ + + for(var focusPartId in shared[key]){ + var sharedCommand = shared[key][focusPartId]; + if(sharedCommand.callback){ + var split = sharedCommand.callbackContext.split(":"); + var focusPart = split[0]; + var viewId = split[1]; + command.registerCallback(sharedCommand.callback, split[1]); + //this._attachListener(command, sharedCommand.callback, sharedCommand.callbackContext); + } + } + + } + } + if(definition.menu){ + if(!this.menus[definition.menu]) this.menus[definition.menu] = []; + this.menus[definition.menu].push(definition); + } + if(definition.toolbar){ + if(!this.toolbars[definition.toolbar]) this.toolbars[definition.toolbar] = []; + this.toolbars[definition.toolbar].push(command); + } + } + this.setDefinitions(defs); + }, + + /** + * Refresh the current commands status depending on the viewSelection. + * @param viewSelection {org.argeo.ria.components.ViewSelection} The current ViewSelection + */ + refreshCommands : function(viewSelection){ + var defs = this.getDefinitions(); + var shared = this.getSharedDefinitions(); + var xmlNodes = null; + if(viewSelection.getCount() > 0){ + var xmlNodes = viewSelection.getNodes(); + } + for(var key in defs){ + var definition = defs[key]; + if(!definition.selectionChange) continue; + if(shared[key]){ + var currentFocus = org.argeo.ria.components.ViewsManager.getInstance().getCurrentFocus(); + //this.debug(currentFocus); + if(!currentFocus) continue; + var sharedComm = shared[key][currentFocus.getViewId()]; + if(sharedComm && sharedComm.selectionChange){ + var binded = qx.lang.Function.bind(sharedComm.selectionChange, definition.command); + binded(viewSelection.getViewId(), xmlNodes); + } + } + var binded = qx.lang.Function.bind(definition.selectionChange, definition.command); + binded(viewSelection.getViewId(), xmlNodes); + } + }, + + /** + * Record a menubar for the application + * @param menuBar {qx.ui.menubar.MenuBar} The application menubar + */ + registerMenuBar : function(menuBar){ + this.addListener("changedCommands", function(){ + this.createMenuButtons(menuBar); + }, this); + this.createMenuButtons(menuBar); + }, + + /** + * Record a toolbar for the application + * @param toolBar {qx.ui.toolbar.ToolBar} The application toolbar + */ + registerToolBar : function(toolBar){ + this.addListener("changedCommands", function(){ + this.createToolbarParts(toolBar); + }, this); + this.createToolbarParts(toolBar); + }, + + /** + * Creates the real buttons and add them to the passed menuBar. + * @param menuBar {qx.ui.menubar.MenuBar} The application menubar + */ + createMenuButtons : function(menuBar){ + menuBar.removeAll(); + var anchors = {}; + for(var key in this.menus){ + var menu = new qx.ui.menu.Menu(); + var button = new qx.ui.menubar.Button(key, null, menu); + var anchorDetected = false; + for(var i=0; i 0) + qx.event.Timer.once(this._sendPoll, this, this._pollDelay); + else + this._sendPoll(); + }, + + /** + * Send a poll query : GET query and no paramter at all. + * @param request {qx.io.remote.Request} A request object + */ + _sendPoll : function(request) { + if(this.interrupt) return; + var request = new qx.io.remote.Request(this.uri, "GET", "application/xml"); + request.setTimeout(this.pollTimeout*1000+5000); + request.addListener("completed", this._pollHandler, this); + request.send(); + }, + + /** + * Add a function that gets called on every poll response, after all received + * messages have been handled. The poll handler is past a boolean that indicates + * if this is the first poll for the page. + * + * @param func {Function} The handler to be called. + */ + addPollHandler : function(func) { + var old = this._pollEvent; + this._pollEvent = function(first) { + old(first); + func(first); + } + }, + + /** + * Send a JMS message to a destination (eg topic://MY.TOPIC). + * Message should be xml or encoded xml content. + * + * @param destination {String} The topic destination + * @param message {String} XML encoded message + * @param properties {Map} A map of additional parameters to add to the query. + */ + sendMessage : function(destination, message, properties) { + this._sendMessage(destination, message, 'send', properties); + }, + + /** + * Listen on a channel or topic. handler must be a function taking a message arguement + * @param id {String} A unique identifier for this handler + * @param destination {String} The topic to listen to (topic://MY.TOPIC) + * @param handler {Function} The handler to trigger when receiving a message + * @param context {Object} An object to bind on the handler. + */ + addListener : function(id, destination, handler, context) { + this._handlers[id] = qx.lang.Function.bind(handler, context); + this._sendMessage(destination, id, 'listen'); + }, + + /** + * Remove Listener from channel or topic. + * @param id {String} identifier of the handler to remove. + * @param destination {String} The topic to listen to (topic://MY.TOPIC) + */ + removeListener : function(id, destination) { + this._handlers[id] = null; + this._sendMessage(destination, id, 'unlisten'); + }, + + /** + * Send a message of a given type. + * @param destination {String} The topic to listen to (topic://MY.TOPIC) + * @param message {String} XML encoded message + * @param type {String} The JMS-Type of message (listen, unlisten, send). + * @param properties {Map} A map of additional parameters to add to the query. + */ + _sendMessage : function(destination, message, type, properties) { + var req = new qx.io.remote.Request(this.uri, "POST", "text/plain"); + if(!properties) properties = {}; + properties["destination"] = destination; + properties["message"] = message; + properties["type"] = type; + var vParametersList = []; + + for (var vId in properties) + { + var value = properties[vId]; + if (value instanceof Array) + { + for (var i=0; i 0) + { + req.setData(vParametersList.join("&")); + } + + //req.addListener("completed", this.endBatch, this); + req.send(); + }, + + /** + * Starts a poll on the JMS server. + */ + startPolling : function() { + if (this.poll){ + this.interrupt = false; + var req = new qx.io.remote.Request(this.uri, "GET", "application/xml"); + req.setParameter("timeout", "10"); + req.addListener("completed", this._pollHandler, this); + req.send(); + } + }, + + /** + * Stops polling the JMS server. + */ + stopPolling : function(){ + this.interrupt = true; + } + } +}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/remote/RequestManager.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/remote/RequestManager.js new file mode 100644 index 000000000..0b79b272d --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/remote/RequestManager.js @@ -0,0 +1,157 @@ +/** + * A management class for all request sent to the server + * Basically, to access the server, always get a new Request object from this class. + * It will then trigger various user-interface events during the Request lifecycle. + * + * For the moment, it's about the "Stop" button command, handling any passed ILoadStatusable states, + * and logging the Request status/errors. + * + * @author Charles du Jeu + */ +qx.Class.define("org.argeo.ria.remote.RequestManager", +{ + type : "singleton", + extend : qx.core.Object, + + events : { + /** + * Triggered on the user demand at the end of the Request + */ + "reload" : "org.argeo.ria.event.ReloadEvent" + }, + + construct : function(){ + this.base(arguments); + }, + + members : { + /** + * Sets the unique "stop" command of the application. + * @param stopCommand {org.argeo.ria.event.Command} The command + */ + setStopCommand : function(stopCommand){ + this.command = stopCommand; + }, + + /** + * Creates a Request and handle various parts of its lifecycle. + * @see org.argeo.ria.event.ReloadEvent + * @see org.argeo.ria.components.ILoadStatusable + * + * @param url {String} The server url + * @param method {String} Connexion method (POST, GET, etc.) + * @param responseType {String} Expected response mime type (application/xml, etc...). + * @param fireReloadEventType {String} On user-demand, if this parameter is not null, a org.argeo.ria.event.ReloadEvent will be triggered when the request is completed. + * @param iLoadStatusables {Array} An array of ILoadStatusable implementations that need to be updated by the Request state (loading/ended). + * @return {qx.io.remote.Request} + */ + getRequest : function(url, method, responseType, fireReloadEventType, iLoadStatusables){ + var request = new qx.io.remote.Request(url, method, responseType); + if(iLoadStatusables){ + request.setUserData("iLoadStatusables", iLoadStatusables); + } + if(fireReloadEventType){ + request.addListener("completed", function(response){ + this.fireReloadEvent(fireReloadEventType, response.getContent()); + }, this); + } + this.enableCommand(request); + request.addListener("timeout", this.requestTerminated, this); + request.addListener("failed", this.requestTerminated, this); + request.addListener("aborted", this.requestTerminated, this); + request.addListener("completed", this.requestCompleted, this); + return request; + }, + + /** + * Creates a ReloadEvent and fire it. + * @param dataType {String} The data type + * @param content {mixed} The content of the request response. + */ + fireReloadEvent : function(dataType, content){ + this.fireEvent("reload", org.argeo.ria.event.ReloadEvent, [dataType, content]); + }, + + /** + * Triggered when request is created + * @param e {qx.event.type.Event} The event + */ + requestCreated : function(e){ + var request = e.getTarget(); + this.enableCommand(request); + }, + + /** + * Triggered when request is completed normally + * @param e {qx.event.type.Event} The event + */ + requestCompleted : function(e){ + var request = e.getTarget(); + this.disableCommand(request); + }, + + /** + * Triggered when request is completed abnormally + * @param e {qx.event.type.Event} The event + */ + requestTerminated : function(e){ + var request = e.getTarget(); + var errorType = e.getType(); + this.disableCommand(request); + var message = ""; + if(errorType == "aborted"){ + message = "Request aborted by user"; + }else if(errorType == "failed"){ + message = "Request failed!"; + }else if(errorType == "timeout"){ + message = "Request timed out!"; + } + this.error(message); + }, + + /** + * Triggered by a request creation. Update the GUI parts according to its status. + * @param request {qx.io.remote.Request} The current Request + */ + disableCommand : function(request){ + this.command.setEnabled(false); + if(request.getUserData("iLoadStatusables")){ + this.updateGuiParts(request.getUserData("iLoadStatusables"), false); + } + var listener = request.getUserData("listener"); + if(listener){ + this.command.removeListener("execute", listener); + } + }, + + /** + * Triggered by a request ending. Update the GUI parts according to its status. + * @param request {qx.io.remote.Request} The current Request + */ + enableCommand : function(request){ + this.command.setEnabled(true); + if(request.getUserData("iLoadStatusables")){ + this.updateGuiParts(request.getUserData("iLoadStatusables"), true); + } + qx.ui.core.queue.Manager.flush(); + var listener = request.abort; + request.setUserData("listener", listener); + this.command.addListener("execute", listener, request); + }, + + /** + * Update the ILoadStatusable implementations + * @param iLoadStatusables {Array} An array of ILoadStatusable + * @param loadStatus {Boolean} The current status of a request + */ + updateGuiParts : function(iLoadStatusables, loadStatus){ + for(var i=0;igenerate.py test to generate a testrunner application + * and open it from test/index.html + * + * The methods that contain the tests are instance methods with a + * test prefix. You can create an arbitrary number of test + * classes like this one. They can be organized in a regular class hierarchy, + * i.e. using deeper namespaces and a corresponding file structure within the + * test folder. + */ +qx.Class.define("org.argeo.ria.test.DemoTest", +{ + extend : qx.dev.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** + * Here are some simple tests + */ + testSimple : function() + { + this.assertEquals(4, 3+1, "This should never fail!"); + this.assertFalse(false, "Can false be true?!"); + }, + + /** + * Here are some more advanced tests + */ + testAdvanced: function () + { + var a = 3; + var b = a; + this.assertIdentical(a, b, "A rose by any other name is still a rose"); + this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!"); + } + } +}); diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/test/__init__.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/test/__init__.js new file mode 100644 index 000000000..6700c72d8 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/test/__init__.js @@ -0,0 +1,4 @@ +/** + * Unit tests to be executed by the TestRunner application. + * + */ \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/util/Element.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/util/Element.js new file mode 100644 index 000000000..23df026c2 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/util/Element.js @@ -0,0 +1,177 @@ +/** + * Cross browser XML Element API + * + * Overrides the Qooxdoo qx.xml.Element to handle the namespace prefixes + * + * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/81f3de54-3b79-46dc-8e01-73ca2d94cdb5.asp + * http://developer.mozilla.org/en/docs/Parsing_and_serializing_XML + */ +qx.Class.define("org.argeo.ria.util.Element", +{ + + statics : + { + + DEFAULT_NAMESPACE_MAP : null, + + /** + * Selects the first XmlNode that matches the XPath expression. + * + * @param element {Element | Document} root element for the search + * @param query {String} XPath query + * @param NSMap (Object) A map matching namespace prefixes to namespace URIS; + * @return {Element} first matching element + * @signature function(element, query, NSMap) + */ + selectSingleNode : qx.core.Variant.select("qx.client", + { + "mshtml|opera": function(element, query, NSMap) { + NSMap = NSMap || org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP; + if(NSMap){ + var namespaces = []; + var i=0; + for(var prefix in NSMap){ + namespaces[i] = 'xmlns:'+prefix+'="'+NSMap[prefix]+'"'; + i++; + } + var doc = element.ownerDocument || element; + doc.setProperty('SelectionNamespaces', namespaces.join(" ")); + } + try{ + return element.selectSingleNode(query); + }catch(err){} + }, + + "default": function(element, query, NSMap) + { + NSMap = NSMap || org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP; + if(!this.__xpe) { + this.__xpe = new XPathEvaluator(); + } + + var xpe = this.__xpe; + + try { + var resolver; + if(NSMap){ + resolver = function(prefix){ + return NSMap[prefix] || null; + } + }else{ + resolver = xpe.createNSResolver(element); + } + //return xpe.evaluate(query, element, xpe.createNSResolver(element), XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; + return xpe.evaluate(query, element, resolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; + } catch(err) { + throw new Error("selectSingleNode: query: " + query + ", element: " + element + ", error: " + err); + } + } + }), + + + /** + * Selects a list of nodes matching the XPath expression. + * + * @param element {Element | Document} root element for the search + * @param query {String} XPath query + * @param NSMap {Map} Mapping between namespaces prefixes and URI. + * @return {Element[]} List of matching elements + * @signature function(element, query, NSMap) + */ + selectNodes : qx.core.Variant.select("qx.client", + { + "mshtml|opera": function(element, query, NSMap) { + NSMap = NSMap || org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP; + if(NSMap){ + var namespaces = []; + var i=0; + for(var prefix in NSMap){ + namespaces[i] = 'xmlns:'+prefix+'="'+NSMap[prefix]+'"'; + i++; + } + var doc = element.ownerDocument || element; + doc.setProperty('SelectionNamespaces', namespaces.join(" ")); + } + return element.selectNodes(query); + }, + + "default": function(element, query, NSMap) + { + NSMap = NSMap || org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP; + var xpe = this.__xpe; + + if(!xpe) { + this.__xpe = xpe = new XPathEvaluator(); + } + + try { + var resolver; + if(NSMap){ + resolver = function(prefix){ + return NSMap[prefix] || null; + } + }else{ + resolver = xpe.createNSResolver(element); + } + //var result = xpe.evaluate(query, element, xpe.createNSResolver(element), XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + var result = xpe.evaluate(query, element, resolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + } catch(err) { + throw new Error("selectNodes: query: " + query + ", element: " + element + ", error: " + err); + } + + var nodes = []; + for (var i=0; ihttp://www.w3.org/1999/xhtml. + * @param tagname {String} the tagname to look for + * @return {Element[]} a list of found elements in the order they appear in the tree. + * @signature function(element, namespaceURI, tagname) + */ + getElementsByTagNameNS : qx.core.Variant.select("qx.client", + { + "mshtml": function(element, namespaceURI, tagname) + { + var doc = element.ownerDocument || element; + + doc.setProperty("SelectionLanguage", "XPath"); + doc.setProperty("SelectionNamespaces", "xmlns:ns='" + namespaceURI + "'"); + + return qx.xml.Element.selectNodes(element, 'descendant-or-self::ns:' + tagname); + }, + + "default": function(element, namespaceURI, tagname) { + return element.getElementsByTagNameNS(namespaceURI, tagname); + } + }), + + + /** + * Selects the first XmlNode that matches the XPath expression and returns the text content of the element + * + * @param element {Element|Document} root element for the search + * @param query {String} XPath query + * @param NSMap {Object} Mapping between NS prefix / uri + * @return {String} the joined text content of the found element or null if not appropriate. + * @signature function(element, query) + */ + getSingleNodeText : function(element, query, NSMap) + { + NSMap = NSMap || org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP; + var node = org.argeo.ria.util.Element.selectSingleNode(element, query, NSMap); + return qx.dom.Node.getText(node); + } + } +}); diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/util/TreeDataCellRenderer.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/util/TreeDataCellRenderer.js new file mode 100644 index 000000000..e11a85b99 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/util/TreeDataCellRenderer.js @@ -0,0 +1,665 @@ +/* ************************************************************************ + + qooxdoo - the new era of web development + + http://qooxdoo.org + + Copyright: + 2007 Derrell Lipman + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Derrell Lipman (derrell) + * David Perez Carmona (david-perez) + +************************************************************************ */ + +/* ************************************************************************ + +#require(qx.theme.Modern) +#require(qx.theme.Classic) +#require(qx.log.Logger) + +************************************************************************ */ + +/** + * A data cell renderer for the tree column of a simple tree + */ +qx.Class.define("org.argeo.ria.util.TreeDataCellRenderer", +{ + extend : qx.ui.treevirtual.SimpleTreeDataCellRenderer, + + + construct : function() + { + this.base(arguments); + + this.__am = qx.util.AliasManager.getInstance(); + this.__rm = qx.util.ResourceManager; + this.__tm = qx.theme.manager.Appearance.getInstance(); + + // Base URL used for indentation + this.BLANK = this.__rm.toUri(this.__am.resolve("static/blank.gif")); + }, + + + statics : + { + __icon : { } + }, + + + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + // overridden + _getCellStyle : function(cellInfo) + { + var node = cellInfo.value; + + // Return the style for the div for the cell. If there's cell-specific + // style information provided, append it. + var html = + this.base(arguments, cellInfo) + + (node.cellStyle ? node.cellStyle + ";" : ""); + return html; + }, + + // overridden + _getContentHtml : function(cellInfo) + { + var html = ""; + + // Horizontal position + var pos = 0; + + // If needed, add extra content before indentation + var extra = this._addExtraContentBeforeIndentation(cellInfo, pos); + html += extra.html; + pos = extra.pos; + + // Add the indentation (optionally with tree lines) + var indentation = this._addIndentation(cellInfo, pos); + html += indentation.html + pos = indentation.pos; + + // If needed, add extra content before icon + extra = this._addExtraContentBeforeIcon(cellInfo, pos); + html += extra.html; + pos = extra.pos; + + // Add the node icon + var icon = this._addIcon(cellInfo, pos); + html += icon.html; + pos = icon.pos; + + // If needed, add extra content before label + extra = this._addExtraContentBeforeLabel(cellInfo, pos); + html += extra.html; + pos = extra.pos; + + // Add the node's label + html += this._addLabel(cellInfo, pos); + + return html; + }, + + /** + * Add an image to the tree. This might be a visible icon or it may be + * part of the indentation. + * + * @param imageInfo {Map} + * How to display the image. It optionally includes any of the + * following: + *
+ *
position {Map}
+ *
+ * If provided, a div is created to hold the image. The div's top, + * right, bottom, left, width, and/or height may be specified with + * members of this map. Each is expected to be an integer value. + *
+ *
imageWidth, imageHeight
+ *
+ * The image's width and height. These are used only if both are + * specified. + *
+ *
+ * + * @return {String} + * The html for this image, possibly with a surrounding div (see + * 'position', above). + */ + _addImage : function(imageInfo) + { + var html = []; + + // Resolve the URI + var source = this.__rm.toUri(this.__am.resolve(imageInfo.url)); + + // If we've been given positioning attributes, enclose image in a div + if (imageInfo.position) + { + var pos = imageInfo.position; + + html.push('
'); + } + + // Don't use an image tag. They render differently in Firefox and IE7 + // even if both are enclosed in a div specified as content box. Instead, + // add the image as the background image of a div. + html.push('
 
'); + + if (imageInfo.position) + { + html.push('
'); + } + + return html.join(""); + }, + + + /** + * Add the indentation for this node of the tree. + * + * The indentation optionally includes tree lines. Whether tree lines are + * used depends on (a) the properties 'useTreeLines' and + * 'excludeFirstLevelTreelines' within this class; and (b) the widget + * theme in use (some themes don't support tree lines). + * + * @param cellInfo {Map} The information about the cell. + * See {@link qx.ui.table.cellrenderer.Abstract#createDataCellHtml}. + * + * @param pos {Integer} + * The position from the left edge of the column at which to render this + * item. + * + * @return {Map} + * The returned map contains an 'html' member which contains the html for + * the indentation, and a 'pos' member which is the starting position + * plus the width of the indentation. + */ + _addIndentation : function(cellInfo, pos) + { + var node = cellInfo.value; + var imageData; + var html = ""; + + // Generate the indentation. Obtain icon determination values once + // rather than each time through the loop. + var bUseTreeLines = this.getUseTreeLines(); + var bExcludeFirstLevelTreeLines = this.getExcludeFirstLevelTreeLines(); + var bAlwaysShowOpenCloseSymbol = this.getAlwaysShowOpenCloseSymbol(); + + for (var i=0; i' + + '' + + node.label + + '' + + ''; + + return html; + }, + + /** + * Adds extra content just before the indentation. + * + * @param cellInfo {Map} The information about the cell. + * See {@link qx.ui.table.cellrenderer.Abstract#createDataCellHtml}. + * + * @param pos {Integer} + * The position from the left edge of the column at which to render this + * item. + * + * @return {Map} + * The returned map contains an 'html' member which contains the html for + * the indentation, and a 'pos' member which is the starting position + * plus the width of the indentation. + */ + _addExtraContentBeforeIndentation : function(cellInfo, pos) + { + return { html: '', pos: pos }; + }, + + /** + * Adds extra content just before the icon. + * + * @param cellInfo {Map} The information about the cell. + * See {@link qx.ui.table.cellrenderer.Abstract#createDataCellHtml}. + * + * @param pos {Integer} + * The position from the left edge of the column at which to render this + * item. + * + * @return {Map} + * The returned map contains an 'html' member which contains the html for + * the indentation, and a 'pos' member which is the starting position + * plus the width of the indentation. + */ + _addExtraContentBeforeIcon : function(cellInfo, pos) + { + return { html: '', pos: pos }; + }, + + /** + * Adds extra content just before the label. + * + * @param cellInfo {Map} The information about the cell. + * See {@link qx.ui.table.cellrenderer.Abstract#createDataCellHtml}. + * + * @param pos {Integer} + * The position from the left edge of the column at which to render this + * item. + * + * @return {Map} + * The returned map contains an 'html' member which contains the html for + * the indentation, and a 'pos' member which is the starting position + * plus the width of the indentation. + */ + _addExtraContentBeforeLabel : function(cellInfo, pos) + { + return { html: '', pos: pos }; + }, + + + /** + * Determine the symbol to use for indentation of a tree row, at a + * particular column. The indentation to use may be just white space or + * may be a tree line. Tree lines come in numerous varieties, so the + * appropriate one is selected. + * + * @type member + * + * @param column {Integer} + * The column of indentation being requested, zero-relative + * + * @param node {Node} + * The node being displayed in the row. The properties of a node are + * described in {@link qx.ui.treevirtual.SimpleTreeDataModel} + * + * @param bUseTreeLines {Boolean} + * Whether to find an appropriate tree line icon, or simply provide + * white space. + * + * @param bAlwaysShowOpenCloseSymbol {Boolean} + * Whether to display the open/close icon for a node even if it has no + * children. + * + * @param bExcludeFirstLevelTreeLines {Boolean} + * If bUseTreeLines is enabled, then further filtering of the left-most + * tree line may be specified here. If true then the left-most + * tree line, between top-level siblings, will not be displayed. + * If false, then the left-most tree line wiill be displayed + * just like all of the other tree lines. + * + * @return {var} TODOC + */ + _getIndentSymbol : function(column, + node, + bUseTreeLines, + bAlwaysShowOpenCloseSymbol, + bExcludeFirstLevelTreeLines) + { + var STDCR = org.argeo.ria.util.TreeDataCellRenderer; + + // If we're in column 0 and excludeFirstLevelTreeLines is enabled, then + // we treat this as if no tree lines were requested. + if (column == 0 && bExcludeFirstLevelTreeLines) + { + bUseTreeLines = false; + } + + // If we're not on the final column... + if (column < node.level - 1) + { + // then return either a line or a blank icon, depending on + // bUseTreeLines + return (bUseTreeLines && ! node.lastChild[column] + ? STDCR.__icon.line + : { icon : this.BLANK }); + } + + var bLastChild = node.lastChild[node.lastChild.length - 1]; + + // Is this a branch node that does not have the open/close button hidden? + if (node.type == qx.ui.treevirtual.SimpleTreeDataModel.Type.BRANCH && + ! node.bHideOpenClose) + { + // Does this node have any children, or do we always want the + // open/close symbol to be shown? + if (node.children.length > 0 || bAlwaysShowOpenCloseSymbol) + { + // If we're not showing tree lines... + if (!bUseTreeLines) + { + // ... then just use a expand or contract + return (node.bOpened + ? STDCR.__icon.contract + : STDCR.__icon.expand); + } + + // Are we looking at a top-level, first child of its parent? + if (column == 0 && node.bFirstChild) + { + // Yup. If it's also a last child... + if (bLastChild) + { + // ... then use no tree lines. + return (node.bOpened + ? STDCR.__icon.onlyContract + : STDCR.__icon.onlyExpand); + } + else + { + // otherwise, use descender lines but no ascender. + return (node.bOpened + ? STDCR.__icon.startContract + : STDCR.__icon.startExpand); + } + } + + // It's not a top-level, first child. Is this the last child of its + // parent? + if (bLastChild) + { + // Yup. Return an ending expand or contract. + return (node.bOpened + ? STDCR.__icon.endContract + : STDCR.__icon.endExpand); + } + + // Otherwise, return a crossing expand or contract. + return (node.bOpened + ? STDCR.__icon.crossContract + : STDCR.__icon.crossExpand); + } + } + + // This node does not have any children. Return an end or cross, if + // we're using tree lines. + if (bUseTreeLines) + { + // If this is a child of the root node... + if (node.parentNodeId == 0) + { + // If this is the only child... + if (bLastChild && node.bFirstChild) + { + // ... then return a blank. + return { icon : this.BLANK }; + } + + // Otherwise, if this is the last child... + if (bLastChild) + { + // ... then return an end line. + return STDCR.__icon.end; + } + + // Otherwise if this is the first child... + if (node.bFirstChild) + { + // ... then return a start line. + return STDCR.__icon.startContract; + } + } + + // If this is a last child, return and ending line; otherwise cross. + return (bLastChild + ? STDCR.__icon.end + : STDCR.__icon.cross); + } + + return { icon : this.BLANK }; + } + }, + + defer : function() + { + // Ensure that the theme is initialized + qx.theme.manager.Meta.getInstance().initialize(); + + var STDCR = org.argeo.ria.util.TreeDataCellRenderer; + + var ImageLoader = qx.io2.ImageLoader; + + var am = qx.util.AliasManager.getInstance(); + var rm = qx.util.ResourceManager; + var tm = qx.theme.manager.Appearance.getInstance(); + + var loadImage = function(f) + { + ImageLoader.load(rm.toUri(am.resolve(f))); + }; + + STDCR.__icon.line = tm.styleFrom("treevirtual-line"); + loadImage(STDCR.__icon.line.icon); + + STDCR.__icon.contract = tm.styleFrom("treevirtual-contract"); + loadImage(STDCR.__icon.contract.icon); + + STDCR.__icon.expand = tm.styleFrom("treevirtual-expand"); + loadImage(STDCR.__icon.expand.icon); + + STDCR.__icon.onlyContract = tm.styleFrom("treevirtual-only-contract"); + loadImage(STDCR.__icon.onlyContract.icon); + + STDCR.__icon.onlyExpand = tm.styleFrom("treevirtual-only-expand"); + loadImage(STDCR.__icon.onlyExpand.icon); + + STDCR.__icon.startContract = tm.styleFrom("treevirtual-start-contract"); + loadImage(STDCR.__icon.startContract.icon); + + STDCR.__icon.startExpand = tm.styleFrom("treevirtual-start-expand"); + loadImage(STDCR.__icon.startExpand.icon); + + STDCR.__icon.endContract = tm.styleFrom("treevirtual-end-contract"); + loadImage(STDCR.__icon.endContract.icon); + + STDCR.__icon.endExpand = tm.styleFrom("treevirtual-end-expand"); + loadImage(STDCR.__icon.endExpand.icon); + + STDCR.__icon.crossContract = tm.styleFrom("treevirtual-cross-contract"); + loadImage(STDCR.__icon.crossContract.icon); + + STDCR.__icon.crossExpand = tm.styleFrom("treevirtual-cross-expand"); + loadImage(STDCR.__icon.crossExpand.icon); + + STDCR.__icon.end = tm.styleFrom("treevirtual-end"); + loadImage(STDCR.__icon.end.icon); + + STDCR.__icon.cross = tm.styleFrom("treevirtual-cross"); + loadImage(STDCR.__icon.cross.icon); + }, + + destruct : function() + { + this._disposeFields( + "__am", + "__rm", + "__tm", + "BLANK"); + } +}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/util/__init__.js b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/util/__init__.js new file mode 100644 index 000000000..d4ba4d145 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/class/org/argeo/ria/util/__init__.js @@ -0,0 +1,5 @@ +/** + * Various utilitary classes, especially qooxdoo framework extensions + * to fix various bugs or missing features. + * + */ \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/index.html b/server/org.argeo.slc.ria/src/argeo-ria-src/index.html new file mode 100644 index 000000000..4b3e26a01 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/index.html @@ -0,0 +1,8 @@ + + + + + Slc Webui + + + diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/ajax-loader.gif b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/ajax-loader.gif new file mode 100644 index 000000000..df3303d53 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/ajax-loader.gif differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/dialog-ok.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/dialog-ok.png new file mode 100644 index 000000000..1ebbe39f0 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/dialog-ok.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/document-open-recent.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/document-open-recent.png new file mode 100644 index 000000000..538cc69ed Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/document-open-recent.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/document-open.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/document-open.png new file mode 100644 index 000000000..84272f836 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/document-open.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/document-print.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/document-print.png new file mode 100644 index 000000000..911aed3fa Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/document-print.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/edit-copy.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/edit-copy.png new file mode 100644 index 000000000..d6e166904 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/edit-copy.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/edit-delete.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/edit-delete.png new file mode 100644 index 000000000..9ff19b4d6 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/edit-delete.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/flag.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/flag.png new file mode 100644 index 000000000..3240b29d5 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/flag.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/folder-new.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/folder-new.png new file mode 100644 index 000000000..edff26f02 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/folder-new.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/folder.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/folder.png new file mode 100644 index 000000000..6937ed4a3 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/folder.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-bottom.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-bottom.png new file mode 100644 index 000000000..3a1740612 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-bottom.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-down.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-down.png new file mode 100644 index 000000000..e48bf5b44 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-down.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-left.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-left.png new file mode 100644 index 000000000..cd5862039 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-left.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-right.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-right.png new file mode 100644 index 000000000..c001c92c1 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-right.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-top.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-top.png new file mode 100644 index 000000000..f32de8dfd Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/go-top.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/help-about.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/help-about.png new file mode 100644 index 000000000..f2d100697 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/help-about.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/help-contents.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/help-contents.png new file mode 100644 index 000000000..c990916d6 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/help-contents.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/list-add.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/list-add.png new file mode 100644 index 000000000..0478b7d5c Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/list-add.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/media-playback-start-32.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/media-playback-start-32.png new file mode 100644 index 000000000..8248f32fc Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/media-playback-start-32.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/media-playback-start.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/media-playback-start.png new file mode 100644 index 000000000..4358164a2 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/media-playback-start.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-pdf.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-pdf.png new file mode 100644 index 000000000..27faad6fc Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-pdf.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-xls.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-xls.png new file mode 100644 index 000000000..126f1c878 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-xls.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-xml.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-xml.png new file mode 100644 index 000000000..bc00f51a1 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-xml.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-xsl.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-xsl.png new file mode 100644 index 000000000..a4acb09cb Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/mime-xsl.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/office-chart.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/office-chart.png new file mode 100644 index 000000000..c6c290cf2 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/office-chart.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/process-stop.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/process-stop.png new file mode 100644 index 000000000..fe3aba281 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/process-stop.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/system-shutdown.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/system-shutdown.png new file mode 100644 index 000000000..f58089d4f Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/system-shutdown.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/test.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/test.png new file mode 100644 index 000000000..ef360cdb4 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/test.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/utilities-terminal.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/utilities-terminal.png new file mode 100644 index 000000000..55a83d2d3 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/utilities-terminal.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/view-pane-tree.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/view-pane-tree.png new file mode 100644 index 000000000..7515fc9b2 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/view-pane-tree.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/view-refresh.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/view-refresh.png new file mode 100644 index 000000000..bb3803b07 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/view-refresh.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/window-close.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/window-close.png new file mode 100644 index 000000000..d4f48146e Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/window-close.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/zoom-fit-best.png b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/zoom-fit-best.png new file mode 100644 index 000000000..30b111331 Binary files /dev/null and b/server/org.argeo.slc.ria/src/argeo-ria-src/resource/slc/zoom-fit-best.png differ diff --git a/server/org.argeo.slc.ria/src/argeo-ria-src/translation/readme.txt b/server/org.argeo.slc.ria/src/argeo-ria-src/translation/readme.txt new file mode 100644 index 000000000..66975e60e --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-src/translation/readme.txt @@ -0,0 +1,3 @@ +This directory will contain translation (.po) files once you run the +'translation' job in your project. + diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/Manifest.json b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/Manifest.json deleted file mode 100644 index 9c6d5e8a4..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/Manifest.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "info" : - { - "name" : "org.argeo.ria", - - "summary" : "Slc Webui", - "description" : "Argeo Rich Internet Application", - - "homepage" : "http://www.argeo.org/", - - "license" : "LGPL", - "authors" : - [ - { - "name" : "Charles du Jeu", - "email" : "charles.dujeu@gmail.com" - } - ], - - "version" : "trunk", - "qooxdoo-versions": ["0.8"] - }, - - "provides" : - { - "namespace" : "org.argeo.ria", - "encoding" : "utf-8", - "class" : "class", - "resource" : "resource", - "translation" : "translation", - "type" : "application" - } -} - diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/Application.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/Application.js deleted file mode 100644 index a1e5901f1..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/Application.js +++ /dev/null @@ -1,278 +0,0 @@ -/* ************************************************************************ - - Copyright: 2008 Argeo - - License: LGPL - - Authors: Charles du Jeu - -************************************************************************ */ - -/* ************************************************************************ - -#asset(slc/*) - -************************************************************************ */ - -/** - * This is the main application class of an Argeo RIA. - */ -qx.Class.define("org.argeo.ria.Application", -{ - extend : qx.application.Standalone, - - statics : { - INSTANCE : null - }, - - properties : { - /** - * Available perspective detected in the current compilation. - */ - perspectives : { - check : "Map", - init : {} - }, - /** - * Currently layouted perspective label - */ - activePerspectiveName : { - check : "String", - init : "" - }, - /** - * Currently layouted perspective. - */ - activePerspective : { - init : null - }, - /** - * Basic command associated to the application, applicable to all perspectives. - */ - commandsDefinitions : { - init : { - "stop" : { - label : "Stop", - icon : "resource/slc/process-stop.png", - shortcut : "Control+s", - enabled : false, - menu : null, - toolbar : "list", - callback : function(e){}, - command : null - }, - "switchperspective" : { - label : "Switch Perspective", - icon : "resource/slc/view-pane-tree.png", - shortcut : "", - enabled : true, - menu : "View", - toolbar : false, - submenu : [], - submenuCallback : function(commandId){ - // Defer execution to assure that the submenu is closed - // before it is rebuilt. - qx.event.Timer.once(function(){ - org.argeo.ria.Application.INSTANCE.loadPerspective(commandId); - }, this, 10); - }, - callback : function(e){}, - command : null - }, - "log" : { - label : "Show Console", - icon : "resource/slc/help-contents.png", - shortcut : "", - enabled : true, - menu : "View", - menuPosition: "last", - toolbar : false, - callback : function(e){ - org.argeo.ria.components.Logger.getInstance().toggle(); - }, - command : null - }, - "help" : { - label : "About...", - icon : "resource/slc/help-about.png", - shortcut : "Control+h", - enabled : true, - menu : "View", - toolbar : false, - callback : function(e){ - var win = new org.argeo.ria.components.Modal("About SLC", null, "SLC is a product from Argeo."); - win.attachAndShow(); - }, - command : null - } - } - } - }, - - members : - { - /** - * This method contains the initial application code and gets called - * during startup of the application - */ - main : function() - { - // Call super class - this.base(arguments); - this.self(arguments).INSTANCE = this; - this.views = {}; - - var viewsManager = org.argeo.ria.components.ViewsManager.getInstance(); - viewsManager.setApplicationRoot(this.getRoot()); - - /* - var appli = this; - qx.bom.Event.addNativeListener(window, "unload", function(){ - // TODO : Close perspective if one is open. - if(appli.getActivePerspective()){ - alert(appli.getActivePerspective()); - appli.getActivePerspective().remove(org.argeo.ria.components.ViewsManager.getInstance()); - } - }); - */ - // Enable logging in debug variant - if (qx.core.Variant.isSet("qx.debug", "on")) - { - qx.log.appender.Native; - qx.log.appender.Console; - } - var winLogger = org.argeo.ria.components.Logger.getInstance(); - this.getRoot().add(winLogger); - qx.log.Logger.register(winLogger); - - // Main layout - var layout = new qx.ui.layout.VBox(); - var container = new qx.ui.container.Composite(layout); - viewsManager.setViewPanesContainer(container); - // Document is the application root - this.getRoot().add(container, {left:0,right:0,top:0,bottom:0}); - - // Find available perspectives - var allPerspectives = {}; - for(var key in qx.Bootstrap.$$registry){ - if(qx.Class.hasInterface(qx.Bootstrap.$$registry[key], org.argeo.ria.components.IPerspective)){ - allPerspectives[key] = qx.Bootstrap.$$registry[key]; - } - } - var perspectiveNumber = qx.lang.Object.getLength(allPerspectives); - if(!perspectiveNumber){ - this.error("Cannot find a perspective for startup!"); - return; - } - this.setPerspectives(allPerspectives); - // Choose startup perspective, delete switch menu if only one perspective. - if(perspectiveNumber <= 1){ - delete this.getCommandsDefinitions()["switchperspective"]; - this.setActivePerspectiveName(qx.lang.Object.getKeys(allPerspectives)[0]); - } - else{ - var startupSetting; - try{ - startupSetting = qx.core.Setting.get("ria.StartupPerspective"); - }catch(e){} - if(startupSetting && allPerspectives[startupSetting]){ - this.setActivePerspectiveName(startupSetting); - }else{ - this.setActivePerspectiveName(qx.lang.Object.getKeys(allPerspectives)[0]); - } - this.rebuildPerspectiveMenus(); - } - - var menuBar = new qx.ui.menubar.MenuBar(); - var toolbar = new qx.ui.toolbar.ToolBar(); - var commandManager = org.argeo.ria.event.CommandsManager.getInstance(); - commandManager.init(this.getCommandsDefinitions()); - commandManager.createCommands(); - commandManager.registerMenuBar(menuBar); - commandManager.registerToolBar(toolbar); - toolbar.setShow("both"); - commandManager.addToolbarContextMenu(toolbar); - - var stopCommand = commandManager.getCommandById("stop"); - var serviceManager = org.argeo.ria.remote.RequestManager.getInstance(); - serviceManager.setStopCommand(stopCommand); - - container.add(menuBar); - container.add(toolbar); - - this.loadPerspective(); - }, - - /** - * Load a given perspective by its name. - * @param perspectiveName {String} Perspective to load - */ - loadPerspective : function(perspectiveName){ - if(perspectiveName){ - this.setActivePerspectiveName(perspectiveName); - this.rebuildPerspectiveMenus(); - }else{ - perspectiveName = this.getActivePerspectiveName(); - } - var viewsManager = org.argeo.ria.components.ViewsManager.getInstance(); - if(this.getActivePerspective()){ - this.getActivePerspective().remove(viewsManager); - } - var allPerspectives = this.getPerspectives(); - var perspectiveClass = allPerspectives[perspectiveName]; - if(!perspectiveClass){ - this.error("Cannot find class for startup perspective : "+perspectiveName); - return; - } - var perspective = new perspectiveClass; - perspective.initViewPanes(viewsManager); - perspective.initViews(viewsManager); - this.setActivePerspective(perspective); - }, - - /** - * After switching perspective, call this function to rebuild menu with the right selected. - */ - rebuildPerspectiveMenus : function(){ - var switchCommand = this.getCommandsDefinitions()["switchperspective"]; - switchCommand.submenu = []; - var allPerspectives = this.getPerspectives(); - for(var key in allPerspectives){ - switchCommand.submenu.push({ - "label":(allPerspectives[key].LABEL || key)+(key==this.getActivePerspectiveName()?" (current)":""), - "icon" :(allPerspectives[key].ICON || null), - "commandId":key, - "disabled" : (key==this.getActivePerspectiveName()?true:false) - }); - } - if(switchCommand.command){ // Command already created : force reload - switchCommand.command.clearMenus(); - switchCommand.command.setMenu(switchCommand.submenu); - } - }, - - /** - * Specific action of calling an external URL without triggering the "close()" method - * of Application. - * @param hrefValue {String} A download url that should reply with specific "attachment" header to avoid leaving the application. - */ - javascriptDownloadLocation: function(hrefValue){ - this.interruptClose = true; - document.location.href = hrefValue; - this.interruptClose = false; - }, - - /** - * Called at Application ending (closing the browser). - */ - close : function(){ - if(this.interruptClose) return ; - if(this.getActivePerspective()){ - this.getActivePerspective().remove(org.argeo.ria.components.ViewsManager.getInstance()); - } - this.base(arguments); - - } - - } -}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/__init__.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/__init__.js deleted file mode 100644 index 5ff6b2127..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/__init__.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Generic package for the Argeo Rich Internet Application based on qooxdoo (www.qooxdoo.org). - * This is an empty application in itself, since it requires at least a basic implementation to be useful. - * - * - * The skeleton of an ArgeoRIA is the following : - * - * + GUI Application containing a menubar, a toolbar, and an empty space for custom Perspective. - * - * + Various managers : org.argeo.ria.components.ViewsManager for manipulating IView (VIEW), org.argeo.ria.event.CommandsManager - * for automatically wiring commands inside the application (CONTROLLER), and org.argeo.ria.remote.RequestManager for accessing the data (MODEL). - * - * + A simple configuration will allow to start your own Perspective inside the application. - * - */ \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js deleted file mode 100644 index 6841b700d..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js +++ /dev/null @@ -1,150 +0,0 @@ -/** - * A "dynamic" implementation of the standard TreeFolder class. - * - */ -qx.Class.define("org.argeo.ria.components.DynamicTreeFolder", { - extend : qx.ui.tree.TreeFolder, - - properties : { - /** - * The current state of the folder, usually "empty" => "loading" => "loaded" - */ - "state" : { - check : "String", - init : "empty", - apply : "_applyState" - }, - /** - * String to display as a child node during loading - */ - "loadingString" : { - check : "String", - init : "Loading..." - }, - /** - * Function that will load the children of this folder - */ - "loader" : { - check : "Function", - init : function(treeFolder){treeFolder.setLoaded();} - }, - /** - * Optionnal data describing the "drag" behaviour of the created children. - * First level is "file" or "folder", and for each of them, supported keys are "type" and "action". - */ - "dragData": { - check : "Map", - init : {} - } - }, - - /** - * Creates a new instance of DynamicTreeFolder - * @param label {String} Label of the folder - * @param loader {Function} Function that will load the children - * @param loadingString {String} String to display as a child node during loading - * @param dragData {Map} Optionnal data describing the "drag" behaviour of the created children. - */ - construct : function(label, loader, loadingString, dragData){ - this.base(arguments, label); - if(loader) this.setLoader(loader); - if(loadingString) this.setLoadingString(loadingString); - if(dragData) this.setDragData(dragData); - this.addListener("changeOpen", function(e){ - if(e.getData() && this.getState() == "loading"){ - this.load(); - } - }, this); - this.setState("loading"); - }, - - members : { - /** - * Add an item to the folder - * @param varargs {Mixed} One or many children to add - */ - add : function(varargs){ - this.base(arguments, varargs); - for (var i=0, l=arguments.length; iin charge of your panel to the main application zone - * (just below the toolbar). - * - * @param viewsManager {org.argeo.components.ViewsManager} the pane manager - * - */ - initViewPanes : function(viewsManager){return true;}, - /** - * Once the zones are available and initialized, initialize the views here - * and add them to viewPanes. Trigger initial data loading, etc. - * - * @param viewsManager {org.argeo.components.ViewsManager} the pane manager - * - */ - initViews : function(viewsManager){return true}, - /** - * Remove and destroy the perspective - * @param viewsManager {org.argeo.components.ViewsManager} the pane manager - */ - remove : function(viewsManager){return true} - } -}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/IView.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/IView.js deleted file mode 100644 index 4607788ee..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/IView.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Interface for a standard 'view' of an argeo RIA. A view is an independant applet that - * will be integrated inside a ViewPane. - * If this view is to implement a selection (a list, a tree, etc) that will trigger changes on commands, - * it must trigger a viewSelection#changeSelection event. - * - * The typical lifecycle of an IView will be the following : - *
+ init(viewPane) : initialize basic GUI in the viewPane - *
+ getCommands() : wire the commands and add them to the toolbars/menubars - *
+ load(data) : loads the data itself. - * - * @author Charles du Jeu - */ -qx.Interface.define("org.argeo.ria.components.IView", { - - properties : { - /** - * The commands definition Map that will be automatically added and wired to the menubar and toolbar. - * See {@link org.argeo.ria.event.CommandsManager#definitions} for the keys to use for defining commands. - */ - commands : {}, - viewSelection : { - nullable:false, - check:"org.argeo.ria.components.ViewSelection" - }, - instanceId : {init:""}, - instanceLabel : {init:""} - }, - - members : { - /** - * The implementation should contain the GUI initialisation. - * This is the role of the manager to actually add the graphical component to the pane, - * so it's not necessary to do it here. - * @param viewPane {org.argeo.ria.components.ViewPane} The pane manager - * @param data {Mixed} Any object or data passed by the initiator of the view - * @return {Boolean} - */ - init : function(viewPane, data){return true;}, - /** - * The implementation should contain the real data loading (i.o. query...) - * @return {Boolean} - */ - load : function(){return true;}, - /** - * Whether this component is already contained in a scroller (return false) or not (return true). - * @return {Boolean} - */ - addScroll : function(){return true;}, - /** - * Called at destruction time - * Perform all the clean operations (stopping polling queries, etc.) - */ - close : function(){return true;} - } -}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/Logger.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/Logger.js deleted file mode 100644 index 33980a364..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/Logger.js +++ /dev/null @@ -1,128 +0,0 @@ -/** - * A modal window like console for the logs. - * Also opens a small alert window (qooxdoo, not native) on errors. - * - * @author : Charles du Jeu - */ -qx.Class.define("org.argeo.ria.components.Logger", -{ - type : "singleton", - extend : qx.ui.window.Window, - - construct : function(){ - this.base(arguments, "Logs", "resource/slc/help-contents.png"); - this.set({ - showMaximize : true, - showMinimize : false, - width: 550, - height: 300 - }); - this.setLayout(new qx.ui.layout.Dock(0,5)); - var buttonPane = new qx.ui.container.Composite(new qx.ui.layout.Canvas()); - var closeButton = new qx.ui.form.Button("Close"); - closeButton.addListener("execute", function(e){ - this.hide(); - }, this); - buttonPane.add(closeButton, {width:'20%',left:'40%'}); - this.add(buttonPane, {edge:'south'}); - this.setModal(false); - - var layout = new qx.ui.layout.VBox(2); - this._logPane = new qx.ui.container.Composite(layout); - var deco = new qx.ui.decoration.Single(1, 'solid', '#000000'); - deco.setBackgroundColor("#ffffff") - var scroller = new qx.ui.container.Scroll(this._logPane); - scroller.setDecorator(deco); - this.add(scroller, {edge:'center', width:'100%', height:'100%'}); - // Build style sheet content - var style = - [ - '.messages{font-size:0.9em}', - '.messages div{padding:0px 4px;}', - '.messages .offset{font-weight:bold;}', - '.messages .object{font-style:italic;}', - - '.messages .user-command{color:blue}', - '.messages .user-result{background:white}', - '.messages .user-error{background:#FFE2D5}', - '.messages .level-debug{background:white}', - '.messages .level-info{background:#DEEDFA}', - '.messages .level-warn{background:#FFF7D5}', - '.messages .level-error{background:#FFE2D5}', - '.messages .level-user{background:#E3EFE9}', - '.messages .type-string{color:black;font-weight:normal;}', - '.messages .type-number{color:#155791;font-weight:normal;}', - '.messages .type-boolean{color:#15BC91;font-weight:normal;}', - '.messages .type-array{color:#CC3E8A;font-weight:bold;}', - '.messages .type-map{color:#CC3E8A;font-weight:bold;}', - '.messages .type-key{color:#565656;font-style:italic}', - '.messages .type-class{color:#5F3E8A;font-weight:bold}', - '.messages .type-instance{color:#565656;font-weight:bold}', - '.messages .type-stringify{color:#565656;font-weight:bold}' - ]; - // Include stylesheet - qx.bom.Stylesheet.createElement(style.join("")); - - }, - - members : { - /** - * Adds a log in the GUI component. - * @param entry {Map} A log entry - */ - process : function(entry){ - var wrapper = qx.log.appender.Util.toHtml(entry); - var label = new qx.ui.basic.Label('
'+wrapper.innerHTML.replace(",","
")+'
'); - label.setRich(true); - if(entry.level == "error"){ - if(!this.alert){ - this.alert = new org.argeo.ria.components.Modal("Error"); - this.alert.setPersistent(true); - this.alert.addCloseButton(); - } - this.alert.addCenter(label.clone()); - this.alert.attachAndShow(); - }else if(entry.level == "info"){ - this.showLogAsPopup(label.clone()); - } - this._logPane.addAt(label, 0); - }, - /** - * Shows the GUI console and center it. - */ - toggle : function(){ - this.show(); - this.center(); - }, - - /** - * Show a given info log in a small popup right-top aligned. - * The popup will disappear after 5 seconds. - * @param content {qx.ui.basic.Label} The content of the popup to display - */ - showLogAsPopup:function(content){ - if(!this.popup){ - this.popup = new qx.ui.popup.Popup(new qx.ui.layout.Canvas()).set({ - backgroundColor: "#DFFAD3", - padding: [2, 4], - width: 350, - offset:0, - position: "right-top" - }); - } - this.popup.removeAll(); - this.popup.add(content); - var appRoot = org.argeo.ria.components.ViewsManager.getInstance().getApplicationRoot(); - appRoot.add(this.popup); - this.popup.show(); - this.popup.moveTo((qx.bom.Viewport.getWidth()-350), 0); - qx.event.Timer.once(function(){this.popup.hide();}, this, 5000); - } - }, - - destruct : function() - { - qx.log.Logger.unregister(this); - } - -}); diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/Modal.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/Modal.js deleted file mode 100644 index 3d2c2c81b..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/Modal.js +++ /dev/null @@ -1,161 +0,0 @@ -/** - * Generic modal popup window. - * It is layed out with a dock layout. When adding components to it, they are added as "center". - * @author Charles du Jeu - */ -qx.Class.define("org.argeo.ria.components.Modal", -{ - extend : qx.ui.window.Window, - - properties : { - persistent : { - check : "Boolean", - init : false - } - }, - - events : { - /** - * Triggered when the user clicks the "ok" button. - */ - "ok" : "qx.event.type.Event" - }, - /** - * - * @param caption {String} Title of the window - * @param icon {String} Icon of the window - * @param text {String} Default content of the window. - */ - construct : function(caption, icon, text){ - this.base(arguments, caption, icon); - this.set({ - showMaximize : false, - showMinimize : false, - width: 200, - height: 150 - }); - this.setLayout(new qx.ui.layout.Dock()); - this.setModal(true); - this.center(); - if(text){ - this.addLabel(text); - } - }, - - members : { - - addCenter : function(component){ - if(!this.getPersistent()){ - this.add(component, {edge : 'center', width:'100%'}); - }else{ - if(!this.centerScroller){ - this.centerScroller = new qx.ui.container.Composite(new qx.ui.layout.VBox(1)); - this.add(new qx.ui.container.Scroll(this.centerScroller), {edge : 'center', width:'100%', height:'100%'}); - } - this.centerScroller.add(component); - } - }, - - /** - * Display text inside the popup - * @param text {String} A string content for the popup - */ - addLabel:function(text){ - var label = new qx.ui.basic.Label(text); - label.setRich(true); - label.setTextAlign("center"); - this.addCenter(label); - this.addCloseButton(); - }, - /** - * Add a question and ok / cancel buttons - * @param text {String} The question to ask to the user - */ - addConfirm : function(text){ - var label = new qx.ui.basic.Label(text); - label.setRich(true); - label.setTextAlign("center"); - this.addCenter(label); - this.addOkCancel(); - }, - /** - * Display a component (panel) in the center of the popup - * @param panel {qx.ui.core.Widget} A gui component (will be set at width 100%). - */ - addContent: function(panel){ - this.addCenter(panel); - this.addCloseButton(); - }, - /** - * Automatically attach to the application root, then show. - */ - attachAndShow:function(){ - if(!this.attached){ - org.argeo.ria.components.ViewsManager.getInstance().getApplicationRoot().add(this); - this.attached = true; - } - this.show(); - }, - /** - * Adds a close button bottom-center aligned to the popup - */ - addCloseButton : function(){ - this.closeButton = new qx.ui.form.Button("Close"); - this.closeButton.addListener("execute", this._closeAndDestroy, this); - this.add(this.closeButton, {edge:'south'}); - }, - /** - * Adds two buttons bottom-center aligned (Ok and Cancel). - * Ok button has no listener by default, Cancel will close and destroy the popup. - */ - addOkCancel : function(){ - var buttonPane = new qx.ui.container.Composite(new qx.ui.layout.HBox(5, 'right')); - buttonPane.setAlignX("center"); - this.add(buttonPane, {edge:"south"}); - this.okButton = new qx.ui.form.Button("Ok"); - this.okButton.addListener("execute", function(e){ - this.fireEvent("ok"); - this._closeAndDestroy(); - }, this); - this.cancelButton = new qx.ui.form.Button("Cancel"); - this.cancelButton.addListener("execute", this._closeAndDestroy, this); - buttonPane.add(this.okButton); - buttonPane.add(this.cancelButton); - }, - /** - * Adds a prompt form to the popup : a question, followed by a text input. - * @param questionString {String} The question to ask to the user - * @param validationCallback {Function} Callback to apply : takes the text input value as unique argument. - * @param callbackContext {Object} Context for the callback, optional. - */ - makePromptForm:function(questionString, validationCallback, callbackContext){ - var label = new qx.ui.basic.Label(questionString); - label.setRich(true); - label.setTextAlign("center"); - this.add(label, {edge:'north'}); - var textField = new qx.ui.form.TextField(); - textField.setMarginTop(10); - textField.setMarginBottom(10); - this.add(textField, {edge:'center'}); - this.addOkCancel(); - if(callbackContext){ - validationCallback = qx.lang.Function.bind(validationCallback, callbackContext); - } - this.okButton.addListener("execute", function(e){ - var valid = validationCallback(textField.getValue()); - if(valid) this._closeAndDestroy(); - }, this); - }, - /** - * Close this modal window and destroy it. - */ - _closeAndDestroy : function(){ - this.hide(); - if(!this.getPersistent()){ - this.destroy(); - }else{ - if(this.centerScroller) this.centerScroller.removeAll(); - } - } - } -}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/TabbedViewPane.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/TabbedViewPane.js deleted file mode 100644 index 27742dd41..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/TabbedViewPane.js +++ /dev/null @@ -1,183 +0,0 @@ -/** - * A more elaborate views container than ViewPane, as it can handle multiple contents - * at once via a TabView. - * See {@link org.argeo.ria.components.ViewPane}. - */ -qx.Class.define("org.argeo.ria.components.TabbedViewPane", -{ - extend : qx.ui.container.Composite, - implement : [org.argeo.ria.components.ILoadStatusable], - - /** - * @param viewId {String} Unique id of this viewPane - * @param viewTitle {String} Readable Title of this viewPane - */ - construct : function(viewId, viewTitle){ - this.base(arguments); - this.setViewId(viewId); - this._defaultViewTitle = viewTitle; - this.setLayout(new qx.ui.layout.Canvas()); - this.blurredDecorator = new qx.ui.decoration.Uniform(1, "solid", "#000"); - this.blurredDecorator.setBackgroundImage("decoration/app-header.png"); - this.blurredDecorator.setBackgroundRepeat("scale"); - this.setDecorator(this.blurredDecorator); - - this.focusedDecorator = new qx.ui.decoration.Uniform(1, "solid", "#065fb2"); - this.focusedDecorator.setBackgroundImage("decoration/app-header.png"); - this.focusedDecorator.setBackgroundRepeat("scale"); - - this.tabView = new qx.ui.tabview.TabView(); - this.tabView.setAppearance("widget"); - // Empty mode - this.add(this.tabView, {top: 7, width:"100%", bottom:0}); - this.tabView.setBackgroundColor("#fff"); - this.tabView.setMarginTop(27); - - this.tabView.addListener("changeSelected", function(){ - this.fireEvent("changeSelection"); - }, this); - - - this.setFocusable(true); - this.addListener("click", function(e){ - this.fireDataEvent("changeFocus", this); - }, this); - - this.pageIds = {}; - }, - - properties : { - /** - * Unique id of the pane - */ - viewId : {init:""}, - /** - * Human-readable title for this view - */ - viewTitle : {init:"", event:"changeViewTitle"}, - /** - * Has its own scrollable content - */ - ownScrollable : {init: false, check:"Boolean"}, - /** - * Map of commands definition - * @see org.argeo.ria.event.Command - */ - commands : {init : null, nullable:true, check:"Map"} - - }, - - members : { - /** - * Checks if the pane already contains a given view, identified by its instance id - * @param contentId {Mixed} The instance id to check - * @return {Boolean} - */ - contentExists : function(contentId){ - if(this.pageIds[contentId]){ - this.tabView.setSelected(this.pageIds[contentId]); - return this.pageIds[contentId].getUserData("argeoria.iview"); - } - }, - /** - * Sets a new instance in the tabbed pane. - * @param content {org.argeo.ria.components.IView} The applet to add. - */ - setContent : function(content){ - if(!this.tabView.getChildren().length){ - this.tabView.setBackgroundColor("transparent"); - this.tabView.setMarginTop(0); - } - var contentId = content.getInstanceId(); - var page = new qx.ui.tabview.Page(content.getInstanceLabel()); - this.pageIds[contentId] = page; - page.setPadding(0); - page.setLayout(new qx.ui.layout.Canvas()); - page.add(content, {width:"100%", top:0, bottom:0}); - this.tabView.add(page); - page.setUserData("argeoria.iview", content); - content.getViewSelection().addListener("changeSelection", function(e){ - this.fireEvent("changeSelection"); - }, this); - this.tabView.setSelected(page); - }, - /** - * Get the currently selected tab content, if any. - * @return {org.argeo.ria.components.IView} The currently selected view. - */ - getContent : function(){ - if(this._getCrtPage()){ - return this._getCrtPage().getUserData("argeoria.iview"); - } - return null; - }, - /** - * Get the currently selected tab ViewSelection object. - * @return {org.argeo.ria.components.ViewSelection} The view selection object of the currently selected view. - */ - getViewSelection : function(){ - if(!this.getContent()) return null; - return this.getContent().getViewSelection(); - }, - /** - * Return the currently selected tab Page. - * @return {qx.ui.tabview.Page} The page - */ - _getCrtPage : function(){ - return this.tabView.getSelected(); - }, - /** - * Closes the currently selected view and remove all tabs components (button, page). - */ - closeCurrent : function(){ - var crtPage = this._getCrtPage(); - if(!crtPage) return; - var iView = crtPage.getUserData("argeoria.iview"); - var iViewInstance = iView.getInstanceId(); - iView.close(); - this.tabView.remove(crtPage); - delete(this.pageIds[iViewInstance]); - if(!this.tabView.getChildren().length){ // No more tabs : remove commands! - if(this.getCommands()){ - org.argeo.ria.event.CommandsManager.getInstance().removeCommands(this.getCommands(), this.getViewId()); - this.setCommands(null); - } - this.tabView.setBackgroundColor("#fff"); - this.tabView.setMarginTop(27); - } - }, - /** - * Call closeCurrent() recursively until there is no more page. - */ - empty : function(){ - var crtPage = this._getCrtPage(); - while(crtPage){ - this.closeCurrent(); - crtPage = this._getCrtPage(); - } - }, - /** - * Sets the tabView on "load" state. Nothing is done at the moment. - * @param load {Boolean} Load status - */ - setOnLoad : function(load){ - - }, - /** - * Sets a graphical indicator that this pane has the focus. A blue border. - */ - focus : function(){ - if(this.hasFocus) return; - this.fireEvent("changeSelection"); - this.setDecorator(this.focusedDecorator); - this.hasFocus = true; - }, - /** - * Remove a graphical focus indicator on this pane. - */ - blur : function(){ - this.hasFocus = false; - this.setDecorator(this.blurredDecorator); - } - } -}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js deleted file mode 100644 index 0ca43f32d..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js +++ /dev/null @@ -1,250 +0,0 @@ -/** - * A standard view container, referenced in the application by its unique id. - * It is managed by the ViewsManager singleton that works as the "View" part of an MVC model. - * @see org.argeo.ria.components.ViewsManager - * @author Charles - */ -qx.Class.define("org.argeo.ria.components.ViewPane", -{ - extend : qx.ui.container.Composite, - implement : [org.argeo.ria.components.ILoadStatusable], - - /** - * @param viewId {String} Unique id of this viewPane - * @param viewTitle {String} Readable Title of this viewPane - * @param splitPaneData {Map} Additionnal data to be used by splitpanes implementations. - */ - construct : function(viewId, viewTitle, splitPaneData){ - this.base(arguments); - this.setViewId(viewId); - this._defaultViewTitle = viewTitle; - this.setViewTitle(viewTitle); - if(splitPaneData){ - this.setSplitPaneData(splitPaneData); - } - this.setFocusable(true); - this.addListener("click", function(e){ - this.fireDataEvent("changeFocus", this); - }, this); - this.createGui(); - }, - - events : { - /** - * Trigger when the focus is changing - */ - "changeFocus" : "qx.event.type.Data", - /** - * Triggered when selection of content has changed. - */ - "changeSelection" : "qx.event.type.Event" - }, - - properties : - { - /** - * Unique id of the pane - */ - viewId : {init:""}, - /** - * Human-readable title for this view - */ - viewTitle : {init:"", event:"changeViewTitle"}, - /** - * Has its own scrollable content - */ - ownScrollable : {init: false, check:"Boolean"}, - /** - * Data concerning the split pane - */ - splitPaneData : {init : null, check:"Map"}, - /** - * Map of commands definition - * @see org.argeo.ria.event.Command - */ - commands : {init : null, nullable:true, check:"Map"}, - /** - * The real business content. - */ - content : { - init: null, - nullable : true, - check : "org.argeo.ria.components.IView", - apply : "_applyContent" - } - }, - - /* - ***************************************************************************** - MEMBERS - ***************************************************************************** - */ - - members : - { - /** - * Creates a standard GUI for the viewPane, including a container for an IView. - */ - createGui : function(){ - this.setLayout(new qx.ui.layout.VBox()); - this.header = new qx.ui.container.Composite(); - this.header.setLayout(new qx.ui.layout.Dock()); - this.loadImage = new qx.ui.basic.Image('resource/slc/ajax-loader.gif'); - this.header.set({appearance:"app-header", height:34}); - this.headerLabel = new qx.ui.basic.Label(this.getViewTitle()); - this.header.add(this.headerLabel, {edge:"west"}); - this.addListener("changeViewTitle", function(e){ - var newTitle = e.getData(); - if(newTitle != ""){ - this.headerLabel.setContent(newTitle); - if(e.getOldData() == ""){ - this.header.add(this.headerLabel, {edge:"west"}); - } - }else{ - this.header.remove(this.headerLabel); - } - }, this); - this.add(this.header); - this.setDecorator(new qx.ui.decoration.Single(1,"solid","#000")); - /* - // Open close button of splitPane, not very useful at the moment. - if(this.getSplitPaneData()){ - var data = this.getSplitPaneData(); - var imgName = (data.orientation=="horizontal"?"go-left":"go-bottom"); - var image = new qx.ui.basic.Image("resource/slc/"+imgName+".png"); - image.addListener("click", function(e){ - var image = e.getTarget(); - var data = this.getSplitPaneData(); - var functionDim = (data.orientation=="horizontal"?"Width":"Height"); - var objectToResize = data.object || this; - var crtDim = objectToResize["get"+functionDim](); - var minimize = (data.orientation=="horizontal"?"go-right":"go-top"); - var maximize = (data.orientation=="horizontal"?"go-left":"go-bottom"); - if(crtDim > data.min){ - objectToResize["set"+functionDim](data.min); - image.setSource("resource/slc/"+minimize+".png"); - this.origDimension = crtDim; - }else{ - if(this.origDimension){ - objectToResize["set"+functionDim](this.origDimension); - image.setSource("resource/slc/"+maximize+".png"); - } - } - }, this); - this.header.add(image,{edge:"east"}); - } - */ - }, - - /** - * Get the content ViewSelection object. - * @return {org.argeo.ria.components.ViewSelection} The view selection - */ - getViewSelection : function(){ - if(this.getContent()){ - return this.getContent().getViewSelection(); - } - return null; - }, - /** - * Checks if the pane already contains a given view, identified by its instance id - * @param iViewId {Mixed} The instance id to check - * @return {Boolean} - */ - contentExists : function(iViewId){ - if(this.getContent()){ - this.empty(); - } - return false; - }, - - /** - * Sets the content of this pane. - * @param content {org.argeo.ria.components.IView} An IView implementation - */ - _applyContent : function(content){ - if(content == null) return; - var addScrollable = (content.addScroll?content.addScroll():false); - if(addScrollable){ - this.setOwnScrollable(true); - this.scrollable = new qx.ui.container.Scroll(content); - this.add(this.scrollable, {flex: 1}); - }else{ - this.guiContent = content; - this.add(this.guiContent, {flex:1}); - } - content.getViewSelection().addListener("changeSelection", function(e){ - this.fireEvent("changeSelection"); - }, this); - }, - /** - * Adds a graphical component too the header of the view pane. - * It is added as "center" in the dock layout, and will override the view pane title label. - * For example, you can add your own title, or add a switch, or buttons, etc. - * @param component {qx.ui.core.Widget} The graphical component to add. - */ - addHeaderComponent : function(component){ - this.header.setPadding(4); - this.header.add(component, {edge:"center"}); - component.setTextColor("#1a1a1a"); - this.loadImage.setMargin(4); - }, - - /** - * Implementation of the ILoadStatusable interface. - * @see org.argeo.ria.components.ILoadStatusable - * @param load {Boolean} The loading status - */ - setOnLoad : function(load){ - if(load){ - this.header.add(this.loadImage, {edge:"east"}); - }else{ - this.header.remove(this.loadImage); - } - }, - - /** - * Call empty() method, since this pane can only handle one view. - */ - closeCurrent : function(){ - this.empty(); - }, - - /** - * Removes and destroy the IView content of this viewPane. - */ - empty: function(){ - if(this.getOwnScrollable() && this.scrollable){ - this.remove(this.scrollable); - }else if(this.guiContent){ - this.remove(this.guiContent); - } - if(this.getCommands()){ - org.argeo.ria.event.CommandsManager.getInstance().removeCommands(this.getCommands()); - this.setCommands(null); - } - if(this.getContent()){ - this.getContent().close(); - } - this.setViewTitle(this._defaultViewTitle); - this.setContent(null); - }, - /** - * Sets a graphical indicator that this pane has the focus. A blue border. - */ - focus : function(){ - if(this.hasFocus) return; - this.setDecorator(new qx.ui.decoration.Single(1,"solid","#065fb2")); - this.fireEvent("changeSelection"); - this.hasFocus = true; - }, - /** - * Remove a graphical focus indicator on this pane. - */ - blur : function(){ - this.hasFocus = false; - this.setDecorator(new qx.ui.decoration.Single(1,"solid","#000")); - } - - } -}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewSelection.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewSelection.js deleted file mode 100644 index 6c3e873ab..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewSelection.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Generic selection model associated to an IView content opened in a given ViewPane. - * It contains in an array any row/data/node, and triggers changeSelection data events. - * @author Charles du Jeu - */ -qx.Class.define("org.argeo.ria.components.ViewSelection", -{ - extend : qx.core.Object, - - /** - * @param viewId {String} The ViewPane unique id - */ - construct : function(viewId){ - this.base(arguments); - this.nodes = []; - this.setViewId(viewId); - }, - - properties : { - /** - * The viewPane unique id - */ - viewId : { - check : "String", - nullable: false - } - }, - - events : { - /** - * Triggered each time the selection changes. - */ - "changeSelection" : "qx.event.type.Data" - }, - - /* - ***************************************************************************** - MEMBERS - ***************************************************************************** - */ - - members : - { - /** - * Empty the selection - */ - clear : function(){ - this.nodes = []; - this.triggerEvent(); - }, - - /** - * Add a row or xml node or whatever - * @param node {mixed} Data to add to the selection - */ - addNode : function(node) { - this.nodes.push(node); - this.triggerEvent(); - }, - - /** - * The number of rows/nodes selected - * @return {Integer} - */ - getCount : function() { - return this.nodes.length; - }, - - /** - * Returns the content of the selection - * @return {Array} - */ - getNodes : function(){ - return this.nodes; - }, - - /** - * Creates and fire a data event changeSelection - */ - triggerEvent : function(){ - this.fireDataEvent("changeSelection", this); - } - - } -}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewsManager.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewsManager.js deleted file mode 100644 index 225bc693b..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewsManager.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * The main "view" manager (in a standard MVC conception) of the application. - * It register various containers org.argeo.ria.components.viewPane and feed them with org.argeo.ria.components.IView implementations. - * It is a singleton and can thus be called by any part of the application. - * - * @author Charles du Jeu - */ -qx.Class.define("org.argeo.ria.components.ViewsManager", -{ - type : "singleton", - extend : qx.core.Object, - - properties : { - /** - * The application root (like Application.getRoot()), used to attach and show modal windows. - */ - applicationRoot : {init : null}, - /** - * The main container for the org.argeo.ria.components.ViewPane instances. - */ - viewPanesContainer : {init: null}, - /** - * Keeps the currently focused viewPane. - */ - currentFocus : {init :null} - }, - construct : function(){ - this.views = {}; - }, - members : { - /** - * Initialize and load a given IView implementation into a viewPane. - * The IView itself is returned. - * - * @param classObj {Clazz} The class object to instantiate - * @param viewPaneId {String} The unique ID of the view pane - * @param data {Mixed} Any data provided by the opener. - * @return {org.argeo.ria.components.IView} - */ - initIViewClass: function(classObj, viewPaneId, data){ - var viewPane = this.getViewPaneById(viewPaneId); - var iView = new classObj; - iView.init(viewPane, data); - var existingView = viewPane.contentExists(iView.getInstanceId()); - if(existingView){ - delete iView; - return existingView; - } - var commands = iView.getCommands(); - //viewPane.empty(); - if(commands){ - viewPane.setCommands(commands); - org.argeo.ria.event.CommandsManager.getInstance().addCommands(commands, "view:"+viewPaneId, viewPaneId); - } - viewPane.setContent(iView); - this.setViewPaneFocus(viewPane); - return iView; - }, - - /** - * Registers a new viewPane - * @param viewPane {org.argeo.ria.components.ViewPane} The new ViewPane instance - */ - registerViewPane : function(viewPane){ - this.views[viewPane.getViewId()] = viewPane; - viewPane.addListener("changeSelection", function(e){ - var viewSelection = e.getTarget().getViewSelection(); - if(!viewSelection) return; - org.argeo.ria.event.CommandsManager.getInstance().refreshCommands(viewSelection); - }); - viewPane.addListener("changeFocus", function(e){ - this.setViewPaneFocus(e.getTarget()); - }, this); - }, - /** - * Sets a given viewPane as the currently focused one. Blur the others. - * @param viewPane {org.argeo.ria.components.ViewPane} The viewPane (or TabbedViewPane) to focus on. - */ - setViewPaneFocus : function(viewPane){ - for(var key in this.views){ - this.views[key].blur(); - } - this.setCurrentFocus(viewPane); - viewPane.focus(); - }, - /** - * Returns a viewPane by its unique id. - * @param viewPaneId {String} The unique id - * @return {org.argeo.ria.components.ViewPane} - */ - getViewPaneById : function(viewPaneId){ - if(this.views[viewPaneId]) return this.views[viewPaneId]; - throw new Error("Cannot find view '"+viewPaneId+"'"); - }, - /** - * Returns a viewPane current viewSelection object - * @param viewPaneId {String} The unique id. - * @return {org.argeo.ria.components.ViewSelection} - */ - getViewPaneSelection : function(viewPaneId){ - return this.getViewPaneById(viewPaneId).getViewSelection(); - }, - /** - * Changes a viewPane title dynamically. - * @param viewPaneId {String} ViewPane unique Id. - * @param viewTitle {String} the new title for this viewPane. - */ - setViewPaneTitle : function(viewPaneId, viewTitle){ - this.getViewPaneById(viewPaneId).setViewTitle(viewTitle); - } - } -}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/__init__.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/__init__.js deleted file mode 100644 index 3f9efafa7..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/__init__.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Package containing GUI components and main interfaces for GUI components to - * be used by any argeo RIA application. - * - */ \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/event/Command.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/event/Command.js deleted file mode 100644 index 77abef851..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/event/Command.js +++ /dev/null @@ -1,248 +0,0 @@ -/** - * The standard command for all actions. It registers keyboard shortcuts, centralizes - * command state, callback, etc. It is defined by command definitions that can be found - * in the CommandsManager. - */ - qx.Class.define("org.argeo.ria.event.Command", -{ - extend : qx.event.Command, - implement : [org.argeo.ria.components.ILoadStatusable], - - properties : { - /** - * Unique id of the command - */ - id : {init:""}, - /** - * Label of the command - */ - label : {init:""}, - /** - * Icon of the command - */ - icon : {init:""}, - /** - * Weather this command is a true/false state - */ - toggle : {init:false}, - /** - * It toggle button, initial state - */ - toggleInitialState : {init : false}, - /** - * Sub menu if needed - */ - menu : { - nullable: true, - event : "changeMenu" - }, - /** - * Callback associated to the submenu of the command - */ - menuCallback : {nullable:true}, - /** - * Context used when triggering menuCallback - */ - menuContext : {nullable:true} - }, - - /** - * @param id {String} Id of the command - * @param label {String} Label of the command - * @param icon {String} Icon of the command - * @param shortcut {String} Keyboard Shortcut (like alt+o, ctrl+z, etc..) - */ - construct : function(id, label, icon, shortcut){ - this.base(arguments, shortcut); - this.setId(id); - this.setLabel(label); - this.setIcon(icon); - this.menuClones = []; - this.callbacks = {}; - }, - - members : - { - /** - * Create a Button that suits a qx.ui.menu.MenuBar linked to this command - * @return {qx.ui.menu.Button} - */ - getMenuButton : function(){ - if(this.getToggle()){ - button = new qx.ui.menu.CheckBox(this.getLabel()); - this._registerToggleButtonListeners(button); - }else{ - var button = new qx.ui.menu.Button( - this.getLabel(), - this.getIcon(), - this, - this.getMenuClone() - ); - if(this.getMenu()){ - this.addListener("changeMenu", function(event){ - button.setMenu(this.getMenuClone()); - }, this); - } - } - this.addTooltip(button); - return button; - }, - - /** - * Create a Button that suits a qx.ui.toolbar.Toolbar part linked to this command. - * @return {qx.ui.toolbar.MenuButton} - */ - getToolbarButton : function(){ - var button; - if(this.getMenu()){ - button = new qx.ui.toolbar.MenuButton( - this.getLabel(), - this.getIcon(), - this.getMenuClone() - ); - this.addListener("changeMenu", function(event){ - button.setMenu(this.getMenuClone()); - }, this); - this.addListener("changeEnabled", function(e){ - this.setEnabled(e.getData()); - }, button); - button.setEnabled(this.getEnabled()); - }else if(this.getToggle()){ - button = new qx.ui.toolbar.CheckBox(this.getLabel(), this.getIcon()); - if(this.getToggleInitialState()){ - button.setChecked(true); - } - this._registerToggleButtonListeners(button); - }else{ - button = new qx.ui.toolbar.Button( - this.getLabel(), - this.getIcon(), - this - ); - } - this.addTooltip(button); - return button; - }, - - /** - * Register a given callback to be shared by one or more focusable part. - * @param callback {Function} A callback function - * @param focusablePartId {String} A string identifiing a focusable part. At the moment, it can only be "view:viewId" - */ - registerCallback : function(callback, focusablePartId){ - this.callbacks[focusablePartId] = callback; - }, - /** - * Return all the registered callbacks for this command. - * @return {Map} A map of callback, viewId => callBack. - */ - getCallbacks : function(){ - return this.callbacks; - }, - /** - * Remove a callback for a given focusable part. - * @param focusablePartId {String} A id like "view:viewId". - */ - removeCallback : function(focusablePartId){ - if(this.callbacks[focusablePartId]){ - delete this.callbacks[focusablePartId]; - } - }, - - /** - * Special tricks using UserData to enable/disable listeners to avoid loops... - * @param button {qx.ui.core.Widget} toolbar Checkbox or menu Checkbox button. - */ - _registerToggleButtonListeners : function(button){ - button.addListener("changeChecked", function(event){ - if(button.getUserData("disableListener")) return; - this.setUserData("slc.command.toggleState", event.getData()); - this.setUserData("slc.command.toggleStateSource", button); - this.fireEvent("execute"); - }, this); - this.addListener("execute", function(event){ - if(this.getUserData("slc.command.toggleStateSource") == button) return; - button.setUserData("disableListener", true); - button.setChecked(this.getUserData("slc.command.toggleState")); - button.setUserData("disableListener", false); - }, this); - }, - - /** - * Clones the command menu - * @return {qx.ui.menu.Menu} - */ - getMenuClone : function(){ - var menuClone = new qx.ui.menu.Menu(); - menuClone.setMinWidth(100); - var submenus = this.getMenu(); - if(!submenus) return; - for(var i=0;i - * { - * label : "", - * | The label of the action - * - * icon : "", - * | The icon image - * - * shortcut : "", - * | The keyboard shortcut, as defined in qooxdoo (Control+s, Alt+k, etc.). Warning, the letter must be lowercase. - * - * enabled : true, - * | Whether it is enabled or disabled at creation - * - * menu : ""|null, - * | The menu group to which the command will be added. If null, will not appear in the menus. - * - * menuPosition : "first"|"last" - * | Optional : force the menu group to be first or last in the menubar. - * - * toolbar : ""|null, - * | The toolbar group to which the command will be added. If null, will not appear in the toolbars. - * - * init : function(){}, - * | Optional function called at command creation. - * | Function context : the command itself - * - * callback : function(e){}, - * | The main callback to be triggered when command is executed. - * | Function context : the current class (not the command!) - * - * selectionChange : function(viewPaneId, xmlNodes){}, - * | Optional function called each time a selectionChange is detected in one of the active viewPane. - * | The origin viewPaneId and the new selection as a map of nodes are passed as arguments. - * | Function context : the command itself. - * - * submenu : [{label:"", icon:"", commandId:""}, ...], - * | If set, the command will create a submenu, being in a menu or in the toolbar. - * | The submenu is created with the various array entries, and the submenuCallback function - * | will be called with the 'commandId' parameter when a submenu entry is selected. - * - * submenuCallback : function(commandId){}, - * | Callback if command is a submenu (cf. above). - * | Function context : the current class/ - * - * command : null - * | For internal use only, caching the actual org.argeo.ria.event.Command object. - * } - * - * @see org.argeo.ria.event.Command for the definition Map details. - */ - definitions : { - init : {}, - check : "Map" - }, - /** - * For internal use - */ - initialDefinitions : { - init : {}, - check : "Map" - }, - /** - * Special command definitions that are shared between focusable parts. - */ - sharedDefinitions : { - init: {}, - check: "Map" - } - }, - - events : { - /** - * Triggered when the whole commands list is changed. Mainly used internally by the manager. - */ - "changedCommands" : "qx.event.type.Event" - }, - - /* - ***************************************************************************** - MEMBERS - ***************************************************************************** - */ - - members : - { - /** - * Initialize the manager with basic definitions. - * @param initDefinitions {Map} A map of commands definitions. - */ - init : function(initDefinitions){ - this.setDefinitions(initDefinitions); - this.setInitialDefinitions(qx.lang.Object.copy(initDefinitions)); - }, - - /** - * Creates all the objects (if they are not already existing) from the definitions maps. - */ - createCommands : function(){ - this.menus = {}; - this.toolbars = {}; - var defs = this.getDefinitions(); - var shared = this.getSharedDefinitions(); - for(var key in defs){ - var definition = defs[key]; - var command; - if(!definition.command){ - command = new org.argeo.ria.event.Command(key, definition.label, definition.icon, definition.shortcut); - if(definition.submenu){ - command.setMenu(definition.submenu); - if(definition.submenuCallback){ - command.setMenuCallback(definition.submenuCallback); - command.setMenuContext((definition.callbackContext?definition.callbackContext:null)); - } - } - command.setEnabled(definition.enabled); - if(definition.toggle){ - command.setToggle(true); - if(definition.toggleInitialState){ - command.setToggleInitialState(definition.toggleInitialState); - } - } - this._attachListener(command, definition.callback, definition.callbackContext); - if(definition.init){ - var binded = qx.lang.Function.bind(definition.init, command); - binded(); - } - definition.command = command; - }else{ - command = definition.command; - if(shared[key]){ - - for(var focusPartId in shared[key]){ - var sharedCommand = shared[key][focusPartId]; - if(sharedCommand.callback){ - var split = sharedCommand.callbackContext.split(":"); - var focusPart = split[0]; - var viewId = split[1]; - command.registerCallback(sharedCommand.callback, split[1]); - //this._attachListener(command, sharedCommand.callback, sharedCommand.callbackContext); - } - } - - } - } - if(definition.menu){ - if(!this.menus[definition.menu]) this.menus[definition.menu] = []; - this.menus[definition.menu].push(definition); - } - if(definition.toolbar){ - if(!this.toolbars[definition.toolbar]) this.toolbars[definition.toolbar] = []; - this.toolbars[definition.toolbar].push(command); - } - } - this.setDefinitions(defs); - }, - - /** - * Refresh the current commands status depending on the viewSelection. - * @param viewSelection {org.argeo.ria.components.ViewSelection} The current ViewSelection - */ - refreshCommands : function(viewSelection){ - var defs = this.getDefinitions(); - var shared = this.getSharedDefinitions(); - var xmlNodes = null; - if(viewSelection.getCount() > 0){ - var xmlNodes = viewSelection.getNodes(); - } - for(var key in defs){ - var definition = defs[key]; - if(!definition.selectionChange) continue; - if(shared[key]){ - var currentFocus = org.argeo.ria.components.ViewsManager.getInstance().getCurrentFocus(); - //this.debug(currentFocus); - if(!currentFocus) continue; - var sharedComm = shared[key][currentFocus.getViewId()]; - if(sharedComm && sharedComm.selectionChange){ - var binded = qx.lang.Function.bind(sharedComm.selectionChange, definition.command); - binded(viewSelection.getViewId(), xmlNodes); - } - } - var binded = qx.lang.Function.bind(definition.selectionChange, definition.command); - binded(viewSelection.getViewId(), xmlNodes); - } - }, - - /** - * Record a menubar for the application - * @param menuBar {qx.ui.menubar.MenuBar} The application menubar - */ - registerMenuBar : function(menuBar){ - this.addListener("changedCommands", function(){ - this.createMenuButtons(menuBar); - }, this); - this.createMenuButtons(menuBar); - }, - - /** - * Record a toolbar for the application - * @param toolBar {qx.ui.toolbar.ToolBar} The application toolbar - */ - registerToolBar : function(toolBar){ - this.addListener("changedCommands", function(){ - this.createToolbarParts(toolBar); - }, this); - this.createToolbarParts(toolBar); - }, - - /** - * Creates the real buttons and add them to the passed menuBar. - * @param menuBar {qx.ui.menubar.MenuBar} The application menubar - */ - createMenuButtons : function(menuBar){ - menuBar.removeAll(); - var anchors = {}; - for(var key in this.menus){ - var menu = new qx.ui.menu.Menu(); - var button = new qx.ui.menubar.Button(key, null, menu); - var anchorDetected = false; - for(var i=0; i 0) - qx.event.Timer.once(this._sendPoll, this, this._pollDelay); - else - this._sendPoll(); - }, - - /** - * Send a poll query : GET query and no paramter at all. - * @param request {qx.io.remote.Request} A request object - */ - _sendPoll : function(request) { - if(this.interrupt) return; - var request = new qx.io.remote.Request(this.uri, "GET", "application/xml"); - request.setTimeout(this.pollTimeout*1000+5000); - request.addListener("completed", this._pollHandler, this); - request.send(); - }, - - /** - * Add a function that gets called on every poll response, after all received - * messages have been handled. The poll handler is past a boolean that indicates - * if this is the first poll for the page. - * - * @param func {Function} The handler to be called. - */ - addPollHandler : function(func) { - var old = this._pollEvent; - this._pollEvent = function(first) { - old(first); - func(first); - } - }, - - /** - * Send a JMS message to a destination (eg topic://MY.TOPIC). - * Message should be xml or encoded xml content. - * - * @param destination {String} The topic destination - * @param message {String} XML encoded message - * @param properties {Map} A map of additional parameters to add to the query. - */ - sendMessage : function(destination, message, properties) { - this._sendMessage(destination, message, 'send', properties); - }, - - /** - * Listen on a channel or topic. handler must be a function taking a message arguement - * @param id {String} A unique identifier for this handler - * @param destination {String} The topic to listen to (topic://MY.TOPIC) - * @param handler {Function} The handler to trigger when receiving a message - * @param context {Object} An object to bind on the handler. - */ - addListener : function(id, destination, handler, context) { - this._handlers[id] = qx.lang.Function.bind(handler, context); - this._sendMessage(destination, id, 'listen'); - }, - - /** - * Remove Listener from channel or topic. - * @param id {String} identifier of the handler to remove. - * @param destination {String} The topic to listen to (topic://MY.TOPIC) - */ - removeListener : function(id, destination) { - this._handlers[id] = null; - this._sendMessage(destination, id, 'unlisten'); - }, - - /** - * Send a message of a given type. - * @param destination {String} The topic to listen to (topic://MY.TOPIC) - * @param message {String} XML encoded message - * @param type {String} The JMS-Type of message (listen, unlisten, send). - * @param properties {Map} A map of additional parameters to add to the query. - */ - _sendMessage : function(destination, message, type, properties) { - var req = new qx.io.remote.Request(this.uri, "POST", "text/plain"); - if(!properties) properties = {}; - properties["destination"] = destination; - properties["message"] = message; - properties["type"] = type; - var vParametersList = []; - - for (var vId in properties) - { - var value = properties[vId]; - if (value instanceof Array) - { - for (var i=0; i 0) - { - req.setData(vParametersList.join("&")); - } - - //req.addListener("completed", this.endBatch, this); - req.send(); - }, - - /** - * Starts a poll on the JMS server. - */ - startPolling : function() { - if (this.poll){ - this.interrupt = false; - var req = new qx.io.remote.Request(this.uri, "GET", "application/xml"); - req.setParameter("timeout", "10"); - req.addListener("completed", this._pollHandler, this); - req.send(); - } - }, - - /** - * Stops polling the JMS server. - */ - stopPolling : function(){ - this.interrupt = true; - } - } -}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/remote/RequestManager.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/remote/RequestManager.js deleted file mode 100644 index 0b79b272d..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/remote/RequestManager.js +++ /dev/null @@ -1,157 +0,0 @@ -/** - * A management class for all request sent to the server - * Basically, to access the server, always get a new Request object from this class. - * It will then trigger various user-interface events during the Request lifecycle. - * - * For the moment, it's about the "Stop" button command, handling any passed ILoadStatusable states, - * and logging the Request status/errors. - * - * @author Charles du Jeu - */ -qx.Class.define("org.argeo.ria.remote.RequestManager", -{ - type : "singleton", - extend : qx.core.Object, - - events : { - /** - * Triggered on the user demand at the end of the Request - */ - "reload" : "org.argeo.ria.event.ReloadEvent" - }, - - construct : function(){ - this.base(arguments); - }, - - members : { - /** - * Sets the unique "stop" command of the application. - * @param stopCommand {org.argeo.ria.event.Command} The command - */ - setStopCommand : function(stopCommand){ - this.command = stopCommand; - }, - - /** - * Creates a Request and handle various parts of its lifecycle. - * @see org.argeo.ria.event.ReloadEvent - * @see org.argeo.ria.components.ILoadStatusable - * - * @param url {String} The server url - * @param method {String} Connexion method (POST, GET, etc.) - * @param responseType {String} Expected response mime type (application/xml, etc...). - * @param fireReloadEventType {String} On user-demand, if this parameter is not null, a org.argeo.ria.event.ReloadEvent will be triggered when the request is completed. - * @param iLoadStatusables {Array} An array of ILoadStatusable implementations that need to be updated by the Request state (loading/ended). - * @return {qx.io.remote.Request} - */ - getRequest : function(url, method, responseType, fireReloadEventType, iLoadStatusables){ - var request = new qx.io.remote.Request(url, method, responseType); - if(iLoadStatusables){ - request.setUserData("iLoadStatusables", iLoadStatusables); - } - if(fireReloadEventType){ - request.addListener("completed", function(response){ - this.fireReloadEvent(fireReloadEventType, response.getContent()); - }, this); - } - this.enableCommand(request); - request.addListener("timeout", this.requestTerminated, this); - request.addListener("failed", this.requestTerminated, this); - request.addListener("aborted", this.requestTerminated, this); - request.addListener("completed", this.requestCompleted, this); - return request; - }, - - /** - * Creates a ReloadEvent and fire it. - * @param dataType {String} The data type - * @param content {mixed} The content of the request response. - */ - fireReloadEvent : function(dataType, content){ - this.fireEvent("reload", org.argeo.ria.event.ReloadEvent, [dataType, content]); - }, - - /** - * Triggered when request is created - * @param e {qx.event.type.Event} The event - */ - requestCreated : function(e){ - var request = e.getTarget(); - this.enableCommand(request); - }, - - /** - * Triggered when request is completed normally - * @param e {qx.event.type.Event} The event - */ - requestCompleted : function(e){ - var request = e.getTarget(); - this.disableCommand(request); - }, - - /** - * Triggered when request is completed abnormally - * @param e {qx.event.type.Event} The event - */ - requestTerminated : function(e){ - var request = e.getTarget(); - var errorType = e.getType(); - this.disableCommand(request); - var message = ""; - if(errorType == "aborted"){ - message = "Request aborted by user"; - }else if(errorType == "failed"){ - message = "Request failed!"; - }else if(errorType == "timeout"){ - message = "Request timed out!"; - } - this.error(message); - }, - - /** - * Triggered by a request creation. Update the GUI parts according to its status. - * @param request {qx.io.remote.Request} The current Request - */ - disableCommand : function(request){ - this.command.setEnabled(false); - if(request.getUserData("iLoadStatusables")){ - this.updateGuiParts(request.getUserData("iLoadStatusables"), false); - } - var listener = request.getUserData("listener"); - if(listener){ - this.command.removeListener("execute", listener); - } - }, - - /** - * Triggered by a request ending. Update the GUI parts according to its status. - * @param request {qx.io.remote.Request} The current Request - */ - enableCommand : function(request){ - this.command.setEnabled(true); - if(request.getUserData("iLoadStatusables")){ - this.updateGuiParts(request.getUserData("iLoadStatusables"), true); - } - qx.ui.core.queue.Manager.flush(); - var listener = request.abort; - request.setUserData("listener", listener); - this.command.addListener("execute", listener, request); - }, - - /** - * Update the ILoadStatusable implementations - * @param iLoadStatusables {Array} An array of ILoadStatusable - * @param loadStatus {Boolean} The current status of a request - */ - updateGuiParts : function(iLoadStatusables, loadStatus){ - for(var i=0;igenerate.py test to generate a testrunner application - * and open it from test/index.html - * - * The methods that contain the tests are instance methods with a - * test prefix. You can create an arbitrary number of test - * classes like this one. They can be organized in a regular class hierarchy, - * i.e. using deeper namespaces and a corresponding file structure within the - * test folder. - */ -qx.Class.define("org.argeo.ria.test.DemoTest", -{ - extend : qx.dev.unit.TestCase, - - members : - { - /* - --------------------------------------------------------------------------- - TESTS - --------------------------------------------------------------------------- - */ - - /** - * Here are some simple tests - */ - testSimple : function() - { - this.assertEquals(4, 3+1, "This should never fail!"); - this.assertFalse(false, "Can false be true?!"); - }, - - /** - * Here are some more advanced tests - */ - testAdvanced: function () - { - var a = 3; - var b = a; - this.assertIdentical(a, b, "A rose by any other name is still a rose"); - this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!"); - } - } -}); diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/test/__init__.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/test/__init__.js deleted file mode 100644 index 6700c72d8..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/test/__init__.js +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Unit tests to be executed by the TestRunner application. - * - */ \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/util/Element.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/util/Element.js deleted file mode 100644 index 23df026c2..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/util/Element.js +++ /dev/null @@ -1,177 +0,0 @@ -/** - * Cross browser XML Element API - * - * Overrides the Qooxdoo qx.xml.Element to handle the namespace prefixes - * - * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/81f3de54-3b79-46dc-8e01-73ca2d94cdb5.asp - * http://developer.mozilla.org/en/docs/Parsing_and_serializing_XML - */ -qx.Class.define("org.argeo.ria.util.Element", -{ - - statics : - { - - DEFAULT_NAMESPACE_MAP : null, - - /** - * Selects the first XmlNode that matches the XPath expression. - * - * @param element {Element | Document} root element for the search - * @param query {String} XPath query - * @param NSMap (Object) A map matching namespace prefixes to namespace URIS; - * @return {Element} first matching element - * @signature function(element, query, NSMap) - */ - selectSingleNode : qx.core.Variant.select("qx.client", - { - "mshtml|opera": function(element, query, NSMap) { - NSMap = NSMap || org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP; - if(NSMap){ - var namespaces = []; - var i=0; - for(var prefix in NSMap){ - namespaces[i] = 'xmlns:'+prefix+'="'+NSMap[prefix]+'"'; - i++; - } - var doc = element.ownerDocument || element; - doc.setProperty('SelectionNamespaces', namespaces.join(" ")); - } - try{ - return element.selectSingleNode(query); - }catch(err){} - }, - - "default": function(element, query, NSMap) - { - NSMap = NSMap || org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP; - if(!this.__xpe) { - this.__xpe = new XPathEvaluator(); - } - - var xpe = this.__xpe; - - try { - var resolver; - if(NSMap){ - resolver = function(prefix){ - return NSMap[prefix] || null; - } - }else{ - resolver = xpe.createNSResolver(element); - } - //return xpe.evaluate(query, element, xpe.createNSResolver(element), XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; - return xpe.evaluate(query, element, resolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; - } catch(err) { - throw new Error("selectSingleNode: query: " + query + ", element: " + element + ", error: " + err); - } - } - }), - - - /** - * Selects a list of nodes matching the XPath expression. - * - * @param element {Element | Document} root element for the search - * @param query {String} XPath query - * @param NSMap {Map} Mapping between namespaces prefixes and URI. - * @return {Element[]} List of matching elements - * @signature function(element, query, NSMap) - */ - selectNodes : qx.core.Variant.select("qx.client", - { - "mshtml|opera": function(element, query, NSMap) { - NSMap = NSMap || org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP; - if(NSMap){ - var namespaces = []; - var i=0; - for(var prefix in NSMap){ - namespaces[i] = 'xmlns:'+prefix+'="'+NSMap[prefix]+'"'; - i++; - } - var doc = element.ownerDocument || element; - doc.setProperty('SelectionNamespaces', namespaces.join(" ")); - } - return element.selectNodes(query); - }, - - "default": function(element, query, NSMap) - { - NSMap = NSMap || org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP; - var xpe = this.__xpe; - - if(!xpe) { - this.__xpe = xpe = new XPathEvaluator(); - } - - try { - var resolver; - if(NSMap){ - resolver = function(prefix){ - return NSMap[prefix] || null; - } - }else{ - resolver = xpe.createNSResolver(element); - } - //var result = xpe.evaluate(query, element, xpe.createNSResolver(element), XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - var result = xpe.evaluate(query, element, resolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - } catch(err) { - throw new Error("selectNodes: query: " + query + ", element: " + element + ", error: " + err); - } - - var nodes = []; - for (var i=0; ihttp://www.w3.org/1999/xhtml. - * @param tagname {String} the tagname to look for - * @return {Element[]} a list of found elements in the order they appear in the tree. - * @signature function(element, namespaceURI, tagname) - */ - getElementsByTagNameNS : qx.core.Variant.select("qx.client", - { - "mshtml": function(element, namespaceURI, tagname) - { - var doc = element.ownerDocument || element; - - doc.setProperty("SelectionLanguage", "XPath"); - doc.setProperty("SelectionNamespaces", "xmlns:ns='" + namespaceURI + "'"); - - return qx.xml.Element.selectNodes(element, 'descendant-or-self::ns:' + tagname); - }, - - "default": function(element, namespaceURI, tagname) { - return element.getElementsByTagNameNS(namespaceURI, tagname); - } - }), - - - /** - * Selects the first XmlNode that matches the XPath expression and returns the text content of the element - * - * @param element {Element|Document} root element for the search - * @param query {String} XPath query - * @param NSMap {Object} Mapping between NS prefix / uri - * @return {String} the joined text content of the found element or null if not appropriate. - * @signature function(element, query) - */ - getSingleNodeText : function(element, query, NSMap) - { - NSMap = NSMap || org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP; - var node = org.argeo.ria.util.Element.selectSingleNode(element, query, NSMap); - return qx.dom.Node.getText(node); - } - } -}); diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/util/TreeDataCellRenderer.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/util/TreeDataCellRenderer.js deleted file mode 100644 index e11a85b99..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/util/TreeDataCellRenderer.js +++ /dev/null @@ -1,665 +0,0 @@ -/* ************************************************************************ - - qooxdoo - the new era of web development - - http://qooxdoo.org - - Copyright: - 2007 Derrell Lipman - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Derrell Lipman (derrell) - * David Perez Carmona (david-perez) - -************************************************************************ */ - -/* ************************************************************************ - -#require(qx.theme.Modern) -#require(qx.theme.Classic) -#require(qx.log.Logger) - -************************************************************************ */ - -/** - * A data cell renderer for the tree column of a simple tree - */ -qx.Class.define("org.argeo.ria.util.TreeDataCellRenderer", -{ - extend : qx.ui.treevirtual.SimpleTreeDataCellRenderer, - - - construct : function() - { - this.base(arguments); - - this.__am = qx.util.AliasManager.getInstance(); - this.__rm = qx.util.ResourceManager; - this.__tm = qx.theme.manager.Appearance.getInstance(); - - // Base URL used for indentation - this.BLANK = this.__rm.toUri(this.__am.resolve("static/blank.gif")); - }, - - - statics : - { - __icon : { } - }, - - - - - /* - ***************************************************************************** - MEMBERS - ***************************************************************************** - */ - - members : - { - // overridden - _getCellStyle : function(cellInfo) - { - var node = cellInfo.value; - - // Return the style for the div for the cell. If there's cell-specific - // style information provided, append it. - var html = - this.base(arguments, cellInfo) + - (node.cellStyle ? node.cellStyle + ";" : ""); - return html; - }, - - // overridden - _getContentHtml : function(cellInfo) - { - var html = ""; - - // Horizontal position - var pos = 0; - - // If needed, add extra content before indentation - var extra = this._addExtraContentBeforeIndentation(cellInfo, pos); - html += extra.html; - pos = extra.pos; - - // Add the indentation (optionally with tree lines) - var indentation = this._addIndentation(cellInfo, pos); - html += indentation.html - pos = indentation.pos; - - // If needed, add extra content before icon - extra = this._addExtraContentBeforeIcon(cellInfo, pos); - html += extra.html; - pos = extra.pos; - - // Add the node icon - var icon = this._addIcon(cellInfo, pos); - html += icon.html; - pos = icon.pos; - - // If needed, add extra content before label - extra = this._addExtraContentBeforeLabel(cellInfo, pos); - html += extra.html; - pos = extra.pos; - - // Add the node's label - html += this._addLabel(cellInfo, pos); - - return html; - }, - - /** - * Add an image to the tree. This might be a visible icon or it may be - * part of the indentation. - * - * @param imageInfo {Map} - * How to display the image. It optionally includes any of the - * following: - *
- *
position {Map}
- *
- * If provided, a div is created to hold the image. The div's top, - * right, bottom, left, width, and/or height may be specified with - * members of this map. Each is expected to be an integer value. - *
- *
imageWidth, imageHeight
- *
- * The image's width and height. These are used only if both are - * specified. - *
- *
- * - * @return {String} - * The html for this image, possibly with a surrounding div (see - * 'position', above). - */ - _addImage : function(imageInfo) - { - var html = []; - - // Resolve the URI - var source = this.__rm.toUri(this.__am.resolve(imageInfo.url)); - - // If we've been given positioning attributes, enclose image in a div - if (imageInfo.position) - { - var pos = imageInfo.position; - - html.push('
'); - } - - // Don't use an image tag. They render differently in Firefox and IE7 - // even if both are enclosed in a div specified as content box. Instead, - // add the image as the background image of a div. - html.push('
 
'); - - if (imageInfo.position) - { - html.push('
'); - } - - return html.join(""); - }, - - - /** - * Add the indentation for this node of the tree. - * - * The indentation optionally includes tree lines. Whether tree lines are - * used depends on (a) the properties 'useTreeLines' and - * 'excludeFirstLevelTreelines' within this class; and (b) the widget - * theme in use (some themes don't support tree lines). - * - * @param cellInfo {Map} The information about the cell. - * See {@link qx.ui.table.cellrenderer.Abstract#createDataCellHtml}. - * - * @param pos {Integer} - * The position from the left edge of the column at which to render this - * item. - * - * @return {Map} - * The returned map contains an 'html' member which contains the html for - * the indentation, and a 'pos' member which is the starting position - * plus the width of the indentation. - */ - _addIndentation : function(cellInfo, pos) - { - var node = cellInfo.value; - var imageData; - var html = ""; - - // Generate the indentation. Obtain icon determination values once - // rather than each time through the loop. - var bUseTreeLines = this.getUseTreeLines(); - var bExcludeFirstLevelTreeLines = this.getExcludeFirstLevelTreeLines(); - var bAlwaysShowOpenCloseSymbol = this.getAlwaysShowOpenCloseSymbol(); - - for (var i=0; i' + - '' + - node.label + - '' + - ''; - - return html; - }, - - /** - * Adds extra content just before the indentation. - * - * @param cellInfo {Map} The information about the cell. - * See {@link qx.ui.table.cellrenderer.Abstract#createDataCellHtml}. - * - * @param pos {Integer} - * The position from the left edge of the column at which to render this - * item. - * - * @return {Map} - * The returned map contains an 'html' member which contains the html for - * the indentation, and a 'pos' member which is the starting position - * plus the width of the indentation. - */ - _addExtraContentBeforeIndentation : function(cellInfo, pos) - { - return { html: '', pos: pos }; - }, - - /** - * Adds extra content just before the icon. - * - * @param cellInfo {Map} The information about the cell. - * See {@link qx.ui.table.cellrenderer.Abstract#createDataCellHtml}. - * - * @param pos {Integer} - * The position from the left edge of the column at which to render this - * item. - * - * @return {Map} - * The returned map contains an 'html' member which contains the html for - * the indentation, and a 'pos' member which is the starting position - * plus the width of the indentation. - */ - _addExtraContentBeforeIcon : function(cellInfo, pos) - { - return { html: '', pos: pos }; - }, - - /** - * Adds extra content just before the label. - * - * @param cellInfo {Map} The information about the cell. - * See {@link qx.ui.table.cellrenderer.Abstract#createDataCellHtml}. - * - * @param pos {Integer} - * The position from the left edge of the column at which to render this - * item. - * - * @return {Map} - * The returned map contains an 'html' member which contains the html for - * the indentation, and a 'pos' member which is the starting position - * plus the width of the indentation. - */ - _addExtraContentBeforeLabel : function(cellInfo, pos) - { - return { html: '', pos: pos }; - }, - - - /** - * Determine the symbol to use for indentation of a tree row, at a - * particular column. The indentation to use may be just white space or - * may be a tree line. Tree lines come in numerous varieties, so the - * appropriate one is selected. - * - * @type member - * - * @param column {Integer} - * The column of indentation being requested, zero-relative - * - * @param node {Node} - * The node being displayed in the row. The properties of a node are - * described in {@link qx.ui.treevirtual.SimpleTreeDataModel} - * - * @param bUseTreeLines {Boolean} - * Whether to find an appropriate tree line icon, or simply provide - * white space. - * - * @param bAlwaysShowOpenCloseSymbol {Boolean} - * Whether to display the open/close icon for a node even if it has no - * children. - * - * @param bExcludeFirstLevelTreeLines {Boolean} - * If bUseTreeLines is enabled, then further filtering of the left-most - * tree line may be specified here. If true then the left-most - * tree line, between top-level siblings, will not be displayed. - * If false, then the left-most tree line wiill be displayed - * just like all of the other tree lines. - * - * @return {var} TODOC - */ - _getIndentSymbol : function(column, - node, - bUseTreeLines, - bAlwaysShowOpenCloseSymbol, - bExcludeFirstLevelTreeLines) - { - var STDCR = org.argeo.ria.util.TreeDataCellRenderer; - - // If we're in column 0 and excludeFirstLevelTreeLines is enabled, then - // we treat this as if no tree lines were requested. - if (column == 0 && bExcludeFirstLevelTreeLines) - { - bUseTreeLines = false; - } - - // If we're not on the final column... - if (column < node.level - 1) - { - // then return either a line or a blank icon, depending on - // bUseTreeLines - return (bUseTreeLines && ! node.lastChild[column] - ? STDCR.__icon.line - : { icon : this.BLANK }); - } - - var bLastChild = node.lastChild[node.lastChild.length - 1]; - - // Is this a branch node that does not have the open/close button hidden? - if (node.type == qx.ui.treevirtual.SimpleTreeDataModel.Type.BRANCH && - ! node.bHideOpenClose) - { - // Does this node have any children, or do we always want the - // open/close symbol to be shown? - if (node.children.length > 0 || bAlwaysShowOpenCloseSymbol) - { - // If we're not showing tree lines... - if (!bUseTreeLines) - { - // ... then just use a expand or contract - return (node.bOpened - ? STDCR.__icon.contract - : STDCR.__icon.expand); - } - - // Are we looking at a top-level, first child of its parent? - if (column == 0 && node.bFirstChild) - { - // Yup. If it's also a last child... - if (bLastChild) - { - // ... then use no tree lines. - return (node.bOpened - ? STDCR.__icon.onlyContract - : STDCR.__icon.onlyExpand); - } - else - { - // otherwise, use descender lines but no ascender. - return (node.bOpened - ? STDCR.__icon.startContract - : STDCR.__icon.startExpand); - } - } - - // It's not a top-level, first child. Is this the last child of its - // parent? - if (bLastChild) - { - // Yup. Return an ending expand or contract. - return (node.bOpened - ? STDCR.__icon.endContract - : STDCR.__icon.endExpand); - } - - // Otherwise, return a crossing expand or contract. - return (node.bOpened - ? STDCR.__icon.crossContract - : STDCR.__icon.crossExpand); - } - } - - // This node does not have any children. Return an end or cross, if - // we're using tree lines. - if (bUseTreeLines) - { - // If this is a child of the root node... - if (node.parentNodeId == 0) - { - // If this is the only child... - if (bLastChild && node.bFirstChild) - { - // ... then return a blank. - return { icon : this.BLANK }; - } - - // Otherwise, if this is the last child... - if (bLastChild) - { - // ... then return an end line. - return STDCR.__icon.end; - } - - // Otherwise if this is the first child... - if (node.bFirstChild) - { - // ... then return a start line. - return STDCR.__icon.startContract; - } - } - - // If this is a last child, return and ending line; otherwise cross. - return (bLastChild - ? STDCR.__icon.end - : STDCR.__icon.cross); - } - - return { icon : this.BLANK }; - } - }, - - defer : function() - { - // Ensure that the theme is initialized - qx.theme.manager.Meta.getInstance().initialize(); - - var STDCR = org.argeo.ria.util.TreeDataCellRenderer; - - var ImageLoader = qx.io2.ImageLoader; - - var am = qx.util.AliasManager.getInstance(); - var rm = qx.util.ResourceManager; - var tm = qx.theme.manager.Appearance.getInstance(); - - var loadImage = function(f) - { - ImageLoader.load(rm.toUri(am.resolve(f))); - }; - - STDCR.__icon.line = tm.styleFrom("treevirtual-line"); - loadImage(STDCR.__icon.line.icon); - - STDCR.__icon.contract = tm.styleFrom("treevirtual-contract"); - loadImage(STDCR.__icon.contract.icon); - - STDCR.__icon.expand = tm.styleFrom("treevirtual-expand"); - loadImage(STDCR.__icon.expand.icon); - - STDCR.__icon.onlyContract = tm.styleFrom("treevirtual-only-contract"); - loadImage(STDCR.__icon.onlyContract.icon); - - STDCR.__icon.onlyExpand = tm.styleFrom("treevirtual-only-expand"); - loadImage(STDCR.__icon.onlyExpand.icon); - - STDCR.__icon.startContract = tm.styleFrom("treevirtual-start-contract"); - loadImage(STDCR.__icon.startContract.icon); - - STDCR.__icon.startExpand = tm.styleFrom("treevirtual-start-expand"); - loadImage(STDCR.__icon.startExpand.icon); - - STDCR.__icon.endContract = tm.styleFrom("treevirtual-end-contract"); - loadImage(STDCR.__icon.endContract.icon); - - STDCR.__icon.endExpand = tm.styleFrom("treevirtual-end-expand"); - loadImage(STDCR.__icon.endExpand.icon); - - STDCR.__icon.crossContract = tm.styleFrom("treevirtual-cross-contract"); - loadImage(STDCR.__icon.crossContract.icon); - - STDCR.__icon.crossExpand = tm.styleFrom("treevirtual-cross-expand"); - loadImage(STDCR.__icon.crossExpand.icon); - - STDCR.__icon.end = tm.styleFrom("treevirtual-end"); - loadImage(STDCR.__icon.end.icon); - - STDCR.__icon.cross = tm.styleFrom("treevirtual-cross"); - loadImage(STDCR.__icon.cross.icon); - }, - - destruct : function() - { - this._disposeFields( - "__am", - "__rm", - "__tm", - "BLANK"); - } -}); \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/util/__init__.js b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/util/__init__.js deleted file mode 100644 index d4ba4d145..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/class/org/argeo/ria/util/__init__.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Various utilitary classes, especially qooxdoo framework extensions - * to fix various bugs or missing features. - * - */ \ No newline at end of file diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/index.html b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/index.html deleted file mode 100644 index 4b3e26a01..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - Slc Webui - - - diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/ajax-loader.gif b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/ajax-loader.gif deleted file mode 100644 index df3303d53..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/ajax-loader.gif and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/dialog-ok.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/dialog-ok.png deleted file mode 100644 index 1ebbe39f0..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/dialog-ok.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/document-open-recent.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/document-open-recent.png deleted file mode 100644 index 538cc69ed..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/document-open-recent.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/document-open.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/document-open.png deleted file mode 100644 index 84272f836..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/document-open.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/document-print.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/document-print.png deleted file mode 100644 index 911aed3fa..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/document-print.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/edit-copy.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/edit-copy.png deleted file mode 100644 index d6e166904..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/edit-copy.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/edit-delete.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/edit-delete.png deleted file mode 100644 index 9ff19b4d6..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/edit-delete.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/flag.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/flag.png deleted file mode 100644 index 3240b29d5..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/flag.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/folder-new.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/folder-new.png deleted file mode 100644 index edff26f02..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/folder-new.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/folder.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/folder.png deleted file mode 100644 index 6937ed4a3..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/folder.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-bottom.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-bottom.png deleted file mode 100644 index 3a1740612..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-bottom.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-down.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-down.png deleted file mode 100644 index e48bf5b44..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-down.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-left.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-left.png deleted file mode 100644 index cd5862039..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-left.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-right.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-right.png deleted file mode 100644 index c001c92c1..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-right.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-top.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-top.png deleted file mode 100644 index f32de8dfd..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/go-top.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/help-about.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/help-about.png deleted file mode 100644 index f2d100697..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/help-about.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/help-contents.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/help-contents.png deleted file mode 100644 index c990916d6..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/help-contents.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/list-add.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/list-add.png deleted file mode 100644 index 0478b7d5c..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/list-add.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/media-playback-start-32.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/media-playback-start-32.png deleted file mode 100644 index 8248f32fc..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/media-playback-start-32.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/media-playback-start.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/media-playback-start.png deleted file mode 100644 index 4358164a2..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/media-playback-start.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-pdf.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-pdf.png deleted file mode 100644 index 27faad6fc..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-pdf.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-xls.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-xls.png deleted file mode 100644 index 126f1c878..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-xls.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-xml.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-xml.png deleted file mode 100644 index bc00f51a1..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-xml.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-xsl.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-xsl.png deleted file mode 100644 index a4acb09cb..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/mime-xsl.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/office-chart.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/office-chart.png deleted file mode 100644 index c6c290cf2..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/office-chart.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/process-stop.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/process-stop.png deleted file mode 100644 index fe3aba281..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/process-stop.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/system-shutdown.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/system-shutdown.png deleted file mode 100644 index f58089d4f..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/system-shutdown.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/test.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/test.png deleted file mode 100644 index ef360cdb4..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/test.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/utilities-terminal.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/utilities-terminal.png deleted file mode 100644 index 55a83d2d3..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/utilities-terminal.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/view-pane-tree.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/view-pane-tree.png deleted file mode 100644 index 7515fc9b2..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/view-pane-tree.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/view-refresh.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/view-refresh.png deleted file mode 100644 index bb3803b07..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/view-refresh.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/window-close.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/window-close.png deleted file mode 100644 index d4f48146e..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/window-close.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/zoom-fit-best.png b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/zoom-fit-best.png deleted file mode 100644 index 30b111331..000000000 Binary files a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/resource/slc/zoom-fit-best.png and /dev/null differ diff --git a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/translation/readme.txt b/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/translation/readme.txt deleted file mode 100644 index 66975e60e..000000000 --- a/server/org.argeo.slc.ria/src/main/webapp/argeo-ria-src/translation/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -This directory will contain translation (.po) files once you run the -'translation' job in your project. -