]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
API DOCUMENTATION
authorCharles du Jeu <charles.dujeu@gmail.com>
Tue, 27 Jan 2009 18:39:57 +0000 (18:39 +0000)
committerCharles du Jeu <charles.dujeu@gmail.com>
Tue, 27 Jan 2009 18:39:57 +0000 (18:39 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@2146 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

14 files changed:
org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/Applet.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/LauncherApplet.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcExecLoggerApplet.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcExecutionMessage.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/Application.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/IPerspective.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/IView.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/Modal.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/TabbedViewPane.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewPane.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/ViewsManager.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/event/Command.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/event/CommandsManager.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/remote/JmsClient.js

index 260b60c81a2614575ccb2a86b49387f176fcc148..4d43a12073153a92d02ff198a66b5a300d683b50 100644 (file)
@@ -89,10 +89,6 @@ qx.Class.define("org.argeo.slc.ria.Applet",
 
   members :
   {
-       /**
-        * Called at applet creation. Just registers viewPane.
-        * @param viewPane {org.argeo.ria.components.ViewPane} The viewPane.
-        */
        init : function(viewPane, xmlNode){
                this.setView(viewPane);
                this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId()));
@@ -104,10 +100,6 @@ qx.Class.define("org.argeo.slc.ria.Applet",
                }
        },
        
-       /**
-        * Load a given test : the data passed must be an XML node containing the test unique ID.
-        * @param xmlNode {Element} The text xml description. 
-        */
        load : function(){
                if(!this.data) return;
                if(this.loaded) return;
index 5aa46799494103d95ee04c8a7d7c87404845b770..03ec8cc980e16a685ed2d6512bdb1ed21365c7d3 100644 (file)
@@ -62,6 +62,9 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                        }
                }
        },
+       /**
+        * A map containing all currently registered agents.
+        */
        registeredTopics : {
                init : {},
                check : "Map", 
@@ -116,6 +119,9 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                this._amqClient.stopPolling();
        },
                
+       /**
+        * Creates the main applet layout.
+        */
        _createLayout : function(){
                this.formPane = new qx.ui.container.Composite(new qx.ui.layout.VBox(5));                
                this.scroll = new qx.ui.container.Scroll(this.formPane);
@@ -124,6 +130,9 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                
        },
                
+       /**
+        * Creates the form.
+        */
        _createForm : function(){
                this.fields = {};
                this.hiddenFields = {};
@@ -175,6 +184,10 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                this._showSelectedPart(qx.lang.Object.getKeys(this.parts)[0]);          
        },
        
+       /**
+        * Show a form part given its id.
+        * @param partId {String} The part id
+        */
        _showSelectedPart : function(partId){
                if(!this.parts) return;
                if(!this.partsContainer){
@@ -194,6 +207,12 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                }
        },
        
+       /**
+        * Init a form part : creates a pane, a set of fields, etc.
+        * @param formId {String} A unique ID
+        * @param label {String} A label
+        * @return {Map} The form part.
+        */
        _initFormPart : function(formId, label){
                if(!this.parts) this.parts = {};                
                var formObject = {};
@@ -207,6 +226,9 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                return formObject;
        },
        
+       /**
+        * To be overriden by this class children.
+        */
        _createFormVariableParts : function(){
                var standard = this._initFormPart("standard", "Canonical");
                this._createStandardForm(standard);
@@ -214,6 +236,10 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                this._createSimpleForm(simple);
        },
        
+       /**
+        * Creates a form for SLC demo
+        * @param formObject {Map} The form part
+        */
        _createSimpleForm : function(formObject){
 
                this._addFormInputText(formObject, "ant.file", "File", "Category1/SubCategory2/build.xml");
@@ -229,6 +255,10 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                
        },
        
+       /**
+        * Create a canonical form.
+        * @param formObject {Map} The form part
+        */
        _createStandardForm : function(formObject){
                
                this._addFormHeader(formObject, "Set Execution Parameters");
@@ -247,10 +277,24 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                this._addFormInputText(formObject);             
        },
        
+       /**
+        * Add an hidden field to the form
+        * @param formObject {Map} The form part
+        * @param fieldName {String} Name
+        * @param fieldValue {String} Value
+        */
        _addFormHiddenField : function(formObject, fieldName, fieldValue){
                formObject.hiddenFields[fieldName] = fieldValue;
        },
        
+       /**
+        * Creates a simple label/input form entry.
+        * @param formObject {Map} The form part
+        * @param fieldName {String} Name
+        * @param fieldLabel {String} Label of the field
+        * @param defaultValue {String} The default value
+        * @param choiceValues {Map} An map of values
+        */
        _addFormInputText : function(formObject, fieldName, fieldLabel, defaultValue, choiceValues){
                var labelElement;
                if(choiceValues){
@@ -277,6 +321,12 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                this._addFormEntry(formObject, labelElement, fieldElement);
        },
        
+       /**
+        * Add an header
+        * @param formObject {Map} The form part
+        * @param content {Mixed} Content to add.
+        * @param additionnalButton {Mixed} Any widget to add on the east.
+        */
        _addFormHeader : function(formObject, content, additionnalButton){
                var header = new qx.ui.basic.Label('<b>'+content+'</b>');
                header.setRich(true);           
@@ -293,6 +343,12 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                }
        },
        
+       /**
+        * Adds a label/input like entry in the form.
+        * @param formObject {Map} The form part
+        * @param labelElement {Object} Either a label or an input 
+        * @param fieldElement {Object} Any form input.
+        */
        _addFormEntry : function(formObject, labelElement, fieldElement){
                var entryPane = new qx.ui.container.Composite(new qx.ui.layout.HBox(5));
                labelElement.setWidth(100);
@@ -323,6 +379,10 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
        },
        */
                
+       /**
+        * Refresh the selector when the topics are updated.
+        * @param changeTopicsEvent {qx.event.type.DataEvent} The reload event.
+        */
        _feedSelector : function(changeTopicsEvent){
                var topics = changeTopicsEvent.getData();
                this.agentSelector.removeAll();
@@ -352,6 +412,14 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
        },
        */
        
+       /**
+        * Make an SlcExecutionMessage from the currently displayed form.
+        * @param crtPartId {String} The form part currently displayed
+        * @param slcExec {org.argeo.slc.ria.SlcExecutionMessage} The message to fill.
+        * @param fields {Map} The fields of the form
+        * @param hiddenFields {Map} The hidden ones 
+        * @param freeFields {Array} The free fields.
+        */
        _prepareSlcExecutionMessage : function(crtPartId, slcExec, fields, hiddenFields, freeFields){
                if(crtPartId == "standard"){
                        slcExec.setStatus(fields.status.getValue());            
@@ -368,6 +436,9 @@ qx.Class.define("org.argeo.slc.ria.LauncherApplet",
                }               
        },
        
+       /**
+        * Called when the user clicks the "Execute" button.
+        */
        submitForm : function(){
                var currentUuid = this.agentSelector.getValue();
                if(!currentUuid) return;
index 39cd45730e449e579665d35b6487f9138379af10..7d644316e325e7b86b10e68a328d5025d4a15214 100644 (file)
@@ -77,6 +77,9 @@ qx.Class.define("org.argeo.slc.ria.SlcExecLoggerApplet",
                this.timer.stop();\r
        },\r
                \r
+       /**\r
+        * Creates the applet layout\r
+        */\r
        _createLayout : function(){\r
                this.logModel = new qx.ui.table.model.Simple();\r
                this.logModel.setColumns(["Date", "Host", "Id", "Status"]);\r
@@ -90,6 +93,9 @@ qx.Class.define("org.argeo.slc.ria.SlcExecLoggerApplet",
                this.add(this.logPane, {edge:'center'});\r
        },\r
        \r
+       /**\r
+        * Initialize the log table.\r
+        */\r
        _initLogger : function(){\r
                this.logPane.set({              \r
                        statusBarVisible: false,\r
@@ -101,6 +107,9 @@ qx.Class.define("org.argeo.slc.ria.SlcExecLoggerApplet",
                columnModel.getBehavior().setWidth(3, "12%");           \r
        },\r
        \r
+       /**\r
+        * Refresh the data model.\r
+        */\r
        _reloadLogger : function(){\r
                var request = org.argeo.slc.ria.SlcApi.getListSlcExecutionsService();\r
                request.addListener("completed", function(response){                    \r
index c9194f7f3eedce9d70747d5c1c02d2d87e4d6d3a..012ac49928bbc13f0f6e0449b01295a292858859 100644 (file)
@@ -3,6 +3,10 @@
  */\r
 qx.Class.define("org.argeo.slc.ria.SlcExecutionMessage", {\r
        extend : qx.core.Object,\r
+       /**\r
+        * New instance\r
+        * @param uuid {String} The Uuid of the message. If none is passed, one is generated.\r
+        */\r
        construct : function(uuid){\r
                this.base(arguments);\r
                if(uuid){\r
@@ -54,6 +58,9 @@ qx.Class.define("org.argeo.slc.ria.SlcExecutionMessage", {
                        check : "String",\r
                        init : "user"\r
                },\r
+               /**\r
+                * Date of the message. now() by default.\r
+                */\r
                date : {\r
                        check : "String", \r
                        init : new Date().toString()\r
@@ -67,6 +74,11 @@ qx.Class.define("org.argeo.slc.ria.SlcExecutionMessage", {
        },\r
        members : {\r
                \r
+               /**\r
+                * Add a free attribute to the message\r
+                * @param attName {String} Name\r
+                * @param attValue {String} Value\r
+                */\r
                addAttribute: function(attName, attValue){\r
                        var attr = this.getAttributes();\r
                        attr[attName] = attValue;\r
@@ -96,6 +108,10 @@ qx.Class.define("org.argeo.slc.ria.SlcExecutionMessage", {
                        return builder.get();\r
                },\r
                \r
+               /**\r
+                * Parse an XML answer and fill the object with it.\r
+                * @param slcExecXml {String} An slcExecMessage mapped in XML.\r
+                */\r
                fromXml : function(slcExecXml){\r
                        var NSMap = {slc:"http://argeo.org/projects/slc/schemas"};                      \r
                        this.setStatus(org.argeo.ria.util.Element.getSingleNodeText(slcExecXml, "slc:status", NSMap));\r
index f9de781a004e119a2478aaa336b66070d01ff7e6..a1e5901f18802149bf3ac692af8ec7ea8e71c8ab 100644 (file)
@@ -26,17 +26,29 @@ qx.Class.define("org.argeo.ria.Application",
   },\r
   \r
   properties : {\r
+       /**\r
+        * Available perspective detected in the current compilation.\r
+        */\r
        perspectives : {\r
                check : "Map",\r
                init : {}\r
        },\r
+       /**\r
+        * Currently layouted perspective label\r
+        */\r
        activePerspectiveName : {\r
                check : "String",\r
                init : ""\r
        },\r
+       /**\r
+        *  Currently layouted perspective.\r
+        */\r
        activePerspective : {\r
                init : null\r
        },\r
+       /**\r
+        * Basic command associated to the application, applicable to all perspectives.\r
+        */\r
        commandsDefinitions : {\r
                init : {\r
                        "stop" : {\r
@@ -191,6 +203,10 @@ qx.Class.define("org.argeo.ria.Application",
       this.loadPerspective();\r
     },\r
     \r
+    /**\r
+     * Load a given perspective by its name.\r
+     * @param perspectiveName {String} Perspective to load\r
+     */\r
     loadPerspective : function(perspectiveName){\r
        if(perspectiveName){\r
                this.setActivePerspectiveName(perspectiveName);\r
@@ -214,6 +230,9 @@ qx.Class.define("org.argeo.ria.Application",
                this.setActivePerspective(perspective);\r
     },\r
     \r
+    /**\r
+     * After switching perspective, call this function to rebuild menu with the right selected.\r
+     */\r
     rebuildPerspectiveMenus : function(){\r
             var switchCommand = this.getCommandsDefinitions()["switchperspective"];\r
             switchCommand.submenu = [];\r
@@ -232,12 +251,20 @@ qx.Class.define("org.argeo.ria.Application",
                }\r
     },\r
 \r
+    /**\r
+     * Specific action of calling an external URL without triggering the "close()" method\r
+     * of Application.\r
+     * @param hrefValue {String} A download url that should reply with specific "attachment" header to avoid leaving the application.\r
+     */\r
     javascriptDownloadLocation: function(hrefValue){\r
        this.interruptClose = true;\r
        document.location.href = hrefValue;\r
        this.interruptClose = false;\r
     },\r
     \r
+    /**\r
+     * Called at Application ending (closing the browser).\r
+     */\r
     close : function(){\r
        if(this.interruptClose) return ;        \r
                if(this.getActivePerspective()){\r
index 03216009628534324125bf9daa1c7f782117ef5d..2297aeebf69e2295612e9dbf4ce721b2f7dac9a1 100644 (file)
@@ -8,7 +8,13 @@
 qx.Interface.define("org.argeo.ria.components.IPerspective", {\r
        \r
        statics : {\r
+               /**\r
+                * The human readable name of the perspective\r
+                */\r
                LABEL : "",\r
+               /**\r
+                * An image resource associated to the perspective\r
+                */\r
                ICON  : ""\r
        },\r
        \r
index 6fe9bcbbb803e494ca09d3db2bed43bfb4c8b534..4607788ee2bff3e33f4f43d091dd523a9ae15e4d 100644 (file)
@@ -33,15 +33,15 @@ qx.Interface.define("org.argeo.ria.components.IView", {
                 * This is the role of the manager to actually add the graphical component to the pane, \r
                 * so it's not necessary to do it here. \r
                 * @param viewPane {org.argeo.ria.components.ViewPane} The pane manager\r
+                * @param data {Mixed} Any object or data passed by the initiator of the view\r
                 * @return {Boolean}\r
                 */\r
                init : function(viewPane, data){return true;},\r
                /**\r
                 * The implementation should contain the real data loading (i.o. query...)\r
-                * @param data {mixed} Any data in any format\r
                 * @return {Boolean}\r
                 */\r
-               load : function(data){return true;},\r
+               load : function(){return true;},\r
                /**\r
                 * Whether this component is already contained in a scroller (return false) or not (return true).\r
                 * @return {Boolean}\r
index 58d3a6642febc78ad20a1291999d8ff0ba609220..3d3150b348b415e56e7a518440fecae954284d58 100644 (file)
@@ -8,6 +8,9 @@ qx.Class.define("org.argeo.ria.components.Modal",
        extend : qx.ui.window.Window,\r
   \r
        events : {\r
+               /**\r
+                * Triggered when the user clicks the "ok" button. \r
+                */\r
                "ok" : "qx.event.type.Event"\r
        },\r
        /**\r
@@ -44,6 +47,10 @@ qx.Class.define("org.argeo.ria.components.Modal",
                        this.add(label, {edge:'center', width:'100%'});\r
                        this.addCloseButton();\r
                },\r
+               /**\r
+                * Add a question and ok / cancel buttons\r
+                * @param text {String} The question to ask to the user\r
+                */\r
                addConfirm : function(text){\r
                        var label = new qx.ui.basic.Label(text);\r
                        label.setRich(true);\r
index f55a04d0223960a7a1450bf942569b7245840f8e..27742dd41a15ce85d470d97fa5d63d1b85361525 100644 (file)
@@ -1,3 +1,8 @@
+/**\r
+ * A more elaborate views container than ViewPane, as it can handle multiple contents\r
+ * at once via a TabView.\r
+ * See {@link org.argeo.ria.components.ViewPane}.\r
+ */\r
 qx.Class.define("org.argeo.ria.components.TabbedViewPane",\r
 {\r
        extend : qx.ui.container.Composite,\r
@@ -6,7 +11,6 @@ qx.Class.define("org.argeo.ria.components.TabbedViewPane",
   /**\r
    * @param viewId {String} Unique id of this viewPane\r
    * @param viewTitle {String} Readable Title of this viewPane\r
-   * @param splitPaneData {Map} Additionnal data to be used by splitpanes implementations.\r
    */\r
        construct : function(viewId, viewTitle){\r
                this.base(arguments);\r
@@ -64,12 +68,21 @@ qx.Class.define("org.argeo.ria.components.TabbedViewPane",
        },\r
        \r
        members : {\r
+               /**\r
+                * Checks if the pane already contains a given view, identified by its instance id\r
+                * @param contentId {Mixed} The instance id to check\r
+                * @return {Boolean}\r
+                */\r
                contentExists : function(contentId){\r
                        if(this.pageIds[contentId]){\r
                                this.tabView.setSelected(this.pageIds[contentId]);\r
                                return this.pageIds[contentId].getUserData("argeoria.iview");\r
                        }                                               \r
                },\r
+               /**\r
+                * Sets a new instance in the tabbed pane.\r
+                * @param content {org.argeo.ria.components.IView} The applet to add.\r
+                */\r
                setContent : function(content){\r
                        if(!this.tabView.getChildren().length){\r
                                this.tabView.setBackgroundColor("transparent");\r
@@ -88,19 +101,34 @@ qx.Class.define("org.argeo.ria.components.TabbedViewPane",
                        }, this);\r
                        this.tabView.setSelected(page);\r
                },\r
+               /**\r
+                * Get the currently selected tab content, if any.\r
+                * @return {org.argeo.ria.components.IView} The currently selected view.\r
+                */\r
                getContent : function(){\r
                        if(this._getCrtPage()){\r
                                return this._getCrtPage().getUserData("argeoria.iview");\r
                        }\r
                        return null;\r
                },\r
+               /**\r
+                * Get the currently selected tab ViewSelection object.\r
+                * @return {org.argeo.ria.components.ViewSelection} The view selection object of the currently selected view.\r
+                */\r
                getViewSelection : function(){\r
                        if(!this.getContent()) return null;\r
                        return this.getContent().getViewSelection();\r
                },\r
+               /**\r
+                * Return the currently selected tab Page.\r
+                * @return {qx.ui.tabview.Page} The page\r
+                */\r
                _getCrtPage : function(){\r
                        return this.tabView.getSelected();\r
                },\r
+               /**\r
+                * Closes the currently selected view and remove all tabs components (button, page).\r
+                */\r
                closeCurrent : function(){\r
                        var crtPage = this._getCrtPage();\r
                        if(!crtPage) return;\r
@@ -118,6 +146,9 @@ qx.Class.define("org.argeo.ria.components.TabbedViewPane",
                                this.tabView.setMarginTop(27);\r
                        }                                               \r
                },\r
+               /**\r
+                * Call closeCurrent() recursively until there is no more page.\r
+                */\r
                empty : function(){\r
                        var crtPage = this._getCrtPage();\r
                        while(crtPage){\r
@@ -125,15 +156,25 @@ qx.Class.define("org.argeo.ria.components.TabbedViewPane",
                                crtPage = this._getCrtPage();\r
                        }\r
                },\r
+               /**\r
+                * Sets the tabView on "load" state. Nothing is done at the moment.\r
+                * @param load {Boolean} Load status\r
+                */\r
                setOnLoad : function(load){\r
                        \r
                },\r
+               /**\r
+                * Sets a graphical indicator that this pane has the focus. A blue border.\r
+                */\r
                focus : function(){\r
                        if(this.hasFocus) return;\r
                        this.fireEvent("changeSelection");\r
                        this.setDecorator(this.focusedDecorator);\r
                        this.hasFocus = true;\r
                }, \r
+               /**\r
+                * Remove a graphical focus indicator on this pane.\r
+                */\r
                blur : function(){\r
                        this.hasFocus = false;\r
                        this.setDecorator(this.blurredDecorator);\r
index 0a952c6fb1a47c21cd3c5246dc69c75d5288b42a..0ca43f32d1d4b983820651ee46e20aff2a2a4b80 100644 (file)
@@ -30,7 +30,13 @@ qx.Class.define("org.argeo.ria.components.ViewPane",
   },
 
   events : {
+       /**
+        * Trigger when the focus is changing
+        */
        "changeFocus" : "qx.event.type.Data",
+       /**
+        * Triggered when selection of content has changed.
+        */
        "changeSelection" : "qx.event.type.Event"
   },
   
@@ -130,13 +136,21 @@ qx.Class.define("org.argeo.ria.components.ViewPane",
                */
        },
        
+       /**
+        * 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();
@@ -189,6 +203,9 @@ qx.Class.define("org.argeo.ria.components.ViewPane",
                }
        },
 
+       /**
+        * Call empty() method, since this pane can only handle one view.
+        */
        closeCurrent : function(){
                this.empty();
        },
@@ -212,13 +229,18 @@ qx.Class.define("org.argeo.ria.components.ViewPane",
                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"));
index 6ac3f2efab485b7e2ef2e3d238e835dd5afaba4d..225bc693bca4ee9b6d7b28d1657eb5c3b5dbfe21 100644 (file)
@@ -19,6 +19,9 @@ qx.Class.define("org.argeo.ria.components.ViewsManager",
         * The main container for the org.argeo.ria.components.ViewPane instances. \r
         */\r
        viewPanesContainer : {init: null},\r
+       /**\r
+        * Keeps the currently focused viewPane. \r
+        */\r
        currentFocus : {init :null}\r
   },\r
   construct : function(){\r
@@ -31,6 +34,7 @@ qx.Class.define("org.argeo.ria.components.ViewsManager",
         * \r
         * @param classObj {Clazz} The class object to instantiate\r
         * @param viewPaneId {String} The unique ID of the view pane\r
+        * @param data {Mixed} Any data provided by the opener.\r
         * @return {org.argeo.ria.components.IView}\r
         */\r
        initIViewClass: function(classObj, viewPaneId, data){\r
@@ -68,6 +72,10 @@ qx.Class.define("org.argeo.ria.components.ViewsManager",
                        this.setViewPaneFocus(e.getTarget());\r
                }, this);\r
        },\r
+       /**\r
+        * Sets a given viewPane as the currently focused one. Blur the others.\r
+        * @param viewPane {org.argeo.ria.components.ViewPane} The viewPane (or TabbedViewPane) to focus on.\r
+        */\r
        setViewPaneFocus : function(viewPane){\r
                for(var key in this.views){\r
                        this.views[key].blur();\r
index 9ad87c5b9a926e5d8505c7c69a17b74b5b659eef..127e20c516c729a11d6a67036b51c5ab0eadcb0b 100644 (file)
                return button;\r
        },\r
          \r
+       /**\r
+        * Register a given callback to be shared by one or more focusable part.\r
+        * @param callback {Function} A callback function\r
+        * @param focusablePartId {String} A string identifiing a focusable part. At the moment, it can only be "view:viewId"\r
+        */\r
        registerCallback : function(callback, focusablePartId){\r
                this.callbacks[focusablePartId] = callback;\r
        },\r
+       /**\r
+        * Return all the registered callbacks for this command.\r
+        * @return {Map} A map of callback, viewId => callBack.\r
+        */\r
        getCallbacks : function(){\r
                return this.callbacks;\r
        },\r
+       /**\r
+        * Remove a callback for a given focusable part.\r
+        * @param focusablePartId {String} A id like "view:viewId".\r
+        */\r
        removeCallback : function(focusablePartId){\r
                if(this.callbacks[focusablePartId]){\r
                        delete this.callbacks[focusablePartId];\r
index 324a13cdf36afa2fb2749046291756e05bbf077a..8f0428076b95378e9a78d809d18ad4b33d99b971 100644 (file)
@@ -84,6 +84,9 @@ qx.Class.define("org.argeo.ria.event.CommandsManager",
                init : {},\r
                check : "Map"\r
        },\r
+       /**\r
+        * Special command definitions that are shared between focusable parts. \r
+        */\r
        sharedDefinitions : {\r
                init: {},\r
                check: "Map"\r
@@ -105,6 +108,10 @@ qx.Class.define("org.argeo.ria.event.CommandsManager",
 \r
   members :\r
   {\r
+       /**\r
+        * Initialize the manager with basic definitions.\r
+        * @param initDefinitions {Map} A map of commands definitions.\r
+        */\r
        init : function(initDefinitions){\r
                this.setDefinitions(initDefinitions);\r
                this.setInitialDefinitions(qx.lang.Object.copy(initDefinitions));\r
@@ -284,7 +291,8 @@ qx.Class.define("org.argeo.ria.event.CommandsManager",
        /**\r
         * Add a new set of commands definitions. See the definitions property of this class.\r
         * @param definitions {Map} a set of commands definitions.\r
-        * @param callbackContext {qx.ui.core.Object} The context used inside the commands callbacks. \r
+        * @param callbackContext {qx.ui.core.Object} The context used inside the commands callbacks.\r
+        * @param focusablePartId {String} A string identifying the associated focusable part, like "view:viewId". \r
         */\r
        addCommands : function(definitions, callbackContext, focusablePartId){\r
                var crtDefs = this.getDefinitions();            \r
@@ -309,6 +317,7 @@ qx.Class.define("org.argeo.ria.event.CommandsManager",
        /**\r
         * Removes a whole set of commands by their definitions maps.\r
         * @param definitions {Map} a set of commands definitions\r
+        * @param focusablePartId {String} A string identifying the associated focusable part, like "view:viewId".  \r
         */\r
        removeCommands : function(definitions, focusablePartId){\r
                var crtDefs = this.getDefinitions();\r
index deb09c9476fe4c2a687bde1f9713dbfa56c27f42..eceaceff0c7585997672cb6e16df8fd1f167c5f2 100644 (file)
@@ -1,3 +1,7 @@
+/**\r
+ * A standard client for sending/receiving JMS message.\r
+ * It is based on ActiveMQ Ajax implementation.\r
+ */\r
 qx.Class.define("org.argeo.ria.remote.JmsClient", {\r
 \r
        type : "singleton",\r
@@ -20,9 +24,17 @@ qx.Class.define("org.argeo.ria.remote.JmsClient", {
                _pollDelay : 0,\r
 \r
                _first : true,\r
+               /**\r
+                * Trigger at each poll event.\r
+                * @param first {Boolean} Whether it is the first event to be triggered. \r
+                */\r
                _pollEvent : function(first) {},\r
                _handlers : new Array(),\r
 \r
+               /**\r
+                * Parses the XML response to a message POST.\r
+                * @param response {qx.io.remote.Response} The query response\r
+                */\r
                _messageHandler : function(response) {\r
                        var doc = response.getContent();                        \r
                        var messages = org.argeo.ria.util.Element.selectNodes(doc, "//response");\r
@@ -34,6 +46,10 @@ qx.Class.define("org.argeo.ria.remote.JmsClient", {
                        }\r
                },\r
                \r
+               /**\r
+                * Parses the empty response of a poll GET query.\r
+                * @param response {qx.io.remote.Response} The query response\r
+                */\r
                _pollHandler : function(response) {\r
                        try {\r
                                this._messageHandler(response);\r
@@ -49,6 +65,10 @@ qx.Class.define("org.argeo.ria.remote.JmsClient", {
                                this._sendPoll();\r
                },\r
 \r
+               /**\r
+                * Send a poll query : GET query and no paramter at all. \r
+                * @param request {qx.io.remote.Request} A request object\r
+                */\r
                _sendPoll : function(request) {\r
                        if(this.interrupt) return;\r
                        var request = new qx.io.remote.Request(this.uri, "GET", "application/xml");\r
@@ -57,9 +77,13 @@ qx.Class.define("org.argeo.ria.remote.JmsClient", {
                        request.send();\r
                },\r
 \r
-               // Add a function that gets called on every poll response, after all received\r
-               // messages have been handled.  The poll handler is past a boolean that indicates\r
-               // if this is the first poll for the page.\r
+               /**\r
+                * Add a function that gets called on every poll response, after all received\r
+                * messages have been handled.  The poll handler is past a boolean that indicates\r
+                * if this is the first poll for the page.\r
+                * \r
+                * @param func {Function} The handler to be called. \r
+                */\r
                addPollHandler : function(func) {\r
                        var old = this._pollEvent;\r
                        this._pollEvent = function(first) {\r
@@ -68,24 +92,47 @@ qx.Class.define("org.argeo.ria.remote.JmsClient", {
                        }\r
                },\r
 \r
-               // Send a JMS message to a destination (eg topic://MY.TOPIC).  Message should be xml or encoded\r
-               // xml content.\r
+               /**\r
+                * Send a JMS message to a destination (eg topic://MY.TOPIC).  \r
+                * Message should be xml or encoded xml content.\r
+                * \r
+                * @param destination {String} The topic destination\r
+                * @param message {String} XML encoded message\r
+                * @param properties {Map} A map of additional parameters to add to the query.\r
+                */\r
                sendMessage : function(destination, message, properties) {\r
                        this._sendMessage(destination, message, 'send', properties);\r
                },\r
 \r
-               // Listen on a channel or topic.   handler must be a function taking a message arguement\r
+               /**\r
+                * Listen on a channel or topic.   handler must be a function taking a message arguement\r
+                * @param id {String} A unique identifier for this handler\r
+                * @param destination {String} The topic to listen to (topic://MY.TOPIC) \r
+                * @param handler {Function} The handler to trigger when receiving a message \r
+                * @param context {Object} An object to bind on the handler.\r
+                */\r
                addListener : function(id, destination, handler, context) {\r
                        this._handlers[id] = qx.lang.Function.bind(handler, context);\r
                        this._sendMessage(destination, id, 'listen');\r
                },\r
 \r
-               // remove Listener from channel or topic.\r
+               /**\r
+                * Remove Listener from channel or topic.\r
+                * @param id {String} identifier of the handler to remove.\r
+                * @param destination {String} The topic to listen to (topic://MY.TOPIC) \r
+                */ \r
                removeListener : function(id, destination) {\r
                        this._handlers[id] = null;\r
                        this._sendMessage(destination, id, 'unlisten');\r
                },\r
-\r
+               \r
+               /**\r
+                * Send a message of a given type.\r
+                * @param destination {String} The topic to listen to (topic://MY.TOPIC) \r
+                * @param message {String} XML encoded message\r
+                * @param type {String} The JMS-Type of message (listen, unlisten, send).\r
+                * @param properties {Map} A map of additional parameters to add to the query.\r
+                */\r
                _sendMessage : function(destination, message, type, properties) {\r
                        var req = new qx.io.remote.Request(this.uri, "POST", "text/plain");\r
                        req.setParameter("destination", destination);\r
@@ -100,6 +147,9 @@ qx.Class.define("org.argeo.ria.remote.JmsClient", {
                        req.send();\r
                },\r
 \r
+               /**\r
+                * Starts a poll on the JMS server.\r
+                */\r
                startPolling : function() {\r
                        if (this.poll){\r
                                this.interrupt = false;\r
@@ -110,6 +160,9 @@ qx.Class.define("org.argeo.ria.remote.JmsClient", {
                        }\r
                },\r
                \r
+               /**\r
+                * Stops polling the JMS server.\r
+                */\r
                stopPolling : function(){\r
                        this.interrupt = true;\r
                }\r