Commit f792a3de2c4c89f113466ebc70d564eeb48c59e2
1 parent
bdeecff0
Exists in
master
and in
112 other branches
catalog ihm
Showing
9 changed files
with
559 additions
and
17 deletions
Show diff stats
generic_data/jobs.json
... | ... | @@ -2,12 +2,15 @@ |
2 | 2 | {"nodeType" : "bkgWorks", "text" : "Finished Jobs / Results", "id" : "result-treeRootNode", "children" : |
3 | 3 | [{"nodeType" : "bkgWorks","text" : "Plot","id" : "resPlot-treeRootNode" }, |
4 | 4 | {"nodeType" : "bkgWorks","text" : "Download","id" : "resDown-treeRootNode"}, |
5 | - {"nodeType" : "bkgWorks","text" : "Data Mining","id" : "resSearch-treeRootNode"} | |
5 | + {"nodeType" : "bkgWorks","text" : "Data Mining","id" : "resSearch-treeRootNode"}, | |
6 | + {"nodeType" : "bkgWorks","text" : "Catalog","id" : "resCatalog-treeRootNode"} | |
6 | 7 | ] |
7 | 8 | }, |
8 | 9 | {"nodeType" : "bkgWorks", "text" : "Jobs in Progress", "id" : "bkgjobs-treeRootNode", "children" : |
9 | 10 | [{"nodeType" : "bkgWorks","text" : "Plot","id" : "bkgPlot-treeRootNode" }, |
10 | 11 | {"nodeType" : "bkgWorks","text" : "Download","id" : "bkgDown-treeRootNode"}, |
11 | - {"nodeType" : "bkgWorks","text" : "Data Mining","id" : "bkgSearch-treeRootNode"}] | |
12 | + {"nodeType" : "bkgWorks","text" : "Data Mining","id" : "bkgSearch-treeRootNode"}, | |
13 | + {"nodeType" : "bkgWorks","text" : "Catalog","id" : "bkgCatalog-treeRootNode"} | |
14 | + ] | |
12 | 15 | } |
13 | 16 | ]} |
... | ... |
generic_data/resources.json
... | ... | @@ -14,5 +14,11 @@ |
14 | 14 | { "nodeType" : "sharedtimeTable", "text" : "Shared Time Tables", "id" : "sharedtimeTable-treeRootNode"} |
15 | 15 | ] |
16 | 16 | }, |
17 | + {"nodeType" : "","text" : "Catalogs","id" : "catalog-treeBase", | |
18 | + "children" : [ | |
19 | + { "nodeType" : "catalog", "text" : "My Catalogs", "id" : "catalog-treeRootNode"}, | |
20 | + { "nodeType" : "sharedCatalog", "text" : "Shared Catalogs", "id" : "sharedCatalog-treeRootNode"} | |
21 | + ] | |
22 | + }, | |
17 | 23 | {"nodeType" : "myData","text" : "My Files", "id" : "myData-treeRootNode"} |
18 | 24 | ]} |
... | ... |
js/app/AmdaApp.js
... | ... | @@ -5,20 +5,13 @@ |
5 | 5 | * @extends Ext.ux.desktop.App |
6 | 6 | * @brief Main class defining Amda Desktop and its Modules |
7 | 7 | * @author Ext JS Library 4.0 Copyright(c) 2006-2011 Sencha Inc. licensing@sencha.com |
8 | - * @version $Id: AmdaApp.js 2932 2015-06-02 09:35:47Z elena $ | |
9 | - * @todo Load/Unload Modules on need | |
10 | - ******************************************************************************* | |
11 | - * FT Id : Date : Name - Description | |
12 | - ******************************************************************************* | |
13 | - * : :07/06/2011: elena - First Modifs for Amda Application | |
14 | 8 | */ |
15 | 9 | |
16 | 10 | |
17 | 11 | Ext.define('amdaApp.AmdaApp', { |
18 | 12 | extend: 'Ext.ux.desktop.App', |
19 | 13 | |
20 | - requires: [ | |
21 | - | |
14 | + requires: [ | |
22 | 15 | 'Ext.window.MessageBox', |
23 | 16 | 'Ext.ux.desktop.ShortcutModel', |
24 | 17 | 'amdaUI.SampToolBarUI', |
... | ... | @@ -27,6 +20,13 @@ Ext.define('amdaApp.AmdaApp', { |
27 | 20 | ], |
28 | 21 | |
29 | 22 | dynamicModules: { |
23 | + catalog : { | |
24 | + id : 'catalog-win', | |
25 | + icon : 'icon-catalog', | |
26 | + title : 'Generate/Edit catalogs', | |
27 | + source : 'amdaDesktop.CatalogModule', | |
28 | + useLauncher : true | |
29 | + }, | |
30 | 30 | param : { |
31 | 31 | id : 'param-win', |
32 | 32 | icon : 'icon-parameters', |
... | ... | @@ -49,24 +49,24 @@ Ext.define('amdaApp.AmdaApp', { |
49 | 49 | useLauncher : true |
50 | 50 | }, |
51 | 51 | plot : { |
52 | - id : 'plot-win', | |
52 | + id : 'plot-win', | |
53 | 53 | icon : 'icon-plot', |
54 | 54 | title : 'Plot Manager', |
55 | 55 | source : 'amdaDesktop.PlotModule', |
56 | 56 | useLauncher : true |
57 | 57 | }, |
58 | 58 | search : { |
59 | - id : 'search-win', | |
59 | + id : 'search-win', | |
60 | 60 | icon : 'icon-search', |
61 | 61 | title : 'Data Mining', |
62 | 62 | source : 'amdaDesktop.SearchModule', |
63 | 63 | useLauncher : true |
64 | 64 | }, |
65 | 65 | download : { |
66 | - id : 'down-win', | |
66 | + id : 'down-win', | |
67 | 67 | icon : 'icon-download', |
68 | 68 | title : 'Download data', |
69 | - source : 'amdaDesktop.DownloadModule', | |
69 | + source : 'amdaDesktop.DownloadModule', | |
70 | 70 | useLauncher : true |
71 | 71 | }, |
72 | 72 | upload : { |
... | ... | @@ -279,7 +279,7 @@ Ext.define('amdaApp.AmdaApp', { |
279 | 279 | { name: 'Upload data', iconCls: 'mydata', module: 'up-win'}, |
280 | 280 | { name: 'Manage TimeTables', iconCls: 'timeTable', module: 'timetab-win' }, |
281 | 281 | { name: 'TimeTables operations', iconCls: 'operations', module: 'ttsOpe-win' }, |
282 | - // { name: 'Generate/Edit catalogs', iconCls: 'catalog', module: 'catalog-win'}, | |
282 | + { name: 'Generate/Edit catalogs', iconCls: 'catalog', module: 'catalog-win'}, | |
283 | 283 | // { name: 'Visualize catalogs', iconCls: 'visu_catalog', module: 'visucatalog-win'}, |
284 | 284 | { name: 'Interoperability', iconCls: 'interop', module: 'interop-win' } |
285 | 285 | ] |
... | ... |
... | ... | @@ -0,0 +1,35 @@ |
1 | +/** | |
2 | + * Project AMDA-NG | |
3 | + * Name CatalogModule.js | |
4 | + * @class amdaDesktop.CatalogModule | |
5 | + * @extends amdaDesktop.InteractiveModule | |
6 | + * @brief Catalog Module controller definition | |
7 | + * @author elena | |
8 | + */ | |
9 | + | |
10 | +Ext.define('amdaDesktop.CatalogModule', { | |
11 | + extend: 'amdaDesktop.InteractiveModule', | |
12 | + | |
13 | + requires: [ | |
14 | + 'amdaUI.CatalogUI' | |
15 | + ], | |
16 | + | |
17 | + contentId : 'catalogUI', | |
18 | + | |
19 | + /** | |
20 | + * @cfg {String} data models | |
21 | + * @required | |
22 | + */ | |
23 | + nodeDataModel : 'amdaModel.CatalogNode', | |
24 | + | |
25 | + /** | |
26 | + * @cfg {String} window definitions | |
27 | + * @required | |
28 | + */ | |
29 | + width : 800, | |
30 | + height: 700, | |
31 | + uiType : 'panelCatalog', | |
32 | + helpTitle : 'Help on Catalog Module', | |
33 | + helpFile : 'catalogHelp' | |
34 | + | |
35 | +}); | |
... | ... |
js/app/controllers/ExplorerModule.js
1 | 1 | /** |
2 | - * Project : AMDA-NG4 | |
2 | + * Project : AMDA-NG | |
3 | 3 | * Name : ExplorerModule.js |
4 | 4 | * @class amdaDesktop.ExplorerModule |
5 | 5 | * @extends amdaDesktop.AmdaModule |
6 | 6 | * @brief Explorer Module controller definition |
7 | 7 | * @author CDA |
8 | - * @version $Id: ExplorerModule.js 2239 2014-03-26 12:31:32Z elena $ | |
9 | 8 | */ |
10 | 9 | |
11 | 10 | Ext.define('amdaDesktop.ExplorerModule', { |
... | ... | @@ -23,6 +22,7 @@ Ext.define('amdaDesktop.ExplorerModule', { |
23 | 22 | 'amdaModel.RemoteSimuParamNode', |
24 | 23 | 'amdaModel.AliasNode', |
25 | 24 | 'amdaModel.TimeTableNode', |
25 | + 'amdaModel.CatalogNode', | |
26 | 26 | 'amdaModel.sharedTimeTableNode', |
27 | 27 | 'amdaModel.MyDataParamNode', |
28 | 28 | 'amdaModel.MyDataNode', |
... | ... | @@ -35,6 +35,7 @@ Ext.define('amdaDesktop.ExplorerModule', { |
35 | 35 | 'amdaModel.Plot', |
36 | 36 | 'amdaModel.Download', |
37 | 37 | 'amdaModel.TimeTable', |
38 | + 'amdaModel.Catalog', | |
38 | 39 | 'amdaModel.FileObject', |
39 | 40 | 'amdaModel.FileParamObject', |
40 | 41 | 'amdaModel.FilterInfo' |
... | ... |
... | ... | @@ -0,0 +1,52 @@ |
1 | +/** | |
2 | + * Project : AMDA-NG | |
3 | + * Name : Catalog.js | |
4 | + * Description : Catalog Object Definition | |
5 | + * @class amdaModel.Catalog | |
6 | + * @extends amdaModel.TimeTable | |
7 | + * @author elena | |
8 | + */ | |
9 | + | |
10 | + | |
11 | + | |
12 | +Ext.define('amdaModel.Catalog', { | |
13 | + | |
14 | + extend: 'amdaModel.TimeTable', | |
15 | + | |
16 | + fields : [ | |
17 | + { name: 'parameter' }, | |
18 | + { name: 'timeTables' }//, | |
19 | +// { name: 'timesrc', type: 'string', defaultValue : "TimeTable" } | |
20 | + ], | |
21 | + | |
22 | + getJsonValues : function (hasId) { | |
23 | + var values = new Object(); | |
24 | + if (hasId) { | |
25 | + values.id = this.get('id'); | |
26 | + } | |
27 | + | |
28 | + values.timesrc = 'TimeTable'; | |
29 | + values.name = this.get('name'); | |
30 | + values.created = this.get('created'); | |
31 | + | |
32 | + if (this.get('description').match(/[a-z,0-9]/gi) != null) { | |
33 | + values.description = this.get('description'); | |
34 | + } | |
35 | +// if (this.get('history').match(/[a-z,0-9]/gi) != null) { | |
36 | +// values.history = this.get('history'); | |
37 | +// } | |
38 | + values.objName = this.get('objName'); | |
39 | + values.objFormat = this.get('objFormat'); | |
40 | + values.folderId = this.get('folderId'); | |
41 | + values.nbIntervals = this.get('nbIntervals'); | |
42 | + values.cacheToken = this.get('cacheToken'); | |
43 | + values.parameter = this.get('parameter'); | |
44 | + values.timeTables = this.get('timetable'); | |
45 | + values.leaf = true; | |
46 | + values.nodeType = amdaModel.CatalogNode.nodeType; | |
47 | + return values; | |
48 | + } | |
49 | + | |
50 | + | |
51 | + | |
52 | +}); | |
0 | 53 | \ No newline at end of file |
... | ... |
... | ... | @@ -0,0 +1,28 @@ |
1 | +/** | |
2 | + * Project : AMDA-NG | |
3 | + * Name : CatalogNode.js | |
4 | + * @class amdaModel.CatalogNode | |
5 | + * @extends amdaModel.TimeTableNode | |
6 | + * @brief Basic Model of Node corresponding to a amda catalog | |
7 | + * @author elena | |
8 | + */ | |
9 | + | |
10 | +Ext.define('amdaModel.CatalogNode', { | |
11 | + | |
12 | + extend: 'amdaModel.ExecutableNode', | |
13 | + | |
14 | + statics: { | |
15 | + nodeType: 'catalog', | |
16 | + objectName: 'Catalog' | |
17 | + }, | |
18 | + | |
19 | + constructor : function(config){// | |
20 | + this.callParent(arguments); | |
21 | + this.set('nodeType',amdaModel.CatalogNode.nodeType); | |
22 | + this.set('moduleId',myDesktopApp.dynamicModules.catalog.id); | |
23 | + this.set('ownerTreeId',amdaUI.ExplorerUI.RESRC_TAB.TREE_ID); | |
24 | + this.set('objectDataModel',amdaModel.Catalog.$className); | |
25 | + if (this.get('leaf')) this.set('iconCls', 'icon-catalog'); | |
26 | + } | |
27 | + | |
28 | +}); | |
... | ... |
js/app/stores/ExplorerReader.js
... | ... | @@ -37,6 +37,8 @@ Ext.define('amdaReader.ExplorerReader', { |
37 | 37 | return amdaModel.AliasNode; |
38 | 38 | case 'timeTable' : |
39 | 39 | return amdaModel.TimeTableNode; |
40 | + case 'catalog' : | |
41 | + return amdaModel.CatalogNode; | |
40 | 42 | case 'sharedtimeTable' : |
41 | 43 | return amdaModel.sharedTimeTableNode; |
42 | 44 | case 'condition' : |
... | ... |
... | ... | @@ -0,0 +1,415 @@ |
1 | +/** | |
2 | + * Project AMDA-NG | |
3 | + * Name CatalogUI.js | |
4 | + * @class amdaUI.catalogUI | |
5 | + * @extends Ext.container.Container | |
6 | + * @brief Catalog Module UI definition (View) | |
7 | + * @author elena | |
8 | + */ | |
9 | + | |
10 | +Ext.define('amdaUI.CatalogUI', { | |
11 | + extend: 'Ext.container.Container', | |
12 | + alias: 'widget.panelCatalog', | |
13 | + | |
14 | + requires : [ | |
15 | +// 'amdaModel.Function' | |
16 | + ], | |
17 | + | |
18 | + statics : { | |
19 | +// functionStore : null | |
20 | + }, | |
21 | + | |
22 | + constructor: function(config) { | |
23 | + this.init(config); | |
24 | + this.callParent(arguments); | |
25 | + // if (this.object) this.loadObject(); | |
26 | + }, | |
27 | + | |
28 | + addParam : function(ParamName,isLeaf) | |
29 | + { | |
30 | + var r = Ext.create('amdaModel.AmdaObject', { name: ParamName }); | |
31 | + this.paramGrid.getStore().add(r); | |
32 | + this.paramGrid.getSelectionModel().select(this.paramGrid.getStore().getCount()-1); | |
33 | + }, | |
34 | + | |
35 | + addTT : function(TTname,TTid) | |
36 | + { | |
37 | + Ext.define('tempObject', { | |
38 | + extend: 'Ext.data.Model', | |
39 | + fields: [ | |
40 | + {name: 'name', type: 'string'}, | |
41 | + {name: 'hidden_id', type: 'string'} | |
42 | + ]}); | |
43 | + var r = Ext.create('tempObject', { name:TTname, hidden_id : TTid }); | |
44 | + this.ttGrid.getStore().add(r); | |
45 | + this.ttGrid.getSelectionModel().select(this.paramGrid.getStore().getCount()-1); | |
46 | + | |
47 | + }, | |
48 | + | |
49 | + generateCatalog : function(){ | |
50 | + var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.catalog.id); | |
51 | + if (module) | |
52 | + module.linkedNode.execute(); | |
53 | + }, | |
54 | + | |
55 | + /** | |
56 | + * update this.object from form | |
57 | + */ | |
58 | + | |
59 | + updateObject : function(){ | |
60 | + // get the basic form of the left | |
61 | + var basicForm = this.formPanel.items.items[0].getForm(); | |
62 | + | |
63 | + var formValues = basicForm.getValues(); | |
64 | + this.object.set('name',formValues.name); | |
65 | + this.object.set('description',formValues.description); | |
66 | + | |
67 | + var recs = this.paramGrid.getStore().getNewRecords(); | |
68 | + var paramArr = new Array(); | |
69 | + Ext.Array.each(recs, function(rec, index,allItems){ | |
70 | + var obj = new Object(); | |
71 | + obj.param = rec.get('name'); | |
72 | + obj.function = rec.get('function'); | |
73 | + paramArr.push(obj); | |
74 | + }); | |
75 | + this.object.set('parameter', paramArr); | |
76 | + | |
77 | + // hidden_id - if real 'id' - getNewRecords (and other getRecords) methods doesn't work | |
78 | + var tts = this.ttGrid.getStore().getNewRecords(); | |
79 | + var ttArr = new Array(); | |
80 | + Ext.Array.each(tts, function(rec, index, allItems){ | |
81 | + var obj = new Object(); | |
82 | + obj.id = rec.get('hidden_id'); | |
83 | + ttArr.push(obj); | |
84 | + }); | |
85 | + this.object.set('timetable', ttArr); | |
86 | + | |
87 | + var updateStatus = true; | |
88 | + | |
89 | + return updateStatus; | |
90 | + }, | |
91 | + | |
92 | + init : function (config) { | |
93 | + | |
94 | +// var functions = Ext.create('Ext.data.Store', { | |
95 | +// fields: ['id', 'name'], | |
96 | +// data : [ | |
97 | +// {"id":"min", "name":"MIN"}, | |
98 | +// {"id":"max", "name":"MAX"}, | |
99 | +// {"id":"mean","name":"MEAN"} | |
100 | +// ] | |
101 | +// }); | |
102 | + | |
103 | + this.fieldName = new Ext.form.field.Text({ | |
104 | + fieldLabel: 'Name*', | |
105 | + allowBlank : false, | |
106 | + stripCharsRe: /(^\s+|\s+$)/g, | |
107 | + emptyText: 'Please no spaces!', | |
108 | + name: 'name', | |
109 | + anchor: '100%', | |
110 | + validateOnChange: false, | |
111 | + validateOnBlur: false, | |
112 | + validFlag: false, | |
113 | + validator : function() { | |
114 | + return this.validFlag; | |
115 | + } | |
116 | + }); | |
117 | + | |
118 | + var ttStore = Ext.create('Ext.data.Store', | |
119 | + { | |
120 | + fields: [ 'name', 'hidden_id'] | |
121 | + }); | |
122 | + | |
123 | + this.ttGrid = Ext.create('Ext.grid.Panel', { | |
124 | + title: 'Select Time Table', | |
125 | + height: 100, | |
126 | + store : ttStore, | |
127 | + columns: [ | |
128 | + { xtype: 'rownumberer' }, | |
129 | + { header: "Time Table Name", dataIndex: 'name', flex:1, sortable : false, menuDisabled: true }, | |
130 | + { menuDisabled: true, width: 30, renderer: function() | |
131 | + { | |
132 | + return '<div class="icon-remover" style="width: 15px; height: 15px;"></div>'; | |
133 | + } | |
134 | + } | |
135 | + ], | |
136 | + listeners : { | |
137 | + render : function(o,op) { | |
138 | + var me = this; | |
139 | + var el = me.getEl(); | |
140 | + var dropTarget = Ext.create('Ext.dd.DropTarget', el, { | |
141 | + ddGroup: 'explorerTree', | |
142 | + notifyOver : function(ddSource, e, data) | |
143 | + { | |
144 | + if ((data.records[0].get('nodeType') == 'timeTable' || data.records[0].get('nodeType') == 'sharedtimeTable') && (data.records[0].get('leaf'))) | |
145 | + { | |
146 | + this.valid = true; | |
147 | + return this.dropAllowed; | |
148 | + } | |
149 | + this.valid = false; | |
150 | + return this.dropNotAllowed; | |
151 | + }, | |
152 | + notifyDrop : function(ddSource, e, data) | |
153 | + { | |
154 | + if (!this.valid) return false; | |
155 | + | |
156 | + var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.catalog.id); | |
157 | + if (module) | |
158 | + { | |
159 | + module.getUiContent().addTT(data.records[0].get('text'),data.records[0].get('id')); | |
160 | + } | |
161 | + return true; | |
162 | + } | |
163 | + }); | |
164 | + }, | |
165 | + | |
166 | + cellclick : function(grid, cell, cellIndex, record){ | |
167 | + if (cellIndex == 2) | |
168 | + grid.getStore().remove(record); | |
169 | + } | |
170 | + } | |
171 | + }); | |
172 | + | |
173 | + var store = Ext.create('Ext.data.Store', | |
174 | + { | |
175 | + fields: ['name', 'function'] | |
176 | + }); | |
177 | + | |
178 | + this.paramGrid = Ext.create('Ext.grid.Panel', { | |
179 | + title: 'Select Parameter & Apply Function', | |
180 | + selType : 'rowmodel', | |
181 | + height: 200, | |
182 | + store : store, | |
183 | + columns: [ | |
184 | + { xtype: 'rownumberer' }, | |
185 | + { header: 'parameter', dataIndex: 'name', menuDisabled : true, sortable : false }, | |
186 | + { header: 'function', dataIndex: 'function', menuDisabled : true, sortable : false, | |
187 | + editor: { | |
188 | + xtype: 'combo', queryMode : 'local', | |
189 | +// emptyText : 'please click to select function', | |
190 | + store: [ 'min', 'max', 'mean' ], | |
191 | + triggerAction: 'all', | |
192 | +// lazyInit: false, | |
193 | + listeners: { | |
194 | + focus: function(obj) { | |
195 | + obj.expand(); | |
196 | + } | |
197 | + } | |
198 | + }, | |
199 | + renderer: function(v) | |
200 | + { | |
201 | + if(v != null && v.length > 0 ) | |
202 | + return v; | |
203 | + else | |
204 | + return 'click to select'; | |
205 | + } | |
206 | + }, | |
207 | + { menuDisabled : true, width: 30, renderer: function(){ | |
208 | + return '<div class="icon-remover" style="width: 15px; height: 15px;"></div>'; | |
209 | + } | |
210 | + } | |
211 | + ], | |
212 | + plugins: [ | |
213 | + Ext.create('Ext.grid.plugin.CellEditing', { | |
214 | + clicksToEdit: 1 | |
215 | + }) | |
216 | + ], | |
217 | + listeners : | |
218 | + { | |
219 | + render : function(o,op) | |
220 | + { | |
221 | + var me = this; | |
222 | + var el = me.body.dom; | |
223 | + var dropTarget = Ext.create('Ext.dd.DropTarget', el, { | |
224 | + ddGroup: 'explorerTree', | |
225 | + notifyOver : function(ddSource, e, data) | |
226 | + { | |
227 | + if (data.records[0].data.nodeType == 'localParam' && data.records[0].get('notyet')) { | |
228 | + this.valid = false; | |
229 | + return this.dropNotAllowed; | |
230 | + } | |
231 | + if (((data.records[0].data.nodeType == 'localParam') || | |
232 | + (data.records[0].data.nodeType == 'remoteParam') || | |
233 | + (data.records[0].data.nodeType == 'remoteSimuParam') || | |
234 | + (data.records[0].data.nodeType == 'derivedParam') || | |
235 | + (data.records[0].data.nodeType == 'myDataParam') || | |
236 | + (data.records[0].data.nodeType == 'alias'))&& | |
237 | + (data.records[0].isLeaf() || data.records[0].data.isParameter) && | |
238 | + !data.records[0].data.disable) | |
239 | + { | |
240 | + this.valid = true; | |
241 | + return this.dropAllowed; | |
242 | + } | |
243 | + | |
244 | + this.valid = false; | |
245 | + return this.dropNotAllowed; | |
246 | + }, | |
247 | + notifyDrop : function(ddSource, e, data) | |
248 | + { | |
249 | + if (!this.valid) | |
250 | + return false; | |
251 | + var nameToSent; | |
252 | + switch (data.records[0].data.nodeType) | |
253 | + { | |
254 | + case 'localParam' : | |
255 | + case 'remoteParam': | |
256 | + case 'remoteSimuParam': | |
257 | + nameToSent = data.records[0].get('id'); | |
258 | + if (data.records[0].get('alias')!= "" ) | |
259 | + var nameToSent = "#"+data.records[0].get('alias'); | |
260 | + break; | |
261 | + case 'alias' : | |
262 | + nameToSent = "#"+data.records[0].get('text'); | |
263 | + break; | |
264 | + case 'derivedParam' : | |
265 | + nameToSent = "ws_"+data.records[0].get('text'); | |
266 | + break; | |
267 | + case 'myDataParam' : | |
268 | + nameToSent = "wsd_"+data.records[0].get('text'); | |
269 | + break; | |
270 | + default : | |
271 | + return false; | |
272 | + } | |
273 | + var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.catalog.id); | |
274 | + if (module) | |
275 | + { | |
276 | + if (data.records[0].get('needsArgs') && !data.records[0].get('isSpectra')) { | |
277 | + module.getUiContent().fireEvent('openParamEditor',nameToSent); | |
278 | + } | |
279 | + else { | |
280 | + module.addParam(nameToSent,true); | |
281 | + } | |
282 | + } | |
283 | + return true; | |
284 | + } | |
285 | + }); | |
286 | + }, | |
287 | + cellclick : function(grid, cell, cellIndex, record){ | |
288 | + if (cellIndex == 3) | |
289 | + grid.getStore().remove(record); | |
290 | + } | |
291 | + } | |
292 | + }); | |
293 | + | |
294 | + this.catalogGrid = Ext.create('Ext.grid.Panel', { | |
295 | + title: 'Catalog', | |
296 | + height: 500, | |
297 | + columns: [ | |
298 | + { text: '', dataIndex: '' } | |
299 | + | |
300 | + ] | |
301 | + }); | |
302 | + | |
303 | + this.formPanel = Ext.create('Ext.form.Panel', { | |
304 | + height: 550, | |
305 | + width: 800, | |
306 | + layout: 'border', | |
307 | + defaults: { layout: 'fit', border: false }, | |
308 | + fieldDefaults: { labelWidth: 80, labelAlign : 'top' }, | |
309 | + items: [ | |
310 | + { | |
311 | + xtype: 'form', | |
312 | + region: 'center', | |
313 | + flex: 1, | |
314 | + buttonAlign: 'left', | |
315 | + bodyStyle: {background : '#dfe8f6'}, | |
316 | + padding: '5 5 5 5', | |
317 | + layout: {type: 'vbox', pack: 'start', align: 'stretch'}, | |
318 | + items : [ | |
319 | + this.fieldName, | |
320 | + { | |
321 | + xtype: 'fieldcontainer', | |
322 | + layout: 'hbox', | |
323 | + items: [ | |
324 | + { | |
325 | + xtype:'datefield', fieldLabel:'Creation date', | |
326 | + name: 'created', disabled: true, | |
327 | + hideTrigger: true, format: 'Y/m/d H:i:s' | |
328 | + }, | |
329 | + { xtype: 'splitter' }, | |
330 | + { xtype:'textfield', fieldLabel: 'Intervals', name: 'nbIntervals', disabled: true} | |
331 | + ] | |
332 | + }, | |
333 | + { | |
334 | + xtype: 'textarea', | |
335 | + name: 'description', | |
336 | + fieldLabel: 'Description', | |
337 | +// anchor: '100% 50%' | |
338 | + }, | |
339 | + | |
340 | + this.paramGrid, | |
341 | + this.ttGrid | |
342 | + ], | |
343 | + fbar:[ | |
344 | + { | |
345 | + type: 'button', | |
346 | + text: 'Generate Catalog', | |
347 | + scope : this, | |
348 | + handler: function(button){ | |
349 | + // update object with user's values | |
350 | + // if the return is true (object had been updated) | |
351 | + // if(this.updateObject()){ | |
352 | + this.updateObject(); | |
353 | + this.generateCatalog(); | |
354 | + // } | |
355 | + } | |
356 | + }, | |
357 | + { | |
358 | + type: 'button', | |
359 | + text: 'Reset' | |
360 | + } | |
361 | + ] | |
362 | + }, { | |
363 | + xtype: 'form', | |
364 | + region: 'east', | |
365 | + bodyStyle: {background : '#dfe8f6'}, | |
366 | + padding: '5 5 5 5', | |
367 | + flex: 2, | |
368 | + items : [ | |
369 | + this.catalogGrid | |
370 | + ], | |
371 | + fbar:[ | |
372 | + { | |
373 | + type: 'button', | |
374 | + text: 'Save' | |
375 | + },{ | |
376 | + type: 'button', | |
377 | + text: 'Share', | |
378 | + disabled: true | |
379 | + }, | |
380 | + { | |
381 | + type: 'button', | |
382 | + text: 'Visualize' | |
383 | + } | |
384 | + ] | |
385 | + } | |
386 | + ] | |
387 | + }); | |
388 | + | |
389 | + | |
390 | + | |
391 | + var myConf = { | |
392 | + layout: 'border', | |
393 | + items: [ | |
394 | + this.formPanel, | |
395 | + { | |
396 | + xtype: 'panel', | |
397 | + region: 'south', | |
398 | + title: 'Information', | |
399 | + collapsible: true, | |
400 | + height: 100, | |
401 | + autoHide: false, | |
402 | + bodyStyle: 'padding:5px', | |
403 | + iconCls: 'icon-information', | |
404 | + loader: { | |
405 | + autoLoad: true, | |
406 | + url: helpDir+'downloadHOWTO' | |
407 | + } | |
408 | + } | |
409 | + ] | |
410 | + }; | |
411 | + | |
412 | + Ext.apply (this, Ext.apply(arguments, myConf)); | |
413 | + } | |
414 | + | |
415 | +}); | |
... | ... |