diff --git a/js/app/controllers/DynamicModule.js b/js/app/controllers/DynamicModule.js index 45606cd..a3bf57b 100644 --- a/js/app/controllers/DynamicModule.js +++ b/js/app/controllers/DynamicModule.js @@ -23,11 +23,11 @@ Ext.define('amdaDesktop.DynamicModule', { * @required */ source : '', - + module: null, - + launcher: null, - + constructor : function(id, icon, title, source, useLauncher){ this.id = id; this.icon = icon; @@ -42,11 +42,11 @@ Ext.define('amdaDesktop.DynamicModule', { }; this.callParent(arguments); }, - + isReady : function(){ return (this.module != null); }, - + get : function(onReady){ if (!this.isReady()) { @@ -64,7 +64,7 @@ Ext.define('amdaDesktop.DynamicModule', { onReady(this.module); return this.module; }, - + /** * Window Creation method of the Module */ diff --git a/js/app/controllers/EpnTapModule.js b/js/app/controllers/EpnTapModule.js index 79a6b2c..023ef72 100644 --- a/js/app/controllers/EpnTapModule.js +++ b/js/app/controllers/EpnTapModule.js @@ -94,6 +94,45 @@ Ext.define('amdaDesktop.EpnTapModule', { *** Service filter events *** ****************************/ + createWindow: function (target) { + this.callParent(); + this.onWindowLoaded(); + console.log("selected target:", target); + + switch(target) { + case 'icon-mercury': + this.targetClassCB.select('planet'); + break; + case 'icon-venus': + this.targetClassCB.select('planet'); + break; + case 'icon-earth': + this.targetClassCB.select('planet'); + break; + case 'icon-mars': + this.targetClassCB.select('planet'); + break; + case 'icon-jupiter': + this.targetClassCB.select('planet'); + break; + case 'icon-saturn': + this.targetClassCB.select('planet'); + break; + case 'icon-comet': + this.targetClassCB.select('comet'); + break; + case 'icon-sw': + this.targetClassCB.select('sun'); // À vérifier + break; + case 'icon-solarsystem': + this.targetClassCB.select('sun'); // À vérifier + break; + default: + console.log("Unknown target: " + target); + break; + } + }, + /** Trigerred after the render of `gridsPanel` (containing `servicesGrid` and `granulesGrid`). Among other things, initializes the `productType` combobox and the `servicesGrid` table. @@ -488,6 +527,7 @@ Ext.define('amdaDesktop.EpnTapModule', { } } Ext.getCmp('epnTapServicesGrid').setDisabled(false); + Ext.getCmp('epnTapGranulesGrid').setDisabled(false); Ext.getCmp('epnTapServicesGrid').getEl().setStyle('cursor', 'default'); // CSS is correctly changed but without visible result. }, @@ -496,8 +536,9 @@ Ext.define('amdaDesktop.EpnTapModule', { processing. The altered elements are resetted in `fillGranules()`. */ wait: function() { - this.servicesGrid.getEl().setStyle('cursor', 'wait'); - this.servicesGrid.setDisabled(true); // CSS is correctly changed but without visible result. + this.servicesGrid.getEl().setStyle('cursor', 'wait'); // CSS is correctly changed but without visible result. + this.servicesGrid.setDisabled(true); + this.granulesGrid.setDisabled(true); } }); diff --git a/js/app/controllers/ExplorerModule.js b/js/app/controllers/ExplorerModule.js index c4f5afe..4316068 100644 --- a/js/app/controllers/ExplorerModule.js +++ b/js/app/controllers/ExplorerModule.js @@ -1,7 +1,7 @@ -/** +/** * Project : AMDA-NG * Name : ExplorerModule.js - * @class amdaDesktop.ExplorerModule + * @class amdaDesktop.ExplorerModule * @extends amdaDesktop.AmdaModule * @brief Explorer Module controller definition * @author CDA @@ -10,7 +10,7 @@ Ext.define('amdaDesktop.ExplorerModule', { extend: 'amdaDesktop.AmdaModule', - + requires : [ 'amdaUI.ExplorerUI', 'amdaUI.AliasUI', @@ -34,39 +34,39 @@ Ext.define('amdaDesktop.ExplorerModule', { // Object Models 'amdaModel.Parameter', 'amdaModel.Search', - + 'amdaModel.Download', 'amdaModel.TimeTable', - 'amdaModel.Catalog', + 'amdaModel.Catalog', 'amdaModel.Statistics', 'amdaModel.FileObject', 'amdaModel.FileParamObject', 'amdaModel.FilterInfo' ], - + contentId : 'explorerUI', - + filter : null, filtersStore : null, - + paramInfoRegistry : {}, - + constructor : function(config){ this.callParent(arguments); if (!this.filtersStore) { this.filtersStore = Ext.create('Ext.data.Store', { - model: 'amdaModel.FilterList' - }); - this.filtersStore.load(); + model: 'amdaModel.FilterList' + }); + this.filtersStore.load(); // amdaDesktop.ExplorerModule.filtersStore = this.filtersStore; - } + } }, - + createWindow : function() { var desktop = this.app.getDesktop(); - + var win = desktop.getWindow(this.id); - if (!win) { + if (!win) { win = desktop.createWindow( { id : this.id, title : this.title, @@ -95,7 +95,7 @@ Ext.define('amdaDesktop.ExplorerModule', { region: 'center' }, { - xtype: 'panel', + xtype: 'panel', id : 'LogPanel', region: 'south', height : 150, @@ -104,28 +104,28 @@ Ext.define('amdaDesktop.ExplorerModule', { type: 'vbox', align : 'stretch', autoSize : true - }, + }, autoScroll : true, stateful : true, stateId : 'LogPanel', buttons : [{ scope: this, text : 'Clear', - handler: function(){ - win.items.get('LogPanel').removeAll(); + handler: function(){ + win.items.get('LogPanel').removeAll(); this.addLogMessage('<b>Log</b>'); } }] } ] }); - - + + } - + win.on({ activate: { - fn : function() + fn : function() { myDesktopApp.getLoadedModule(this.id, true, function (module) { // on activation when there's a pinedModule 'null' @@ -134,21 +134,21 @@ Ext.define('amdaDesktop.ExplorerModule', { var manager = myDesktopApp.desktop.getDesktopZIndexManager(); // ordering to send back this window manager.sendToBack(win); - } + } }); - + }, scope: this - } + } }); - + win.on({ - show : + show : { fn : function(o) { //set current filter - this.setCrtFilter(); + this.setCrtFilter(); //resize the explorer in relation with the desktop size if (win.y + win.height > myDesktopApp.desktop.el.getHeight()) win.setHeight(myDesktopApp.desktop.el.getHeight() - win.y); @@ -156,21 +156,21 @@ Ext.define('amdaDesktop.ExplorerModule', { scope : this } }); - + win.addCls('window-active'); win.show(); this.addLogMessage('<b>Log</b>'); return win; - + }, - + pinedModule : null, - + /** * Getter of pinedModule * @return {amdaDesktop.InteractiveModule} The pined module */ - getPinedModule : function() + getPinedModule : function() { // get the pined Module return this.pinedModule; @@ -180,17 +180,17 @@ Ext.define('amdaDesktop.ExplorerModule', { * Setter of pinedModule * @param {amdaDesktop.InteractiveModule} The pined module */ - setPinedModule : function(amdaModule) + setPinedModule : function(amdaModule) { // set the pined Module this.pinedModule = amdaModule; }, - + /** * Module Attachment Method * @param {amdaDesktop.InteractiveModule} The module to attach */ - pinMechanism : function(amdaModule) + pinMechanism : function(amdaModule) { // if there is an old pined module if (this.getPinedModule()!=null) { @@ -204,8 +204,8 @@ Ext.define('amdaDesktop.ExplorerModule', { // call color method on pined Module myDesktopApp.getLoadedModule(amdaModule).colorHeaderModule(); }, - - + + addLogMessage : function(message) { var height = 40; @@ -219,7 +219,7 @@ Ext.define('amdaDesktop.ExplorerModule', { var panel = win.items.get('LogPanel'); panel.add(msg); }, - + // setCrtFilter : function() { @@ -228,17 +228,17 @@ Ext.define('amdaDesktop.ExplorerModule', { AmdaAction.getCrtFilterResult(function (result, e) { var t = e.getTransaction(); - if (e.status) - { + if (e.status) + { if (result) { //apply current filter this.filter = result; - + // add saved filter to Explorer List - if (!this.filtersStore.getById(this.filter.id)) + if (!this.filtersStore.getById(this.filter.id)) this.filtersStore.add({id : this.filter.id, name : this.filter.name}); - + //apply filter to the tree var desktop = myDesktopApp.getDesktop(); var win = desktop.getWindow(this.id); @@ -250,7 +250,7 @@ Ext.define('amdaDesktop.ExplorerModule', { } else Ext.Msg.show( { - title : 'Filter', + title : 'Filter', msg : 'Cannot apply filter', modal : true, icon : Ext.Msg.ERROR, @@ -261,22 +261,22 @@ Ext.define('amdaDesktop.ExplorerModule', { { // FAILURE Ext.Msg.show({title:'Error System', msg: e.message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK}); - } + } },this); }, - + resetFilter : function() { - AmdaAction.resetFilter( + AmdaAction.resetFilter( function (result, e) { var t = e.getTransaction(); - if (e.status) - { + if (e.status) + { if (result) { this.setCrtFilter(); - + //update filter win var desktop = myDesktopApp.getDesktop(); var win = desktop.getWindow(myDesktopApp.dynamicModules.filters.id); @@ -288,7 +288,7 @@ Ext.define('amdaDesktop.ExplorerModule', { } else Ext.Msg.show( { - title : 'Filter', + title : 'Filter', msg : 'Cannot reset filter', modal : true, icon : Ext.Msg.ERROR, @@ -299,17 +299,17 @@ Ext.define('amdaDesktop.ExplorerModule', { { // FAILURE Ext.Msg.show({title:'Error System', msg: e.message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK}); - } + } },this); }, - + getParamInfo : function(paramId, onReady) { if (this.paramInfoRegistry[paramId]) { if (onReady) onReady(this.paramInfoRegistry[paramId]); return this.paramInfoRegistry[paramId]; } - + var me = this; AmdaAction.getParamInfo({"paramId" : paramId}, function (result, e) { var paramInfo = null; @@ -336,7 +336,7 @@ Ext.define('amdaDesktop.ExplorerModule', { } if (onReady) - onReady(paramInfo); + onReady(paramInfo); }); return null; } diff --git a/js/app/models/AmdaNode.js b/js/app/models/AmdaNode.js index e7b350c..f97972a 100644 --- a/js/app/models/AmdaNode.js +++ b/js/app/models/AmdaNode.js @@ -1,4 +1,4 @@ -/** +/** * Project : AMDA-NG4 * Name : AmdaNode.js * @class amdaModel.AmdaNode @@ -14,12 +14,12 @@ */ Ext.define('amdaModel.AmdaNode', { extend: 'Ext.data.TreeModel', - + requires: ['amdaReader.ExplorerReader'], - + fields: [ {name: 'leaf', type: 'boolean'}, - {name: 'nodeType',type:'string'}, + {name: 'nodeType',type:'string'}, {name: 'id', type: 'string'}, {name:'text',type: 'string'}, {name:'info',type: 'string'}, @@ -29,19 +29,19 @@ Ext.define('amdaModel.AmdaNode', { {name: 'ownerTree', persist: false}, {name: 'checked', defaultValue: null, persist: false} ], - + statics : { NEW_DIR_NAME : 'new Folder', MULTI_PREFIX : 'mult' }, - + /** * @cfg proxy used to load nodes */ proxy: { type: 'direct', // directFn: AmdaAction.getTree, - api : + api : { read: AmdaAction.getTree, update: AmdaAction.saveTree, @@ -53,20 +53,20 @@ Ext.define('amdaModel.AmdaNode', { type: 'explorer' } }, - + /** * Abstract getter of complete array of item context menu * @return {Ext.Array} the complete array of item context menu */ getAllContextMenuItems: Ext.emptyFn, - + /** * Abstract method call on click on item of context menu */ onMenuItemClick: Ext.emptyFn, - + /** - * Abstract Update Data method + * Abstract Update Data method */ update : Ext.emptyFn, @@ -74,17 +74,17 @@ Ext.define('amdaModel.AmdaNode', { * Abstract Rename Data method */ rename : Ext.emptyFn, - + /** * Abstract Rename D&D Data method */ renameDD : Ext.emptyFn, - + /** * Abstract Create Data method */ create : Ext.emptyFn, - + /** * filtering method of context menu * @param {String} itemKind the kind of right clicked node @@ -108,7 +108,7 @@ Ext.define('amdaModel.AmdaNode', { return null; } }, - + getMultiContextMenu : function(){ var menuitems = this.getMultiContextMenuItems(); if (menuitems && menuitems.length){ @@ -117,7 +117,7 @@ Ext.define('amdaModel.AmdaNode', { return null; } }, - + /** * get the kind of this node * @returns itemKind string @@ -141,7 +141,7 @@ Ext.define('amdaModel.AmdaNode', { } return itemKind; }, - + /** * Getter on context menu of this node * @returns {Ext.menu.Menu} the contextMenu of this node @@ -154,11 +154,11 @@ Ext.define('amdaModel.AmdaNode', { // return the context menu for this node return menuItems; }, - + getContextMenuMultiItems : function() { return this.getMultiContextMenu(); }, - + /** * Method to retrieve the root node corresponding to the nodeType of this node * @return {amdaModel.AmdaNode} the root node of category of this node @@ -169,8 +169,8 @@ Ext.define('amdaModel.AmdaNode', { if(this.getNodeKind() == amdaUI.ExplorerUI.ITEM_KIND_ROOT) { this.set('rootNode',this); } else { - // get resources tree panel - var tree = this.myGetOwnerTree(); + // get resources tree panel + var tree = this.myGetOwnerTree(); var treeRoot = tree.getRootNode(); var rootNodeId = this.get('nodeType')+amdaUI.ExplorerUI.ROOT_SUFFIX; @@ -179,7 +179,7 @@ Ext.define('amdaModel.AmdaNode', { } return this.get('rootNode'); }, - + /** * getter on ownerTree (use ownerTreeId property) * @return {Ext.tree.Panel} the tree which contains this node @@ -192,4 +192,3 @@ Ext.define('amdaModel.AmdaNode', { } }); - diff --git a/js/app/models/LocalParamNode.js b/js/app/models/LocalParamNode.js index 74c9d03..7321138 100644 --- a/js/app/models/LocalParamNode.js +++ b/js/app/models/LocalParamNode.js @@ -1,52 +1,52 @@ -/** +/** * Project : AMDA-NG4 * Name : LocalParamNode.js * @class amdaModel.LocalParamNode * @extends amdaModel.InteractiveNode * @brief Basic Model of Node corresponding to a amda parameter - * @author - * @version $Id: LocalParamNode.js 2800 2015-02-27 16:23:06Z elena $ + * @author + * @version $Id: LocalParamNode.js 2800 2015-02-27 16:23:06Z elena $ */ -Ext.define('amdaModel.LocalParamNode', +Ext.define('amdaModel.LocalParamNode', { extend: 'amdaModel.InteractiveNode', - + statics: { nodeType: 'localParam' }, - - fields: + + fields: [ {name: 'alias', type:'string', persist: false}, - {name: 'isParameter', type: 'boolean', persist: false}, + {name: 'isParameter', type: 'boolean', persist: false}, {name: 'notyet', type: 'boolean', defaultValue: false, persist: false}, {name: 'needsArgs', type: 'boolean', persist: false}, {name: 'isSpectra', type: 'boolean', defaultValue: false, persist: false}, {name: 'isStack', type: 'boolean', defaultValue: true, persist: false}, {name: 'globalStart', type: 'string', persist: false}, {name: 'globalStop', type: 'string', persist: false}, - {name: 'timeRestriction', type: 'boolean', persist: false}, + {name: 'timeRestriction', type: 'boolean', persist: false}, {name: 'rank', type: 'integer', persist: false, defaultValue: null} - ], - + ], + constructor : function(config) - { + { this.callParent(arguments); this.set('allowDrop', true); this.set('moduleId',myDesktopApp.dynamicModules.param.id); this.set('objectDataModel',amdaModel.Parameter.$className); - + // if future missions or 'depending on mission' - if (this.get('globalStart')) { - var now = Ext.Date.format(new Date(), 'Y/m/d'); + if (this.get('globalStart')) { + var now = Ext.Date.format(new Date(), 'Y/m/d'); if ( this.get('globalStart') > now ) this.set('cls','predicted'); } // time restriction on parameters - if (this.get('timeRestriction')) { + if (this.get('timeRestriction')) { // this.set('cls','predicted'); var id = this.get('id'); var bracketPos = id.indexOf("("); @@ -54,36 +54,36 @@ Ext.define('amdaModel.LocalParamNode', id = Ext.String.insert(id, '_restr', bracketPos); } else { - id += '_restr'; + id += '_restr'; } this.set('id', id); } - - if (this.get('rank')) { + + if (this.get('rank')) { var rank = this.get('rank'); if (rank == 1) this.set('iconCls', 'icon-mercury'); if (rank == 2) this.set('iconCls', 'icon-venus'); - if (rank == 5) this.set('iconCls', 'icon-earth'); + if (rank == 5) this.set('iconCls', 'icon-earth'); if (rank == 6) this.set('iconCls', 'icon-earth'); if (rank == 7) this.set('iconCls', 'icon-mars'); - if (rank == 8) this.set('iconCls', 'icon-jupiter'); + if (rank == 8) this.set('iconCls', 'icon-jupiter'); if (rank == 9) this.set('iconCls', 'icon-saturn'); - if (rank == 93) this.set('iconCls', 'icon-comet'); + if (rank == 93) this.set('iconCls', 'icon-comet'); if (rank == 3) this.set('iconCls', 'icon-sw'); if (rank == 4) this.set('iconCls', 'icon-sw'); if (rank >= 99) this.set('iconCls', 'icon-solarsystem'); } - - if (this.get('isParameter')) - { - if (this.get('leaf')) this.set('iconCls', 'icon-scalar'); - else this.set('iconCls', 'icon-vector'); - + + if (this.get('isParameter')) + { + if (this.get('leaf')) this.set('iconCls', 'icon-scalar'); + else this.set('iconCls', 'icon-vector'); + if (this.get('isStack') || this.get('isSpectra')) this.set('iconCls', 'icon-spectra'); } }, - - allMenuItems : function() + + allMenuItems : function() { var menuItems = [{ @@ -105,8 +105,8 @@ Ext.define('amdaModel.LocalParamNode', },{ fnId : 'leaf-createAlias', text : 'Create/Edit Alias', - hidden : true - },{ + hidden : true + },{ fnId : 'leaf-createDerivedParam', text : 'Create Derived Parameter', hidden : true @@ -118,67 +118,77 @@ Ext.define('amdaModel.LocalParamNode', fnId : 'leaf-downParam', text : 'Download Parameter', hidden : true + }, { + fnId : 'dire-epnTap', + text : 'Display EPN-TAP services', + hidden : false }]; return menuItems; }, - - onMenuItemClick : function(menu,item,event) + + onMenuItemClick : function(menu, item, evt) { - switch (item.fnId) + switch (item.fnId) { case 'root-collapseAll': case 'dire-collapseAll': if(this && !this.isLeaf()) { this.collapse(true); } - break; + break; case 'leaf-plotParam': - case 'para-plotParam': - this.createPlot(this); + case 'para-plotParam': + this.createPlot(this); break; case 'leaf-downParam': - case 'para-downParam': - this.createDownload(this); + case 'para-downParam': + this.createDownload(this); break; case 'leaf-createDerivedParam': if (!this.get('notyet')) - this.createLeaf(this); - else - myDesktopApp.warningMsg("Sorry! access to this parameter is restricted"); + this.createLeaf(this); + else + myDesktopApp.warningMsg("Sorry! access to this parameter is restricted"); break; - case 'leaf-createAlias': + case 'leaf-createAlias': if (!this.get('notyet')) - this.createAlias(this); + this.createAlias(this); else myDesktopApp.warningMsg("Sorry! access to this parameter is restricted"); - break; + case 'dire-epnTap': + this.displayEpnTap(); default: break; - } }, - - - createLeaf: function(node) - { - + + displayEpnTap: function() { + var target = this.get('iconCls'); + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.epntap.id, true, function (module) { + module.createWindow(target); + }); + }, + + createLeaf: function(node) + { + // instanciate a Parameter object with the current data in his buidchain var param = Ext.create(this.get('objectDataModel'));//, { buildchain: node.get('alias') ? "#"+node.get('alias') : node.get('id') }); // instanciate a DerivedParamNode with this param object - var newNode = Ext.create(amdaModel.DerivedParamNode.$className, {leaf : true, object : param}); - + var newNode = Ext.create(amdaModel.DerivedParamNode.$className, {leaf : true, object : param}); + // edit newNode into Parameter Module with node as contextNode newNode.editInModule(); - + var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.param.id, true, function(module) { var paramName; var components = null; if (node.get('alias')!= "" ) paramName = "#"+node.get('alias'); - else + else paramName = node.get('id'); var component_info = node.get('component_info'); if (component_info && component_info.parentId) { @@ -190,15 +200,15 @@ Ext.define('amdaModel.LocalParamNode', if (component_info.index2) components['index2'] = component_info.index2; } - - module.addParam(paramName,true,node.get('needsArgs'),components); + + module.addParam(paramName,true,node.get('needsArgs'),components); }); - + }, - createAlias: function(node) + createAlias: function(node) { - var win = myDesktopApp.desktop.getWindow('alias-win'); + var win = myDesktopApp.desktop.getWindow('alias-win'); if (!node.get('needsArgs') && node.get('leaf')) { if(!win) @@ -212,41 +222,41 @@ Ext.define('amdaModel.LocalParamNode', height : 200, layout : 'border', maximizable : false, - items : + items : [{ xtype : 'alias', region : 'center', - margins : + margins : { top: 0, right: 5, bottom: 5, left: 5 - }, + }, paramNode : node, id : 'aliasUI' }] - }); + }); } - else + else { //Set data into Alias Widget win.items.items[0].paramNode = node; - win.items.items[0].setAlias(node); - } - win.show(); + win.items.items[0].setAlias(node); + } + win.show(); } - else + else { var message = 'Sorry, parameter ' + node.get('id') + ' cannot have alias'; - Ext.Msg.alert('Impossible Create Alias', message); + Ext.Msg.alert('Impossible Create Alias', message); if (win) win.close(); } }, - + isParameter : function() { return this.get('isParameter'); } - + }); diff --git a/js/app/models/RemoteParamNode.js b/js/app/models/RemoteParamNode.js index 6e38f05..e9adb25 100644 --- a/js/app/models/RemoteParamNode.js +++ b/js/app/models/RemoteParamNode.js @@ -1,39 +1,39 @@ -/** +/** * Project : AMDA-NG4 * Name : RemoteParamNode.js * @class amdaModel.RemoteParamNode * @extends amdaModel.LocalParamNode - * @brief - * @author + * @brief + * @author * @version $Id: RemoteParamNode.js 2544 2014-10-03 10:21:56Z elena $ */ Ext.define('amdaModel.RemoteParamNode', { extend: 'amdaModel.LocalParamNode', - + statics:{ nodeType: 'remoteParam' }, - + fields: [ {name: 'isRemoteDataSet', type:'boolean', persist: false, defaultValue: false}, - {name: 'isSimulation', type:'boolean', defaultValue: false} + {name: 'isSimulation', type:'boolean', defaultValue: false} ], - - constructor : function(config){ - this.callParent(arguments); - //TODO only for INTEROPER TREE + + constructor : function(config){ + this.callParent(arguments); + //TODO only for INTEROPER TREE if (!this.get('leaf')) this.set('allowDrag', false); if (this.get('isParameter')) this.set('allowDrag',true); - if (this.get('leaf') && this.get('isSpectra')) this.set('iconCls', 'icon-spectra'); + if (this.get('leaf') && this.get('isSpectra')) this.set('iconCls', 'icon-spectra'); if (this.get('disable')) { this.set('cls', 'icon-disabled'); this.set('allowDrag', false); } }, - - + + allMenuItems : function() { var menuItems = [{ @@ -62,7 +62,7 @@ Ext.define('amdaModel.RemoteParamNode', { },{ fnId : 'leaf-createAlias', text : 'Create/Edit Alias' - }, { + }, { fnId : 'leaf-createDerivedParam', text : 'Create Derived Parameter' },{ @@ -80,7 +80,7 @@ Ext.define('amdaModel.RemoteParamNode', { return menuItems; } , - + onMenuItemClick : function(menu,item,event) { if (item) { @@ -93,62 +93,62 @@ Ext.define('amdaModel.RemoteParamNode', { } break; case 'leaf-createDerivedParam': - this.createLeaf(this); + this.createLeaf(this); break; - case 'leaf-createAlias': - this.createAlias(this); + case 'leaf-createAlias': + this.createAlias(this); break; case 'leaf-deleteNode': case 'dire-deleteNode' : this.deleteData(); break; case 'dire-addData': - case 'root-addData': - this.addData(); + case 'root-addData': + this.addData(); break; case 'leaf-plotParam': - case 'para-plotParam': - this.createPlot(this); + case 'para-plotParam': + this.createPlot(this); break; case 'leaf-downParam': - case 'para-downParam': - this.createDownload(this); - break; - default: + case 'para-downParam': + this.createDownload(this); + break; + default: break; } } }, - + deleteData : function() { // var parent = this.parentNode; - AmdaAction.deleteFromTree({nodeType: this.get('nodeType'), id : this.get('id')}, function(res,e){ - //TODO if () not error ?? + AmdaAction.deleteFromTree({nodeType: this.get('nodeType'), id : this.get('id')}, function(res,e){ + //TODO if () not error ?? this.remove(); - this.destroy(); - },this); + this.destroy(); + },this); }, - + addData : function() { - + if (this.get('disable')) return; - + var me = this; myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.interop.id, true, function (module) { - module.createWindow(me.getBaseId()); + module.createWindow(me.getBaseId()); }); - }, - -// Depth of Base Root Node = 3 : root, Parameters, Remote Parameters, BaseName + }, + +// Depth of Base Root Node = 3 : root, Parameters, Remote Parameters, BaseName getBaseId : function() { - + if (this.getDepth() < 3) return 'root'; - + var node = this; while (node.getDepth() > 3) { node = node.parentNode; } return node.get('id'); } - + }); diff --git a/js/app/views/EpnTapUI.js b/js/app/views/EpnTapUI.js index feb6db5..e2d324c 100644 --- a/js/app/views/EpnTapUI.js +++ b/js/app/views/EpnTapUI.js @@ -108,7 +108,7 @@ selected. */ Ext.create('Ext.data.Store', { storeId:'granulesStore', - fields:['num', 'dataproduct_type', 'target_name', 'time_min', 'time_max', 'access_format', 'granule_uid', 'access_estsize', 'access_url', 'thumbnail_url'] + fields:['num', 'dataproduct_type', 'target_name', 'time_min', 'time_max', 'access_format', 'granule_uid', 'access_estsize', 'access_url', 'thumbnail_url'], }); /** @@ -122,6 +122,9 @@ Ext.define('amdaUI.EpnTapUI', { alias: 'widget.panelEpnTap', requires: ['amdaUI.IntervalUI'], + width: 800, + height: 600, + /** Method constructor, which basically call the `init()` method to create the EpnTap panel. */ @@ -139,7 +142,7 @@ Ext.define('amdaUI.EpnTapUI', { them private (ie. to avoid `EpnTapUI.createServicesGrid();`, which doesn't make sense). */ init: function(config) { - var mod = config.module; + var mod = Ext.create('amdaDesktop.EpnTapModule'); /************ *** Grids *** @@ -167,6 +170,10 @@ Ext.define('amdaUI.EpnTapUI', { title: 'Services', store: Ext.data.StoreManager.lookup('servicesStore'), flex: 1, + // layout: 'fit', + // scroll: 'vertical', + // autoScroll: 'auto', + // height: 800, columns: [ {text: 'Name', dataIndex: 'id', flex: 3}, {text: 'Results', dataIndex: 'nbResults', flex: 2} @@ -256,6 +263,10 @@ Ext.define('amdaUI.EpnTapUI', { title: 'Granules', store: Ext.data.StoreManager.lookup('granulesStore'), flex: 5, + // layout: 'fit', + // scroll: 'vertical', + // autoScroll: 'auto', + // height: 800, columns: [ { text: 'Num', dataIndex: 'num', flex: 1, renderer: txtRender }, { text: 'Type', dataIndex: 'dataproduct_type', flex: 2, renderer: dptRender }, @@ -300,7 +311,7 @@ Ext.define('amdaUI.EpnTapUI', { var self = this; return new Ext.panel.Panel({ id: 'epnTapGridsPanel', - region: 'center', + // region: 'center', // height: 350, layout: { type: 'hbox', pack: 'start', align: 'stretch' }, items: [ @@ -573,8 +584,8 @@ Ext.define('amdaUI.EpnTapUI', { var myConf = { items: [ createServiceFilterPanel(), - createGridsPanel(), - createInfoPanel() + createGridsPanel() + // createInfoPanel() ] }; Ext.apply(this, Ext.apply(arguments, myConf)); diff --git a/js/app/views/ExplorerUI.js b/js/app/views/ExplorerUI.js index 29a1f1f..36fbbd8 100644 --- a/js/app/views/ExplorerUI.js +++ b/js/app/views/ExplorerUI.js @@ -2,40 +2,40 @@ Ext.Ms/** * Project : AMDA-NG4 * Name : ExplorerUI.js * Description : Explorer Module UI definition (View) - * @class amdaUI.ExplorerUI - * @extends Ext.tab.Panel + * @class amdaUI.ExplorerUI + * @extends Ext.tab.Panel * @brief Explorer View * @author CDA - * @version $Id: ExplorerUI.js 2544 2014-10-03 10:21:56Z elena $ + * @version $Id: ExplorerUI.js 2544 2014-10-03 10:21:56Z elena $ */ Ext.define('amdaUI.TreeToolColumn', { extend: 'Ext.tree.Column', alias: 'widget.treetoolcolumn', - + /** * Add more tools here. These will be on the prototype for all TreeToolColumns */ tools: { 'info': 'js/resources/images/16x16/info_mini.png' }, - - initComponent: function() + + initComponent: function() { var me = this; me.addEvents( 'toolclick' ); me.callParent(); me.on('toolclick', me.toolHandler, me); }, - + renderer: function(value, metaData, record, rowIdx, colIdx, store, view) { var toolCol = view.getHeaderAtIndex(colIdx); - + if (!toolCol.toolIsVisible(record)) return value; - + var toolId = 'tool-' + rowIdx + '-' + colIdx, toolImg = toolCol.tools[toolCol.tool], imgHtml = Ext.DomHelper.markup({ @@ -45,13 +45,13 @@ Ext.define('amdaUI.TreeToolColumn', { src : toolImg, style : 'cursor:hand;' }); - + return value + ' ' + imgHtml; }, - - processEvent: function(type, view, cell, recordIndex, cellIndex, e) + + processEvent: function(type, view, cell, recordIndex, cellIndex, e) { - if(type === "click" && e.target.tagName === "IMG") + if(type === "click" && e.target.tagName === "IMG") { var tooltype = e.target.getAttribute("tooltype"); if(tooltype) @@ -59,14 +59,14 @@ Ext.define('amdaUI.TreeToolColumn', { } return this.fireEvent.apply(this, arguments); }, - + /** * Override this when you add columns to the tree... see example below */ // toolHandler: function() { // alert("override this"); // }, - + toolIsVisible : function(record) { return false; } @@ -78,8 +78,8 @@ Ext.define('amdaUI.ExplorerUI', { extend: 'Ext.tab.Panel', alias : 'widget.panelExplorer', - statics: - { + statics: + { RESRC_TAB : { TREE_ID:'resourcesTree', TREE_TYPE:'resources' @@ -92,7 +92,7 @@ Ext.define('amdaUI.ExplorerUI', { TREE_ID:'jobsTree', TREE_TYPE:'jobs' }, - + CAT_SUFFIX: '-treeBase', ROOT_SUFFIX: '-treeRootNode', SUB_ROOT_SUFFIX : 'RootNode', @@ -104,9 +104,9 @@ Ext.define('amdaUI.ExplorerUI', { }, initComponent : function (config) { - + var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id); - + var myConf = { split : true, width : '100%', @@ -117,7 +117,7 @@ Ext.define('amdaUI.ExplorerUI', { defaults : { // applied to each contained panel containerScroll : true - }, + }, stateful: true, // stateId: 'tp1', stateEvents: ['tabchange'], @@ -131,13 +131,13 @@ Ext.define('amdaUI.ExplorerUI', { }, // activeTab: 0, items: [ - this.initTree(amdaUI.ExplorerUI.RESRC_TAB.TREE_TYPE), + this.initTree(amdaUI.ExplorerUI.RESRC_TAB.TREE_TYPE), this.initTree(amdaUI.ExplorerUI.OPE_TAB.TREE_TYPE), - this.initTree(amdaUI.ExplorerUI.JOB_TAB.TREE_TYPE) + this.initTree(amdaUI.ExplorerUI.JOB_TAB.TREE_TYPE) ], - tbar : [ - { - xtype : 'combo', + tbar : [ + { + xtype : 'combo', fieldLabel: 'Filter', labelWidth: 25, width: 140, @@ -147,13 +147,13 @@ Ext.define('amdaUI.ExplorerUI', { valueField: 'id', listeners : { scope : this, - select: function(combo, records) { - AmdaAction.setCrtFilterId({id : records[0].get('id')}, + select: function(combo, records) { + AmdaAction.setCrtFilterId({id : records[0].get('id')}, function (result, e) { var t = e.getTransaction(); - if (e.status) - { + if (e.status) + { if (result) { var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id); @@ -162,7 +162,7 @@ Ext.define('amdaUI.ExplorerUI', { } else Ext.Msg.show( { - title : 'Filter', + title : 'Filter', msg : 'Cannot apply filter', modal : true, icon : Ext.Msg.ERROR, @@ -173,10 +173,10 @@ Ext.define('amdaUI.ExplorerUI', { { // FAILURE Ext.Msg.show({title:'Error System', msg: e.message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK}); - } - },this); - } - } + } + },this); + } + } }, { text: '', @@ -187,7 +187,7 @@ Ext.define('amdaUI.ExplorerUI', { module.createWindow(); }); } - }, + }, { text: '', iconCls : 'icon-remover', @@ -200,39 +200,39 @@ Ext.define('amdaUI.ExplorerUI', { { xtype: 'displayfield', fieldLabel: 'SortBy', - width: 40 + width: 40 }, { - text: 'Name', - scope : this, + text: 'Name', + scope : this, tooltip: { text: 'Sort out Local Data by Mission name', align: 'bl-tl' }, pressed: true, - enableToggle : true, + enableToggle : true, toggleGroup: 'sorting', handler: function(){ var tree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); tree.getStore().sort([ - { sorterFn: function(o1, o2){ + { sorterFn: function(o1, o2){ if (o1.get('nodeType') !== 'localParam') - return; - + return; + return o1.get('text').toUpperCase() < o2.get('text').toUpperCase() ? -1 : 1; - } } ]); - this.updateFilter(); + } } ]); + this.updateFilter(); } }, { - text: 'Target', - scope : this, - tooltip: { text: 'Sort Out Local Data by Mission main target', align: 'bl-tl' }, - enableToggle : true, + text: 'Target', + scope : this, + tooltip: { text: 'Sort Out Local Data by Mission main target', align: 'bl-tl' }, + enableToggle : true, toggleGroup: 'sorting', - handler: function(){ + handler: function(){ var tree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); - tree.getStore().sort([{ property : 'rank' }]); + tree.getStore().sort([{ property : 'rank' }]); this.updateFilter(); - } - } + } + } ] }; Ext.apply (this , Ext.apply (arguments, myConf)); @@ -240,39 +240,39 @@ Ext.define('amdaUI.ExplorerUI', { }, initTree : function(treeType){ - - switch (treeType) { - case amdaUI.ExplorerUI.RESRC_TAB.TREE_TYPE: + + switch (treeType) { + case amdaUI.ExplorerUI.RESRC_TAB.TREE_TYPE: treeId = amdaUI.ExplorerUI.RESRC_TAB.TREE_ID; break; - case amdaUI.ExplorerUI.OPE_TAB.TREE_TYPE: + case amdaUI.ExplorerUI.OPE_TAB.TREE_TYPE: treeId = amdaUI.ExplorerUI.OPE_TAB.TREE_ID; break; - case amdaUI.ExplorerUI.JOB_TAB.TREE_TYPE: + case amdaUI.ExplorerUI.JOB_TAB.TREE_TYPE: treeId = amdaUI.ExplorerUI.JOB_TAB.TREE_ID; break; - default: + default: treeId = amdaUI.ExplorerUI.RESRC_TAB.TREE_ID; break; - } + } var store = Ext.create('Ext.data.TreeStore', { root: { expanded: true, - nodeType : treeType + nodeType : treeType }, model: 'amdaModel.AmdaNode', - sorters:[{ property:'leaf', direction: 'DES' }, - { sorterFn: function(o1, o2){ + sorters:[{ property:'leaf', direction: 'DES' }, + { sorterFn: function(o1, o2){ if (o1.get('nodeType') !== 'localParam') - return; - + return; + return o1.get('text').toUpperCase() < o2.get('text').toUpperCase() ? -1 : 1; } }], listeners: { beforeload: function(store, operation){ store.proxy.extraParams = { - nodeType: operation.node.get('nodeType') + nodeType: operation.node.get('nodeType') }; } } @@ -281,7 +281,7 @@ Ext.define('amdaUI.ExplorerUI', { var menu = new Ext.menu.Menu(); - var tree = Ext.create('Ext.tree.Panel', { + var tree = Ext.create('Ext.tree.Panel', { id : treeId, title: treeType, store: store, @@ -294,35 +294,35 @@ Ext.define('amdaUI.ExplorerUI', { ignoreRightMouseSelection: true, mode: 'MULTI' }), - - viewConfig: + + viewConfig: { - plugins: - { + plugins: + { ptype: 'treeviewdragdrop', enableDrag:true, enableDrop:true, //TODO - BRE - Wait a fix for drag&drop issue ddGroup:'explorerTree', pluginId : 'ddplugin', - isValidDropPoint : function (node, position, dragZone, e, data) - { + isValidDropPoint : function (node, position, dragZone, e, data) + { if (!node || !data.item) { return false; } - + var view = this.view, targetNode = view.getRecord(node), draggedRecords = data.records, dataLength = draggedRecords.length, ln = draggedRecords.length, i, record; - + // No drop position, or dragged records: invalid drop point if (!(targetNode && position && dataLength)) { return false; } - + // If the targetNode is within the folder we are dragging for (i = 0; i < ln; i++) { record = draggedRecords[i]; @@ -330,7 +330,7 @@ Ext.define('amdaUI.ExplorerUI', { return false; } } - + // Respect the allowDrop field on Tree nodes if (position === 'append' && targetNode.get('allowDrop') === false) { return false; @@ -338,62 +338,62 @@ Ext.define('amdaUI.ExplorerUI', { else if (position != 'append' && targetNode.parentNode.get('allowDrop') === false) { return false; } - + // If the target record is in the dragged dataset, then invalid drop if (Ext.Array.contains(draggedRecords, targetNode)) { return false; } - - // + + // if (dataLength > 1) return false; var draggedRecord = draggedRecords[0]; - // + // switch (targetNode.data.nodeType) { case 'localParam' : case 'remoteParam' : - case 'remoteSimuParam' : - case 'myData' : + case 'remoteSimuParam' : + case 'myData' : return false; default : if (draggedRecord.data.id == targetNode.data.nodeType+'-treeRootNode') return false; if ((position == 'before') && (targetNode.data.id == targetNode.data.nodeType+'-treeRootNode')) return false; - return (draggedRecord.data.nodeType == targetNode.data.nodeType); + return (draggedRecord.data.nodeType == targetNode.data.nodeType); } return false; }, - onViewRender : function(view) - { + onViewRender : function(view) + { var me = this; - + view.on('itemupdate', function(record,index,node,opts) - { + { var forceHide = false; var crtRec = record.parentNode; while (crtRec && !forceHide) { if (crtRec.get('filtered')) forceHide = crtRec.get('filtered'); - crtRec = crtRec.parentNode; + crtRec = crtRec.parentNode; } tree.setNodesVisibility(record,forceHide); tree.applyDisableToNode(record); }); - + view.on('itemadd', function(records,index,node,opts) { Ext.each(records,function (rec) { - tree.applyFilterToNode(rec); + tree.applyFilterToNode(rec); tree.applyDisableToNode(rec); - }); - + }); + }); - + view.on('afteritemexpand', function(record,index,node,opts) { var forceHide = false; @@ -403,13 +403,13 @@ Ext.define('amdaUI.ExplorerUI', { if (crtRec.get('filtered')) forceHide = crtRec.get('filtered'); crtRec = crtRec.parentNode; - + } tree.setNodesVisibility(record,forceHide); tree.applyDisableToNode(record); }); - if (me.enableDrag) + if (me.enableDrag) { me.dragZone = Ext.create('Ext.tree.ViewDragZone', { view: view, @@ -420,7 +420,7 @@ Ext.define('amdaUI.ExplorerUI', { }); } - if (me.enableDrop) + if (me.enableDrop) { me.dropZone = Ext.create('Ext.tree.ViewDropZone', { view: view, @@ -433,10 +433,10 @@ Ext.define('amdaUI.ExplorerUI', { dropHighlight: me.nodeHighlightOnDrop, isValidDropPoint : me.isValidDropPoint }); - } - } + } + } }, - listeners : + listeners : { beforedrop : function(node, data, overModel, dropPosition) { @@ -448,10 +448,10 @@ Ext.define('amdaUI.ExplorerUI', { parentId = overModel.parentNode.get('id'); else parentId = overModel.get('id'); - - if(!overModel.isExpanded() && overModel.isExpandable()) { - myDesktopApp.warningMsg('Please open the folder before node adding'); - return false; + + if(!overModel.isExpanded() && overModel.isExpandable()) { + myDesktopApp.warningMsg('Please open the folder before node adding'); + return false; } break; case 'before' : @@ -459,7 +459,7 @@ Ext.define('amdaUI.ExplorerUI', { parentId = overModel.parentNode.get('id'); break; } - + Ext.each(data.records, function(rec) { rec.renameDD(parentId,function(result) @@ -474,7 +474,7 @@ Ext.define('amdaUI.ExplorerUI', { buttons : Ext.Msg.OK, icon : Ext.MessageBox.WARNING }); - + return false; } } @@ -486,55 +486,55 @@ Ext.define('amdaUI.ExplorerUI', { buttons : Ext.Msg.OK, icon : Ext.MessageBox.WARNING }); - + return false; } - + return true; }); - }); + }); } }, }, listeners: { - - itemmouseenter: function(view, record, item){ - if(record.get('isParameter')){ + + itemmouseenter: function(view, record, item){ + if(record.get('isParameter')){ var el = Ext.get(item), td = el.down('td > div'); - td.setStyle('cursor', 'crosshair'); + td.setStyle('cursor', 'crosshair'); } else { var el = Ext.get(item), td = el.down('td > div'); - td.setStyle('cursor', 'pointer'); + td.setStyle('cursor', 'pointer'); } }, itemcontextmenu: function(view, rec, item, index, e){ // block other events e.stopEvent(); - + // unlock selection view.ownerCt.getSelectionModel().setLocked(false); - + view.ownerCt.getSelectionModel().select(rec,true); - + // clear menu items menu.removeAll(); var menuItems; - + // if it's a single selection if (view.ownerCt.getSelectionModel().selected.length === 1) { // get items menu corresponding to right clicked record menuItems = rec.getContextMenuItems(this); - + } else if (view.ownerCt.getSelectionModel().selected.length > 1) { // get items menu corresponding to right clicked record menuItems = rec.getContextMenuMultiItems(this); - + } - + // if there's at least one item menu if (menuItems && menuItems.length){ // add the items @@ -548,43 +548,43 @@ Ext.define('amdaUI.ExplorerUI', { menu.removeListener('click',onRecordClick,this); }; menu.addListener('click',onRecordClick,rec); - + // then show menu menu.showAt(e.getXY()); - } + } }, - + itemdblclick: function(view, record, item, index, event){ event.stopEvent(); - - // first check if it is for SAVE-START-STOP plugin... - if (Ext.PluginManager.getCount() > 0 && - record.get('nodeType') == amdaModel.TimeTableNode.nodeType && record.isLeaf()) { + + // first check if it is for SAVE-START-STOP plugin... + if (Ext.PluginManager.getCount() > 0 && + record.get('nodeType') == amdaModel.TimeTableNode.nodeType && record.isLeaf()) { var zmgr = myDesktopApp.desktop.getDesktopZIndexManager(); var winActive = zmgr.getActive(); var winId = winActive.getId(); if (winId == 'explorer-win') { zmgr.eachTopDown(function(win) { var id = win.getId(); - if (id !== 'explorer-win') { + if (id !== 'explorer-win') { winId = id; return false; - } - }); - } - } - + } + }); + } + } + // var targetModuleName = myDesktopApp.getModule('explorer-win').getPinedModule(); - if (record.get('nodeType') == 'remoteParam' && !record.isLeaf() + if (record.get('nodeType') == 'remoteParam' && !record.isLeaf() && !record.get('isParameter')) { myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.interop.id, true, function (module) { module.createWindow(record.getBaseId()); - }); - + }); + } - + if (record.isLeaf() || record.data.isParameter) - switch (record.get('nodeType')) + switch (record.get('nodeType')) { case 'myData' : case 'myDataParam' : @@ -592,24 +592,24 @@ Ext.define('amdaUI.ExplorerUI', { case 'timeTable' : case 'sharedtimeTable' : case 'sharedcatalog' : - case 'catalog' : + case 'catalog' : case 'request' : case 'condition' : record.editLeaf(); break; case 'localParam' : case 'remoteParam': - case 'remoteSimuParam': - record.createAlias(record); + case 'remoteSimuParam': + record.createAlias(record); break; - case 'bkgWorks' : - if (!record.get('object')) { + case 'bkgWorks' : + if (!record.get('object')) { AmdaAction.getObject(record.get('id'), record.get('nodeType'), record.getObjectCallback, record); } else { if (record.get('status') == 'done') { var isInteractive = false; - var isNewTab = true; + var isNewTab = true; record.editNode(isNewTab, isInteractive); } else { @@ -618,15 +618,15 @@ Ext.define('amdaUI.ExplorerUI', { } break; } - + }, beforeselect: function(view,node,index,options){ - // if there's at least one node already selected - if(view.selected.length + // if there's at least one node already selected + if(view.selected.length //AND (the node which is beeing selected has a different nodeType than the first selected node OR the first selected node isn't a leaf && ( node.get('nodeType')!== view.selected.items[0].get('nodeType') || !view.selected.items[0].isLeaf()) // OR the node which is beeing selected has no nodeType OR it isn't a leaf OR - || !node.get('nodeType') || !node.isLeaf() + || !node.get('nodeType') || !node.isLeaf() ){ // clear old selection view.deselectAll(); @@ -641,48 +641,48 @@ Ext.define('amdaUI.ExplorerUI', { } } }, - afterrender: function(comp){ - var view = comp.getView(); + afterrender: function(comp){ + var view = comp.getView(); view.tip = Ext.create('Ext.tip.ToolTip', { // The overall target element. target: view.el, // Each grid row causes its own seperate show and hide. - delegate: view.itemSelector, + delegate: view.itemSelector, dismissDelay : 0, // showDelay: 100, // anchor: 'left', // Moving within the row should not hide the tip. - trackMouse: true, - autoRender: true, + trackMouse: true, + autoRender: true, listeners: { // Change content dynamically depending on which element triggered the show. beforeshow: function updateTipBody(tip) { if (view.getRecord(tip.triggerElement)) { var info = view.getRecord(tip.triggerElement).get('info'); - if (!info || info == '') { - tip.addCls('hide'); + if (!info || info == '') { + tip.addCls('hide'); + } + else { + tip.removeCls('hide'); + tip.update(info); } - else { - tip.removeCls('hide'); - tip.update(info); - } } } } }); }, // if remote base is empty - open interoperability module - itemexpand: function(node) { - if ( node.get('nodeType') == amdaModel.RemoteParamNode.nodeType + itemexpand: function(node) { + if ( node.get('nodeType') == amdaModel.RemoteParamNode.nodeType && node.getDepth() == 3 && !node.hasChildNodes()) { - node.addData(); + node.addData(); } }, scope: this }, hideHeaders: true, // must define a column with a field to enable editor - columns: [{ + columns: [{ xtype : 'treetoolcolumn', text : 'Name', flex : 1, @@ -701,25 +701,25 @@ Ext.define('amdaUI.ExplorerUI', { } }, toolIsVisible : function(record) { - + switch (record.get('nodeType')) { case 'localParam' : case 'remoteParam' : case 'remoteSimuParam' : - + return record.get('help') != ''; } return false; }, - field: { + field: { validFlag: false, validator : function(value) { // get explorerModule var explModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id); var explUI = explModule.getUiContent(); var activeTreePanel = explUI.getActiveTab(); - + var editedNode = activeTreePanel.getSelectionModel().selected.items[0]; if (editedNode) { if (!editedNode.get('id') && value === amdaModel.AmdaNode.NEW_DIR_NAME){ @@ -737,7 +737,7 @@ Ext.define('amdaUI.ExplorerUI', { var explModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id); var explUI = explModule.getUiContent(); var activeTreePanel = explUI.getActiveTab(); - + var editedNode = activeTreePanel.getSelectionModel().selected.items[0]; if (editedNode) { editedNode.isValidName(newValue, function (res) { @@ -747,7 +747,7 @@ Ext.define('amdaUI.ExplorerUI', { field.validate(); return; } - + if (!res.valid) { if (res.error) @@ -763,7 +763,7 @@ Ext.define('amdaUI.ExplorerUI', { return; } } - + field.validFlag = true; field.validate(); }); @@ -779,19 +779,19 @@ Ext.define('amdaUI.ExplorerUI', { listeners: { 'canceledit' : function(editor, context) { if (editor && editor.startValue===amdaModel.AmdaNode.NEW_DIR_NAME) { - context.record.remove(true); + context.record.remove(true); } } - + }})], - + setNodesVisibility : function(node,forceHide) { var isFiltered = node.get('filtered'); - + for (var i = 0; i < node.childNodes.length; i++) this.setNodesVisibility(node.childNodes[i],forceHide || isFiltered); - + this.setNodeVisibility(node,!(forceHide || isFiltered)); }, @@ -811,14 +811,14 @@ Ext.define('amdaUI.ExplorerUI', { viewNode.hide(); } }, - + applyFilterToNode : function(node) { if (!node) return; - + var filter = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id).filter; - + switch (node.get('nodeType')) { case 'localParam' : @@ -836,7 +836,7 @@ Ext.define('amdaUI.ExplorerUI', { } var isFiltered = true; for (var i = 0; i < filter['param'].length; i++) - { + { s = filter['param'][i].split(';'); if (node.get('id') == s[pos]) { @@ -847,30 +847,30 @@ Ext.define('amdaUI.ExplorerUI', { node.set('filtered',isFiltered); break; case 'remoteSimuParam' : - - if (!filter || !filter['simu'] ) - { + + if (!filter || !filter['simu'] ) + { //no filter applied node.set('filtered',false); return; } - + var pos = node.get('depth') - 3; //depth from remote param root node - + if (pos < 0 || pos > 5) { node.set('filtered',false); return; } - + var isFiltered = true; - + for (var i = 0; i < filter['simu'].length; i++) - { + { s = filter['simu'][i].split(';'); - + if (node.get('id') == s[pos]) - { + { isFiltered = false; break; } @@ -890,7 +890,7 @@ Ext.define('amdaUI.ExplorerUI', { crtParam = crtParam.replace(/_/g,':'); var isFiltered = true; for (var i = 0; i < this.localParamFilter.result.length; i++) - { + { s = this.localParamFilter.result[i].split(';'); console.log(s[2]); if (crtParam == s[2]) @@ -905,7 +905,7 @@ Ext.define('amdaUI.ExplorerUI', { return; } }, - + applyFilterToNodes : function(node) { node.eachChild(function (child){ @@ -913,12 +913,12 @@ Ext.define('amdaUI.ExplorerUI', { }); tree.applyFilterToNode(node); }, - + applyDisableToNode : function(node) { var crtNode = node; var disable = false; - + do { if (crtNode.get('disable')) @@ -928,8 +928,8 @@ Ext.define('amdaUI.ExplorerUI', { } crtNode = crtNode.parentNode; } while (crtNode); - - + + var viewNode = Ext.fly(tree.getView().getNode(node)); if (disable) { @@ -938,76 +938,76 @@ Ext.define('amdaUI.ExplorerUI', { } } }); - + tree.addEvents('edition'); - - - + + + return tree; }, - + updateFilter : function() - { + { var filter = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id).filter; - + var keys = []; for (var f in filter) { if (hasOwnProperty.call(filter, f)) keys.push(f); } - + var tree = this.query('#'+amdaUI.ExplorerUI.RESRC_TAB.TREE_ID)[0]; tree.getView().refresh(); - + for (var i = 0; i < keys.length; i++) { if (keys[i] == "_empty_") continue; - + switch (keys[i]) { case 'param' : - + //apply filter to local datasets - var localNode = tree.getRootNode().findChild('id','myLocalData-treeRootNode',true); - tree.applyFilterToNodes(localNode); + var localNode = tree.getRootNode().findChild('id','myLocalData-treeRootNode',true); + tree.applyFilterToNodes(localNode); tree.setNodesVisibility(localNode,false); tree.applyDisableToNode(localNode); - + //apply filter to aliases - var aliasNode = tree.getRootNode().findChild('id','alias-treeRootNode',true); - tree.applyFilterToNodes(aliasNode); + var aliasNode = tree.getRootNode().findChild('id','alias-treeRootNode',true); + tree.applyFilterToNodes(aliasNode); tree.setNodesVisibility(aliasNode,false); tree.applyDisableToNode(aliasNode); break; - + case 'simu' : //apply filter to simulation datasets (in remote data) - var remoteNode = tree.getRootNode().findChild('id','myRemoteSimuData-treeRootNode',true); - tree.applyFilterToNodes(remoteNode); + var remoteNode = tree.getRootNode().findChild('id','myRemoteSimuData-treeRootNode',true); + tree.applyFilterToNodes(remoteNode); tree.setNodesVisibility(remoteNode,false); tree.applyDisableToNode(remoteNode); break; } } - + this.dockedItems.getAt(1).items.items[0].select(filter['name']); } -}); - +}); + Ext.define( 'MyTreeEditor', { extend: 'Ext.grid.plugin.CellEditing', alias: 'editing.treeeditor', // initialization method of plugin - init: function(cmp) { + init: function(cmp) { var me = this; me.hostCmp = cmp; // on parent event me.hostCmp.on({ // on edition event - edition : { + edition : { delay: 50, fn : function(view, record, item, index, e){ view.getHeaderAtIndex(0).field.validFlag = 'Not modified'; @@ -1019,7 +1019,7 @@ Ext.define( 'MyTreeEditor', { }); me.callParent(arguments); }, - + /** * Cancel any active editing. */ @@ -1037,16 +1037,16 @@ Ext.define( 'MyTreeEditor', { this.fireEvent('canceledit', activeEd, me.context); } }, - + /** * overwrite the initEditTriggers to disable edition on click/dblclick - * and to add custom + * and to add custom */ initEditTriggers: function() { var me = this, view = me.view; - + me.on({ edit: function(editor,event){ // if there is a modification @@ -1061,7 +1061,7 @@ Ext.define( 'MyTreeEditor', { // in case of directory if (!rec.leaf){ // set folder's ID returned by server - rec.id = result.id; + rec.id = result.id; } } else { // in case of transaction error // reset originalValue diff --git a/js/app/views/InteropUI.js b/js/app/views/InteropUI.js index 85b6a45..0c98a91 100644 --- a/js/app/views/InteropUI.js +++ b/js/app/views/InteropUI.js @@ -107,8 +107,7 @@ Ext.define('amdaUI.InteropUI', { return { xtype : 'panelEpnTap', id : 'epnTapTab', - title : 'EPN-TAP', - module: Ext.create('amdaDesktop.EpnTapModule') + title : 'EPN-TAP' }; }, -- libgit2 0.21.2