]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
API Documentation
authorCharles du Jeu <charles.dujeu@gmail.com>
Tue, 10 Mar 2009 10:53:52 +0000 (10:53 +0000)
committerCharles du Jeu <charles.dujeu@gmail.com>
Tue, 10 Mar 2009 10:53:52 +0000 (10:53 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@2244 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/NewLauncherApplet.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/BatchEntrySpec.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Flow.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Module.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Spec.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/SpecEditor.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Value.js
org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js

index 4fb4c3048ca6702ac01778e35a6a9f1fbd088071..037e7b79a617417f27c321d35ef504f1e35e78f6 100644 (file)
@@ -25,7 +25,10 @@ qx.Class.define("org.argeo.slc.ria.NewLauncherApplet",
                check:"org.argeo.ria.components.ViewSelection"
        },              
        instanceId : {init:""},
-       instanceLabel : {init:""},  
+       instanceLabel : {init:""},
+       /**
+        * A boolean registering whether the SpecEditor must autoOpen or not when a spec is added to the Batch. 
+        */
        autoOpen : {
                init : true,
                check : "Boolean"
@@ -183,6 +186,10 @@ qx.Class.define("org.argeo.slc.ria.NewLauncherApplet",
   },
 
   statics : {
+       /**
+        * Loader for the "flow" level : takes a folder containing "moduleData" and create its children. 
+        * @param folder {qx.ui.tree.TreeFolder} A Tree folder containing in the key "moduleData" of its user data a map containing the keys {name,version} 
+        */
        flowLoader : function(folder){
                var moduleData = folder.getUserData("moduleData");
                //var req = org.argeo.ria.remote.RequestManager.getInstance().getRequest("../argeo-ria-src/stub.xml", "GET", "application/xml");
@@ -202,6 +209,10 @@ qx.Class.define("org.argeo.slc.ria.NewLauncherApplet",
                req.send();             
        },
        
+       /**
+        * Loader for the "modules" level : takes any tree folder, currently the root folder. 
+        * @param folder {qx.ui.tree.TreeFolder} The root folder
+        */
        modulesLoader : function(folder){
                var req = org.argeo.slc.ria.SlcApi.getListModulesService();
                req.addListener("completed", function(response){
@@ -428,7 +439,12 @@ qx.Class.define("org.argeo.slc.ria.NewLauncherApplet",
                splitPane.add(this.tree, 0);
                splitPane.add(this.listPane, 1);                
        },
-               
+       
+       /**
+        * Adds a given ExecutionFlow to the batch
+        * @param target {mixed} The dropped target, can be a TreeFile (add) or a ListItem (reorder).
+        * @param after {qx.ui.form.ListItem} Optional list item : if set, the flow will be added as a new list item positionned after this one. 
+        */
        _addFlowToBatch : function(target, after){
                //this.debug(target);
                if(!target){
@@ -483,6 +499,10 @@ qx.Class.define("org.argeo.slc.ria.NewLauncherApplet",
                if(menu.length) command.setEnabled(true);
        },
                
+       /**
+        * Create XMLString to send for execution 
+        * @return {String}
+        */
        currentBatchToXml : function(){
                var selection = this.list.getChildren();
                var xmlString = "";
@@ -493,6 +513,10 @@ qx.Class.define("org.argeo.slc.ria.NewLauncherApplet",
                return xmlString;
        },
        
+       /**
+        * Called at execution
+        * @param agentUuid {String} The id of the target agent
+        */
        executeBatchOnAgent : function(agentUuid){
                //var xmlString = agentUuid + this.currentBatchToXml();
                var xmlString = "<slc:executionSpecs>"+this.currentBatchToXml()+"</slc:executionSpecs>";
index 9d1508a2b787899cdc8e55a79b2ccf0f6cb6b235..3511ac5a975d2d3c809250851db833546bdd835a 100644 (file)
@@ -5,11 +5,25 @@ qx.Class.define("org.argeo.slc.ria.execution.BatchEntrySpec", {
        extend : org.argeo.slc.ria.execution.Spec,\r
        \r
        properties : {\r
+               /**\r
+                * Reference module\r
+                */\r
                module :{},\r
+               /**\r
+                * Reference flow\r
+                */\r
                flow : {},\r
+               /**\r
+                * Original Spec (values shall stay untouched).\r
+                */\r
                originalSpec : {}               \r
        },\r
        \r
+       /**\r
+        * Instance of BatchEntrySpec\r
+        * @param module {org.argeo.slc.ria.execution.Module} Reference module\r
+        * @param flow {org.argeo.slc.ria.execution.Flow} Reference flow\r
+        */\r
        construct : function(module, flow){\r
                this.base(arguments);\r
                this.setModule(module);\r
@@ -20,7 +34,10 @@ qx.Class.define("org.argeo.slc.ria.execution.BatchEntrySpec", {
        },\r
        \r
        members :  {\r
-               \r
+               /**\r
+                * Create a label to display in the batch list.\r
+                * @return {String} The label\r
+                */\r
                getLabel : function(){\r
                        var label = this.getModule().getName();\r
                        label += "/" + this.getModule().getVersion();\r
index 124e14e8ab9f5ebe68c57f85c0c40e3755608d18..10473aa5ca037590e906ff24708e9c830dc4c018 100644 (file)
@@ -25,6 +25,9 @@ qx.Class.define("org.argeo.slc.ria.execution.Flow", {
                executionSpec : {\r
                        check : "org.argeo.slc.ria.execution.Spec"\r
                },\r
+               /**\r
+                * The values to init the ExecutionSpec\r
+                */\r
                values : {\r
                        check : "Node"\r
                },\r
@@ -37,8 +40,17 @@ qx.Class.define("org.argeo.slc.ria.execution.Flow", {
        },\r
        \r
        statics : {\r
+               /**\r
+                * Xpath to the name \r
+                */\r
                XPATH_NAME : "@name",\r
+               /**\r
+                * XPath to the ExecutionSpec name\r
+                */\r
                XPATH_EXEC_SPEC_NAME : "@executionSpec",\r
+               /**\r
+                * XPath to the values\r
+                */\r
                XPATH_VALUES : "slc:values"\r
        },\r
        \r
@@ -59,6 +71,13 @@ qx.Class.define("org.argeo.slc.ria.execution.Flow", {
                        var values = org.argeo.ria.util.Element.selectNodes(xmlNode, this.self(arguments).XPATH_VALUES);\r
                        this.setValues(values[0]);\r
                },\r
+               /**\r
+                * Get a given value inside the values map\r
+                * @param key {String} The key of the value \r
+                * @param specType {String} Expected type (currently "primitive" and "ref" are supported)\r
+                * @param specSubType {String} Expected subtype (depends on the type)\r
+                * @return {String} Value if it is set.\r
+                */\r
                getValue: function(key, specType, specSubType){\r
                        var xpath;\r
                        if(specType == "primitive"){\r
index c95b9915b6016cc157ab0571e7ec8418271b793e..5e5343184368d91f5dddb95960414b59a2972033 100644 (file)
@@ -56,7 +56,7 @@ qx.Class.define("org.argeo.slc.ria.execution.Module", {
        members : {\r
                /**\r
                 * Add an execution flow to this module\r
-                * @param executionFlow {org.argeo.slc.ria.execution.Flow}\r
+                * @param executionFlow {org.argeo.slc.ria.execution.Flow} An instance of execution.Flow\r
                 */\r
                addExecutionFlow : function(executionFlow){\r
                        var spec = this.getExecutionSpecByName(executionFlow.getExecutionSpecName());\r
@@ -70,16 +70,25 @@ qx.Class.define("org.argeo.slc.ria.execution.Module", {
                \r
                /**\r
                 * Add an execution Spec to this module\r
-                * @param executionSpec {org.argeo.slc.ria.execution.Spec}\r
+                * @param executionSpec {org.argeo.slc.ria.execution.Spec} An instance of ExecutionSpec\r
                 */\r
                addExecutionSpec : function(executionSpec){\r
                        this.getExecutionSpecs()[executionSpec.getName()] = executionSpec;\r
                },\r
-               \r
+               /**\r
+                * Find an execution spec by its name\r
+                * @param name {String} Name of the spec\r
+                * @return {org.argeo.slc.ria.execution.Spec} The spec\r
+                */\r
                getExecutionSpecByName : function(name){\r
                        return this.getExecutionSpecs()[name];\r
                },\r
                \r
+               /**\r
+                * Find an execution flow by its name\r
+                * @param name {String} name of the flow\r
+                * @return {org.argeo.slc.ria.execution.Flow} The flow\r
+                */\r
                getExecutionFlowByName : function(name){\r
                        return this.getExecutionFlows()[name];\r
                },\r
index 680cc9993c371f7f0a3a33ca0967d64f4f5a9109..2a7a3c03996be4b2105a8b7334904227031f0c6c 100644 (file)
@@ -55,6 +55,10 @@ qx.Class.define("org.argeo.slc.ria.execution.Spec", {
                        }\r
                        this.setValues(parsedValues);\r
                },\r
+               /**\r
+                * XML Representation of this object.\r
+                * @return {String} An XML String\r
+                */\r
                toXml : function(){\r
                        var valuesXml = '';\r
                        var values = this.getValues();\r
index d4b6217813db178876a315580af748ac8ed86e63..59d8e8661cc629c886dcc79571bdf29c83738144 100644 (file)
@@ -8,6 +8,9 @@ qx.Class.define("org.argeo.slc.ria.execution.SpecEditor",
        extend : qx.ui.window.Window,\r
   \r
        properties : {\r
+               /**\r
+                * The Spec to edit\r
+                */\r
                batchEntrySpec : {\r
                        check : "org.argeo.slc.ria.execution.BatchEntrySpec"\r
                }\r
@@ -18,14 +21,15 @@ qx.Class.define("org.argeo.slc.ria.execution.SpecEditor",
                 * Triggered when the user clicks the "save" button. \r
                 */\r
                "save" : "qx.event.type.Event",\r
+               /**\r
+                * Triggered when any data is modified\r
+                */\r
                "modified" : "qx.event.type.Event"\r
 \r
        },\r
        /**\r
-        * \r
-        * @param caption {String} Title of the window\r
-        * @param icon {String} Icon of the window\r
-        * @param text {String} Default content of the window.\r
+        * Opens an editor with the given values. \r
+        * @param batchEntrySpec {org.argeo.slc.ria.execution.BatchEntrySpec} The initial spec to edit\r
         */\r
        construct : function(batchEntrySpec){\r
                var editorLabel = "Edit Specs for "+batchEntrySpec.getLabel();\r
@@ -51,6 +55,9 @@ qx.Class.define("org.argeo.slc.ria.execution.SpecEditor",
        },\r
        \r
        members : {\r
+               /**\r
+                * Builds the form from the BatchEntrySpec\r
+                */\r
                createFormFromSpec : function(){\r
                        var values = this.getBatchEntrySpec().getValues();\r
                        for(var key in values){\r
@@ -66,7 +73,9 @@ qx.Class.define("org.argeo.slc.ria.execution.SpecEditor",
                                }\r
                        }\r
                },\r
-               \r
+               /**\r
+                * Gather data from the form\r
+                */\r
                saveFormToSpec : function(){\r
                        var values = this.getBatchEntrySpec().getValues();\r
                        for(var key in values){\r
@@ -117,6 +126,8 @@ qx.Class.define("org.argeo.slc.ria.execution.SpecEditor",
                 * @param fieldLabel {String} Label of the field\r
                 * @param defaultValue {String} The default value\r
                 * @param choiceValues {Map} An map of values\r
+                * @param disabled {Boolean} The field is not writable\r
+                * @param subType {String} The type expected (string, integer, etc).\r
                 */\r
                _addFormInputText : function(formObject, fieldName, fieldLabel, defaultValue, disabled, subType, choiceValues){\r
                        var labelElement;\r
index 6ce99a06cc65ab19dcb870bdd413eb6f26d61afc..29556d88604e3e284d87c8329bab45c6c1ff5abb 100644 (file)
@@ -13,22 +13,40 @@ qx.Class.define("org.argeo.slc.ria.execution.Value", {
                        check : "String",\r
                        init : ""\r
                },\r
+               /**\r
+                * The type of this value, for the moment "primitive" and "ref" are supported \r
+                */\r
                specType : {\r
                        check : "String",\r
                        init : ""                       \r
                },\r
+               /**\r
+                * Subtype, depending on the "type". \r
+                */\r
                specSubType : {\r
                        check : "String"\r
                },\r
+               /**\r
+                * Whether it is a parameter or not \r
+                */\r
                parameter : {\r
                        check : "Boolean"\r
                },\r
+               /**\r
+                * Whether it is frozen on the server, i.e. disabled in the form \r
+                */\r
                frozen : {\r
                        check : "Boolean"\r
                },\r
+               /**\r
+                * Should not be editable nor seeable, thus hidden \r
+                */\r
                hidden : {\r
                        check : "Boolean"\r
                },\r
+               /**\r
+                * The real value \r
+                */\r
                value : {\r
                        nullable : true\r
                },\r
@@ -77,6 +95,10 @@ qx.Class.define("org.argeo.slc.ria.execution.Value", {
                        }\r
                },\r
                \r
+               /**\r
+                * Apply the value from the node\r
+                * @param xmlNode {Node} Castor representation of this object\r
+                */\r
                _applyXmlValue : function(xmlNode){\r
                        var xpath;\r
                        if(this.getSpecType() == "primitive"){\r
@@ -87,6 +109,10 @@ qx.Class.define("org.argeo.slc.ria.execution.Value", {
                        this.setValue(org.argeo.ria.util.Element.getSingleNodeText(xmlNode, xpath));\r
                },\r
                \r
+               /**\r
+                * Create an XML Representation of this value\r
+                * @return {String} The XML String\r
+                */\r
                toXml : function(){\r
                        var valueTag = '<slc:value>'+this.getValue()+'</slc:value>';\r
                        var specAttribute = '';\r
index 76509f3ef1f9400ff3756f8fc215fbe3aa733319..6841b700d748efedaf6dbecd41651b262eddc85c 100644 (file)
@@ -6,25 +6,45 @@ qx.Class.define("org.argeo.ria.components.DynamicTreeFolder", {
        extend : qx.ui.tree.TreeFolder,\r
        \r
        properties : {\r
+               /**\r
+                * The current state of the folder, usually "empty" => "loading" => "loaded"\r
+                */\r
                "state" : {\r
                        check : "String",\r
                        init  : "empty",\r
                        apply : "_applyState"\r
                },\r
+               /**\r
+                * String to display as a child node during loading\r
+                */\r
                "loadingString" : {\r
                        check : "String",\r
                        init  : "Loading..."\r
                },\r
+               /**\r
+                * Function that will load the children of this folder\r
+                */\r
                "loader" : {\r
                        check : "Function",\r
                        init : function(treeFolder){treeFolder.setLoaded();}\r
                },\r
+               /**\r
+                * Optionnal data describing the "drag" behaviour of the created children.\r
+                * First level is "file" or "folder", and for each of them, supported keys are "type" and "action".  \r
+                */\r
                "dragData": {\r
                        check : "Map",\r
                        init : {}\r
                }\r
        },\r
        \r
+       /**\r
+        * Creates a new instance of DynamicTreeFolder\r
+        * @param label {String} Label of the folder\r
+        * @param loader {Function} Function that will load the children \r
+        * @param loadingString {String} String to display as a child node during loading\r
+        * @param dragData {Map} Optionnal data describing the "drag" behaviour of the created children.\r
+        */\r
        construct : function(label, loader, loadingString, dragData){\r
                this.base(arguments, label);\r
                if(loader) this.setLoader(loader);\r
@@ -39,7 +59,10 @@ qx.Class.define("org.argeo.ria.components.DynamicTreeFolder", {
        },\r
        \r
        members : {\r
-               \r
+               /**\r
+                * Add an item to the folder \r
+                * @param varargs {Mixed} One or many children to add\r
+                */\r
                add : function(varargs){\r
                        this.base(arguments, varargs);\r
                        for (var i=0, l=arguments.length; i<l; i++)\r
@@ -50,6 +73,10 @@ qx.Class.define("org.argeo.ria.components.DynamicTreeFolder", {
                        }\r
                },\r
                \r
+               /**\r
+                * If there is dragData set, init the drag behaviour of a child\r
+                * @param treeItem {qx.ui.tree.AbstractTreeItem} Newly created child\r
+                */\r
                appendDragData : function(treeItem){\r
                        var dragData = this.getDragData();\r
                        var nodeTypeDetected = false;\r
@@ -77,9 +104,16 @@ qx.Class.define("org.argeo.ria.components.DynamicTreeFolder", {
                        \r
                },\r
                \r
+               /**\r
+                * Set the state to "loaded"\r
+                */\r
                setLoaded : function(){\r
                        this.setState("loaded");\r
                },\r
+               /**\r
+                * Called when "state" is set to a new value\r
+                * @param state {String} the new state\r
+                */\r
                _applyState : function(state){\r
                        if(state == "loaded"){\r
                                if(this.loadingChild){\r
@@ -90,14 +124,23 @@ qx.Class.define("org.argeo.ria.components.DynamicTreeFolder", {
                                this.addLoadingChild();\r
                        }\r
                },\r
+               /**\r
+                * Create a temporary child with the loadingString label and add it.\r
+                */\r
                addLoadingChild : function(){\r
                        this.loadingChild = new qx.ui.tree.TreeFile(this.getLoadingString());\r
                        this.add(this.loadingChild);\r
                },\r
+               /**\r
+                * Call loader function.\r
+                */\r
                load : function(){                      \r
                        var loaderFunc = this.getLoader();\r
                        loaderFunc(this);\r
                },\r
+               /**\r
+                * Empty then call loader function.\r
+                */\r
                reload : function(){\r
                        this.removeAll();\r
                        this.setState("loading");\r