Commit e6134f81b08dcc7b02beaf4ba4e761bf10df3bc8
Exists in
master
and in
111 other branches
Merge branch 'master' into bug_zoom
Showing
9 changed files
with
246 additions
and
330 deletions
Show diff stats
generic_data/RemoteData/Bases.xml deleted
@@ -1,16 +0,0 @@ | @@ -1,16 +0,0 @@ | ||
1 | -<?xml version="1.0"?> | ||
2 | -<dataRoot xml:id="myRemoteData-treeRootNode"> | ||
3 | - <!--<dataCenter name="CDAWeb@NASA" desc="Coordinated_Data_Analysis" group="" id1="CDAWEB" xml:id="CDAWEB"/> | ||
4 | - <dataCenter name="MAPSKP@IRAP" desc="Cassini MAPS_Key_Parameters" group="" default="yes" id1="MAPSKP" xml:id="MAPSKP"/> | ||
5 | - <dataCenter name="THEMIS@IRAP" desc="Mirror_CESR_Data_Base" group="" default="yes" id1="THEMIS" xml:id="THEMIS"/> | ||
6 | - <dataCenter name="CLWEB@IRAP" desc="CLWeb_Internal_Data_Base" default="yes" id1="CLWeb" xml:id="CLWeb"/>--> | ||
7 | - <dataCenter name="LATMOS" desc="Latmos Hybrid Simulation Database" isSimulation='1' default="yes" id1="LATMOS" xml:id="LATMOS"/> | ||
8 | - <dataCenter name="FMI_HYBRID" desc="FMI Hybrid Simulation Database" isSimulation='1' default="yes" id1="FMI_HYBRID" xml:id="FMI_HYBRID"/> | ||
9 | - <dataCenter name="FMI_GUMICS" desc="FMI MHD simulation database" isSimulation='1' default="yes" id1="FMI_GUMICS" xml:id="FMI_GUMICS"/> | ||
10 | - <!--<dataCenter name="SINP" desc="Paraboloid model calculates the magnetic fields in the Earth's magnetosphere depending on external conditions in solar wind and on geomagnetic activity level" isSimulation='1' default="yes" id1="SINP" xml:id="SINP"/>--> | ||
11 | - <dataCenter name="LESIA" desc="LESIA MASER" default="yes" id1="LESIA" isSimulation='1' xml:id="LESIA"/> | ||
12 | - <!--<dataCenter name="CDPP" desc="CCMC BATSRUS with RCM v8.01" default="yes" id1="CCMC" isSimulation='1' xml:id="CCMC"/>--> | ||
13 | - <dataCenter name="IPIM" desc="IPIM @ IRAP" default="yes" id1="IPIM" isSimulation='1' xml:id="IPIM"/> | ||
14 | -</dataRoot> | ||
15 | - | ||
16 | - |
js/app/controllers/ExplorerModule.js
@@ -105,6 +105,13 @@ Ext.define('amdaDesktop.ExplorerModule', | @@ -105,6 +105,13 @@ Ext.define('amdaDesktop.ExplorerModule', | ||
105 | region: 'center' | 105 | region: 'center' |
106 | }, | 106 | }, |
107 | { | 107 | { |
108 | + xtype: 'label', | ||
109 | + text: 'Log:', | ||
110 | + margin: '10 0 -5 0', | ||
111 | + region: 'south', | ||
112 | + height: 20 | ||
113 | + }, | ||
114 | + { | ||
108 | xtype: 'panel', | 115 | xtype: 'panel', |
109 | id: 'LogPanel', | 116 | id: 'LogPanel', |
110 | region: 'south', | 117 | region: 'south', |
@@ -213,7 +220,7 @@ Ext.define('amdaDesktop.ExplorerModule', | @@ -213,7 +220,7 @@ Ext.define('amdaDesktop.ExplorerModule', | ||
213 | }) | 220 | }) |
214 | win = myDesktopApp.getDesktop().getWindow(this.id) | 221 | win = myDesktopApp.getDesktop().getWindow(this.id) |
215 | panel = win.items.get('LogPanel') | 222 | panel = win.items.get('LogPanel') |
216 | - panel.add(msg) | 223 | + panel.insert(0, msg) |
217 | }, | 224 | }, |
218 | 225 | ||
219 | // | 226 | // |
js/app/views/FiltersUI.js
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | ******************************************************************************** | 9 | ******************************************************************************** |
10 | * FT Id : Date : Name - Description | 10 | * FT Id : Date : Name - Description |
11 | ******************************************************************************* | 11 | ******************************************************************************* |
12 | - * : | 12 | + * : |
13 | */ | 13 | */ |
14 | 14 | ||
15 | /* | 15 | /* |
@@ -19,41 +19,41 @@ | @@ -19,41 +19,41 @@ | ||
19 | Ext.define('amdaUI.FilterGridPanel', { | 19 | Ext.define('amdaUI.FilterGridPanel', { |
20 | extend : 'Ext.grid.Panel', | 20 | extend : 'Ext.grid.Panel', |
21 | alias : 'widget.gridFilter', | 21 | alias : 'widget.gridFilter', |
22 | - | 22 | + |
23 | filtersInfoStore : null, | 23 | filtersInfoStore : null, |
24 | filtersListStore : null, | 24 | filtersListStore : null, |
25 | - | 25 | + |
26 | selectListStore : null, | 26 | selectListStore : null, |
27 | crtFilter : null, | 27 | crtFilter : null, |
28 | - | 28 | + |
29 | opStore : null, | 29 | opStore : null, |
30 | condStore : null, | 30 | condStore : null, |
31 | - | 31 | + |
32 | groupingFeature : null, | 32 | groupingFeature : null, |
33 | valueColumn : null, | 33 | valueColumn : null, |
34 | - | 34 | + |
35 | groupMenu : null, | 35 | groupMenu : null, |
36 | itemMenu : null, | 36 | itemMenu : null, |
37 | - | ||
38 | - constructor: function(config) | ||
39 | - { | 37 | + |
38 | + constructor: function(config) | ||
39 | + { | ||
40 | this.init(config); | 40 | this.init(config); |
41 | this.callParent(arguments); | 41 | this.callParent(arguments); |
42 | }, | 42 | }, |
43 | - | 43 | + |
44 | setFiltersInfoStore: function(infoStore) | 44 | setFiltersInfoStore: function(infoStore) |
45 | { | 45 | { |
46 | this.filtersInfoStore = infoStore; | 46 | this.filtersInfoStore = infoStore; |
47 | }, | 47 | }, |
48 | - | 48 | + |
49 | setFiltersListStore: function(listStore) | 49 | setFiltersListStore: function(listStore) |
50 | { | 50 | { |
51 | this.filtersListStore = listStore; | 51 | this.filtersListStore = listStore; |
52 | }, | 52 | }, |
53 | - | 53 | + |
54 | setConditions : function(record) | 54 | setConditions : function(record) |
55 | { | 55 | { |
56 | - this.editingPlugin.completeEdit(); | 56 | + this.editingPlugin.completeEdit(); |
57 | this.crtFilter = record; | 57 | this.crtFilter = record; |
58 | this.reconfigure(record.conditions()); | 58 | this.reconfigure(record.conditions()); |
59 | this.store.groupField = 'type'; | 59 | this.store.groupField = 'type'; |
@@ -61,59 +61,59 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -61,59 +61,59 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
61 | if (record.conditions().getCount() > 0) | 61 | if (record.conditions().getCount() > 0) |
62 | this.getSelectionModel().select(record.conditions().getAt(0)); | 62 | this.getSelectionModel().select(record.conditions().getAt(0)); |
63 | }, | 63 | }, |
64 | - | 64 | + |
65 | setConditionType : function(condType,condInfo,reset) | 65 | setConditionType : function(condType,condInfo,reset) |
66 | { | 66 | { |
67 | if (!condInfo) | 67 | if (!condInfo) |
68 | return; | 68 | return; |
69 | - | 69 | + |
70 | //update current conditions types store | 70 | //update current conditions types store |
71 | this.condStore.removeAll(); | 71 | this.condStore.removeAll(); |
72 | - | 72 | + |
73 | this.filtersInfoStore.getById(condType).conditions().data.each(function(cond) | 73 | this.filtersInfoStore.getById(condType).conditions().data.each(function(cond) |
74 | { | 74 | { |
75 | this.condStore.add(cond); | 75 | this.condStore.add(cond); |
76 | }, | 76 | }, |
77 | this | 77 | this |
78 | ); | 78 | ); |
79 | - | 79 | + |
80 | //update current operators store | 80 | //update current operators store |
81 | this.opStore.removeAll(); | 81 | this.opStore.removeAll(); |
82 | - | 82 | + |
83 | condInfo.ops().data.each(function(op) | 83 | condInfo.ops().data.each(function(op) |
84 | { | 84 | { |
85 | this.opStore.add({id : op.get('id'), name : op.get('name')}); | 85 | this.opStore.add({id : op.get('id'), name : op.get('name')}); |
86 | }, | 86 | }, |
87 | this | 87 | this |
88 | ); | 88 | ); |
89 | - | 89 | + |
90 | //update current value field | 90 | //update current value field |
91 | var valueField = this.getValueField(condInfo); | 91 | var valueField = this.getValueField(condInfo); |
92 | - this.editingPlugin.completeEdit(); | 92 | + this.editingPlugin.completeEdit(); |
93 | this.editingPlugin.setColumnField(this.columns[3],valueField); | 93 | this.editingPlugin.setColumnField(this.columns[3],valueField); |
94 | - | 94 | + |
95 | //get current cell | 95 | //get current cell |
96 | var crtCell; | 96 | var crtCell; |
97 | - if (this.getSelectionModel().hasSelection()) { | ||
98 | - crtCell = this.getSelectionModel().getSelection()[0]; | 97 | + if (this.getSelectionModel().hasSelection()) { |
98 | + crtCell = this.getSelectionModel().getSelection()[0]; | ||
99 | } | 99 | } |
100 | else | 100 | else |
101 | - return; | 101 | + return; |
102 | crtCell.set('condId',condInfo.get('id')); | 102 | crtCell.set('condId',condInfo.get('id')); |
103 | - | 103 | + |
104 | if (reset) | 104 | if (reset) |
105 | - { | 105 | + { |
106 | //set first operator | 106 | //set first operator |
107 | crtCell.set('opId',this.opStore.getAt(0).get('id')); | 107 | crtCell.set('opId',this.opStore.getAt(0).get('id')); |
108 | - | 108 | + |
109 | //reset value field | 109 | //reset value field |
110 | switch (valueField.xtype) | 110 | switch (valueField.xtype) |
111 | { | 111 | { |
112 | - case 'combobox' : | 112 | + case 'combobox' : |
113 | crtCell.set('value',valueField.store.getAt(0).get('name')); | 113 | crtCell.set('value',valueField.store.getAt(0).get('name')); |
114 | break; | 114 | break; |
115 | case 'datefield' : | 115 | case 'datefield' : |
116 | - var date = new Date(); | 116 | + var date = new Date(); |
117 | crtCell.set('value',date); | 117 | crtCell.set('value',date); |
118 | break; | 118 | break; |
119 | default : | 119 | default : |
@@ -121,7 +121,7 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -121,7 +121,7 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
121 | } | 121 | } |
122 | } | 122 | } |
123 | }, | 123 | }, |
124 | - | 124 | + |
125 | getValueField : function(condInfo) | 125 | getValueField : function(condInfo) |
126 | { | 126 | { |
127 | //get field type in relation with the condition | 127 | //get field type in relation with the condition |
@@ -130,21 +130,21 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -130,21 +130,21 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
130 | case 'select' : | 130 | case 'select' : |
131 | if (!this.filtersListStore.getById(condInfo.get('selectList'))) | 131 | if (!this.filtersListStore.getById(condInfo.get('selectList'))) |
132 | console.log('Error - Missing select list definition for '+condInfo.get('selectList')); | 132 | console.log('Error - Missing select list definition for '+condInfo.get('selectList')); |
133 | - else { | 133 | + else { |
134 | // to avoid an attempt to load remotely association store in combobox - it is already here! | 134 | // to avoid an attempt to load remotely association store in combobox - it is already here! |
135 | var store2 = new Ext.data.Store({model : 'amdaModel.FilterSelectListElt'}); | 135 | var store2 = new Ext.data.Store({model : 'amdaModel.FilterSelectListElt'}); |
136 | - | 136 | + |
137 | this.filtersListStore.getById(condInfo.get('selectList')).elems().each(function(record){ | 137 | this.filtersListStore.getById(condInfo.get('selectList')).elems().each(function(record){ |
138 | store2.add(record.copy()); | 138 | store2.add(record.copy()); |
139 | - }); | ||
140 | - | 139 | + }); |
140 | + | ||
141 | return { | 141 | return { |
142 | xtype : 'combobox', | 142 | xtype : 'combobox', |
143 | queryMode: 'local', | 143 | queryMode: 'local', |
144 | editable: false, | 144 | editable: false, |
145 | displayField:'name', | 145 | displayField:'name', |
146 | valueField : 'id', | 146 | valueField : 'id', |
147 | - store : store2 | 147 | + store : store2 |
148 | }; | 148 | }; |
149 | } | 149 | } |
150 | case 'date' : | 150 | case 'date' : |
@@ -159,23 +159,23 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -159,23 +159,23 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
159 | }; | 159 | }; |
160 | 160 | ||
161 | } | 161 | } |
162 | - | 162 | + |
163 | // console.log('Error - Missing value field definition for '+condInfo.get('type')); | 163 | // console.log('Error - Missing value field definition for '+condInfo.get('type')); |
164 | return { | 164 | return { |
165 | xtype : 'textfield' | 165 | xtype : 'textfield' |
166 | }; | 166 | }; |
167 | }, | 167 | }, |
168 | - | 168 | + |
169 | createCondition : function(group) | 169 | createCondition : function(group) |
170 | { | 170 | { |
171 | var rec = Ext.create('amdaModel.FilterDefCond',{ | 171 | var rec = Ext.create('amdaModel.FilterDefCond',{ |
172 | type : group, | 172 | type : group, |
173 | logical : 'and' | 173 | logical : 'and' |
174 | }); | 174 | }); |
175 | - | 175 | + |
176 | return rec; | 176 | return rec; |
177 | }, | 177 | }, |
178 | - | 178 | + |
179 | onAddCondition : function(t) | 179 | onAddCondition : function(t) |
180 | { | 180 | { |
181 | var crtGroup = t.parentMenu.crtGroup; | 181 | var crtGroup = t.parentMenu.crtGroup; |
@@ -187,7 +187,7 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -187,7 +187,7 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
187 | this.store.each(function(cond) | 187 | this.store.each(function(cond) |
188 | { | 188 | { |
189 | if (cond.get('type') == crtGroup) | 189 | if (cond.get('type') == crtGroup) |
190 | - maxIndex = (maxIndex < cond.get('index')) ? cond.get('index') : maxIndex; | 190 | + maxIndex = (maxIndex < cond.get('index')) ? cond.get('index') : maxIndex; |
191 | },this); | 191 | },this); |
192 | rec.set('index',maxIndex+1); | 192 | rec.set('index',maxIndex+1); |
193 | this.store.add(rec); | 193 | this.store.add(rec); |
@@ -196,7 +196,7 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -196,7 +196,7 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
196 | this.getSelectionModel().select(rec); | 196 | this.getSelectionModel().select(rec); |
197 | this.setConditionType(crtGroup,firstCond, true); | 197 | this.setConditionType(crtGroup,firstCond, true); |
198 | }, | 198 | }, |
199 | - | 199 | + |
200 | onInsertCondition : function(t) | 200 | onInsertCondition : function(t) |
201 | { | 201 | { |
202 | if (this.getSelectionModel().hasSelection()) | 202 | if (this.getSelectionModel().hasSelection()) |
@@ -218,7 +218,7 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -218,7 +218,7 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
218 | this.setConditionType(crtRec.get('type'),firstCond, true); | 218 | this.setConditionType(crtRec.get('type'),firstCond, true); |
219 | } | 219 | } |
220 | }, | 220 | }, |
221 | - | 221 | + |
222 | onDeleteCondition : function(t) | 222 | onDeleteCondition : function(t) |
223 | { | 223 | { |
224 | if (this.getSelectionModel().hasSelection()) | 224 | if (this.getSelectionModel().hasSelection()) |
@@ -229,7 +229,7 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -229,7 +229,7 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
229 | this.store.group('type'); | 229 | this.store.group('type'); |
230 | }; | 230 | }; |
231 | }, | 231 | }, |
232 | - | 232 | + |
233 | onClearGroupConditions : function(t) | 233 | onClearGroupConditions : function(t) |
234 | { | 234 | { |
235 | var crtGroup = t.parentMenu.crtGroup; | 235 | var crtGroup = t.parentMenu.crtGroup; |
@@ -243,17 +243,17 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -243,17 +243,17 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
243 | if (rec.get('index') == -1) | 243 | if (rec.get('index') == -1) |
244 | return; | 244 | return; |
245 | this.store.remove(rec); | 245 | this.store.remove(rec); |
246 | - },this); | 246 | + },this); |
247 | this.store.group('type'); | 247 | this.store.group('type'); |
248 | }, | 248 | }, |
249 | - | 249 | + |
250 | onClearAllConditions : function(t) | 250 | onClearAllConditions : function(t) |
251 | - { | 251 | + { |
252 | var recs = this.store.getGroups(); | 252 | var recs = this.store.getGroups(); |
253 | if (!recs) | 253 | if (!recs) |
254 | return; | 254 | return; |
255 | Ext.each(recs, function (group) | 255 | Ext.each(recs, function (group) |
256 | - { | 256 | + { |
257 | Ext.each(group.children, function (rec) | 257 | Ext.each(group.children, function (rec) |
258 | { | 258 | { |
259 | if (rec.get('index') == -1) | 259 | if (rec.get('index') == -1) |
@@ -264,47 +264,47 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -264,47 +264,47 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
264 | this); | 264 | this); |
265 | this.store.group('type'); | 265 | this.store.group('type'); |
266 | }, | 266 | }, |
267 | - | 267 | + |
268 | onSelectConditionType : function(combo,records,eOpts) | 268 | onSelectConditionType : function(combo,records,eOpts) |
269 | { | 269 | { |
270 | if (!records || (records.length != 1)) | 270 | if (!records || (records.length != 1)) |
271 | return; | 271 | return; |
272 | this.setConditionType(records[0].getFilter().get('id'),records[0],true); | 272 | this.setConditionType(records[0].getFilter().get('id'),records[0],true); |
273 | }, | 273 | }, |
274 | - | 274 | + |
275 | createCellEditingPlugin : function() | 275 | createCellEditingPlugin : function() |
276 | { | 276 | { |
277 | var cellPlug = Ext.create('Ext.grid.plugin.CellEditing', { | 277 | var cellPlug = Ext.create('Ext.grid.plugin.CellEditing', { |
278 | clicksToEdit: 2, | 278 | clicksToEdit: 2, |
279 | listeners: { | 279 | listeners: { |
280 | - beforeedit: function(o, el, opt) { | 280 | + beforeedit: function(o, el, opt) { |
281 | if ((el.field == 'logical') && (el.record.get('index') <= 0)) | 281 | if ((el.field == 'logical') && (el.record.get('index') <= 0)) |
282 | return false; | 282 | return false; |
283 | return true; | 283 | return true; |
284 | } | 284 | } |
285 | } | 285 | } |
286 | - }); | ||
287 | - | 286 | + }); |
287 | + | ||
288 | return cellPlug; | 288 | return cellPlug; |
289 | }, | 289 | }, |
290 | - | 290 | + |
291 | createOperatorStore : function() | 291 | createOperatorStore : function() |
292 | { | 292 | { |
293 | this.opStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterOpInfo'}); | 293 | this.opStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterOpInfo'}); |
294 | return this.opStore; | 294 | return this.opStore; |
295 | }, | 295 | }, |
296 | - | 296 | + |
297 | createFilterCondInfoStore : function() | 297 | createFilterCondInfoStore : function() |
298 | { | 298 | { |
299 | this.condStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterConditionInfo'}); | 299 | this.condStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterConditionInfo'}); |
300 | return this.condStore; | 300 | return this.condStore; |
301 | }, | 301 | }, |
302 | - | 302 | + |
303 | createLogicalColumn : function() | 303 | createLogicalColumn : function() |
304 | { | 304 | { |
305 | return { | 305 | return { |
306 | - header: '', | ||
307 | - dataIndex: 'logical', | 306 | + header: '', |
307 | + dataIndex: 'logical', | ||
308 | flex: 1, | 308 | flex: 1, |
309 | allowBlank : false, | 309 | allowBlank : false, |
310 | renderer: function(value,metaData,record,rowIndex,colIndex,store,view) | 310 | renderer: function(value,metaData,record,rowIndex,colIndex,store,view) |
@@ -322,18 +322,18 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -322,18 +322,18 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
322 | } | 322 | } |
323 | }; | 323 | }; |
324 | }, | 324 | }, |
325 | - | 325 | + |
326 | createTypeColumn : function() | 326 | createTypeColumn : function() |
327 | { | 327 | { |
328 | - return { | ||
329 | - header: 'Type', | ||
330 | - dataIndex: 'condId', | 328 | + return { |
329 | + header: 'Type', | ||
330 | + dataIndex: 'condId', | ||
331 | flex: 3, | 331 | flex: 3, |
332 | allowBlank : false, | 332 | allowBlank : false, |
333 | renderer: function(value,metaData,record,rowIndex,colIndex,store,view) | 333 | renderer: function(value,metaData,record,rowIndex,colIndex,store,view) |
334 | { | 334 | { |
335 | var crtType = record.get('type'); | 335 | var crtType = record.get('type'); |
336 | - var conditions = this.filtersInfoStore.getById(crtType).conditions(); | 336 | + var conditions = this.filtersInfoStore.getById(crtType).conditions(); |
337 | var condition = conditions.getById(record.get('condId')); | 337 | var condition = conditions.getById(record.get('condId')); |
338 | if (condition) | 338 | if (condition) |
339 | return condition.get('name'); | 339 | return condition.get('name'); |
@@ -354,21 +354,21 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -354,21 +354,21 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
354 | 'select': this.onSelectConditionType | 354 | 'select': this.onSelectConditionType |
355 | } | 355 | } |
356 | } | 356 | } |
357 | - }; | 357 | + }; |
358 | }, | 358 | }, |
359 | - | 359 | + |
360 | createOperatorColumn : function() | 360 | createOperatorColumn : function() |
361 | { | 361 | { |
362 | - return { | ||
363 | - header: '', | ||
364 | - dataIndex: 'opId', | 362 | + return { |
363 | + header: '', | ||
364 | + dataIndex: 'opId', | ||
365 | flex: 1, | 365 | flex: 1, |
366 | allowBlank : false, | 366 | allowBlank : false, |
367 | renderer: function(value,metaData,record,rowIndex,colIndex,store,view) | 367 | renderer: function(value,metaData,record,rowIndex,colIndex,store,view) |
368 | { | 368 | { |
369 | var crtType = record.get('type'); | 369 | var crtType = record.get('type'); |
370 | var conditions = this.filtersInfoStore.getById(crtType).conditions(); | 370 | var conditions = this.filtersInfoStore.getById(crtType).conditions(); |
371 | - | 371 | + |
372 | var condition = conditions.getById(record.get('condId')); | 372 | var condition = conditions.getById(record.get('condId')); |
373 | if (!condition || !condition.ops().getById(record.get('opId'))) | 373 | if (!condition || !condition.ops().getById(record.get('opId'))) |
374 | return ''; | 374 | return ''; |
@@ -383,21 +383,21 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -383,21 +383,21 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
383 | valueField : 'id', | 383 | valueField : 'id', |
384 | store : this.createOperatorStore() | 384 | store : this.createOperatorStore() |
385 | } | 385 | } |
386 | - | 386 | + |
387 | }; | 387 | }; |
388 | }, | 388 | }, |
389 | - | 389 | + |
390 | createValueColumn : function() | 390 | createValueColumn : function() |
391 | { | 391 | { |
392 | - return { | ||
393 | - header: 'Value', | ||
394 | - dataIndex: 'value', | 392 | + return { |
393 | + header: 'Value', | ||
394 | + dataIndex: 'value', | ||
395 | flex: 3, | 395 | flex: 3, |
396 | renderer: function(value,metaData,record,rowIndex,colIndex,store,view) | 396 | renderer: function(value,metaData,record,rowIndex,colIndex,store,view) |
397 | { | 397 | { |
398 | var crtType = record.get('type'); | 398 | var crtType = record.get('type'); |
399 | var conditions = this.filtersInfoStore.getById(crtType).conditions(); | 399 | var conditions = this.filtersInfoStore.getById(crtType).conditions(); |
400 | - var condition = conditions.getById(record.get('condId')); | 400 | + var condition = conditions.getById(record.get('condId')); |
401 | if (!condition) | 401 | if (!condition) |
402 | return value; | 402 | return value; |
403 | switch(condition.get('type')) | 403 | switch(condition.get('type')) |
@@ -417,7 +417,7 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -417,7 +417,7 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
417 | } | 417 | } |
418 | }; | 418 | }; |
419 | }, | 419 | }, |
420 | - | 420 | + |
421 | createColumns : function() | 421 | createColumns : function() |
422 | { | 422 | { |
423 | return [ | 423 | return [ |
@@ -427,11 +427,11 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -427,11 +427,11 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
427 | this.createValueColumn() | 427 | this.createValueColumn() |
428 | ]; | 428 | ]; |
429 | }, | 429 | }, |
430 | - | 430 | + |
431 | createContextMenus : function() | 431 | createContextMenus : function() |
432 | { | 432 | { |
433 | var me = this; | 433 | var me = this; |
434 | - | 434 | + |
435 | this.groupMenu = Ext.create('Ext.menu.Menu', { | 435 | this.groupMenu = Ext.create('Ext.menu.Menu', { |
436 | crtGroup : null, | 436 | crtGroup : null, |
437 | items: [{ | 437 | items: [{ |
@@ -454,7 +454,7 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -454,7 +454,7 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
454 | } | 454 | } |
455 | ] | 455 | ] |
456 | }); | 456 | }); |
457 | - | 457 | + |
458 | this.itemMenu = Ext.create('Ext.menu.Menu', { | 458 | this.itemMenu = Ext.create('Ext.menu.Menu', { |
459 | items: [{ | 459 | items: [{ |
460 | text: 'Insert', | 460 | text: 'Insert', |
@@ -468,21 +468,21 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -468,21 +468,21 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
468 | scope : me | 468 | scope : me |
469 | } | 469 | } |
470 | ] | 470 | ] |
471 | - }); | 471 | + }); |
472 | }, | 472 | }, |
473 | - | 473 | + |
474 | createGroupingFeature : function() | 474 | createGroupingFeature : function() |
475 | { | 475 | { |
476 | var me = this; | 476 | var me = this; |
477 | - | 477 | + |
478 | this.groupingFeature = Ext.create('Ext.grid.feature.Grouping',{ | 478 | this.groupingFeature = Ext.create('Ext.grid.feature.Grouping',{ |
479 | enableGroupingMenu: true, | 479 | enableGroupingMenu: true, |
480 | enableNoGroups : false, | 480 | enableNoGroups : false, |
481 | showGroupsText : false, | 481 | showGroupsText : false, |
482 | - groupHeaderTpl: Ext.create('Ext.XTemplate', | ||
483 | - '{name:this.filter_type} ({rows.length:this.cond_info})', | 482 | + groupHeaderTpl: Ext.create('Ext.XTemplate', |
483 | + '{name:this.filter_type} ({rows.length:this.cond_info})', | ||
484 | { | 484 | { |
485 | - cond_info : function(val) | 485 | + cond_info : function(val) |
486 | { | 486 | { |
487 | var nbCond = val < 1 ? 0 : val-1; | 487 | var nbCond = val < 1 ? 0 : val-1; |
488 | return (nbCond > 1) ? nbCond+' conditions' : nbCond+' condition'; | 488 | return (nbCond > 1) ? nbCond+' conditions' : nbCond+' condition'; |
@@ -497,20 +497,20 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -497,20 +497,20 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
497 | return rec.get('name'); | 497 | return rec.get('name'); |
498 | } | 498 | } |
499 | } | 499 | } |
500 | - | 500 | + |
501 | ) | 501 | ) |
502 | }); | 502 | }); |
503 | }, | 503 | }, |
504 | - | ||
505 | - init : function(config) | 504 | + |
505 | + init : function(config) | ||
506 | { | 506 | { |
507 | var me = this; | 507 | var me = this; |
508 | - | 508 | + |
509 | this.createContextMenus(); | 509 | this.createContextMenus(); |
510 | - | 510 | + |
511 | this.createGroupingFeature(); | 511 | this.createGroupingFeature(); |
512 | - | ||
513 | - var myConf = | 512 | + |
513 | + var myConf = | ||
514 | { | 514 | { |
515 | plugins : [ | 515 | plugins : [ |
516 | this.createCellEditingPlugin() | 516 | this.createCellEditingPlugin() |
@@ -531,12 +531,12 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -531,12 +531,12 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
531 | { | 531 | { |
532 | if (selections && selections[0]) | 532 | if (selections && selections[0]) |
533 | { | 533 | { |
534 | - | 534 | + |
535 | var condId = selections[0].get('condId'); | 535 | var condId = selections[0].get('condId'); |
536 | - | 536 | + |
537 | var crtType = selections[0].get('type'); | 537 | var crtType = selections[0].get('type'); |
538 | var conditions = this.filtersInfoStore.getById(crtType).conditions(); | 538 | var conditions = this.filtersInfoStore.getById(crtType).conditions(); |
539 | - | 539 | + |
540 | var cond = conditions.getById(condId); | 540 | var cond = conditions.getById(condId); |
541 | if (cond) | 541 | if (cond) |
542 | { | 542 | { |
@@ -550,13 +550,13 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -550,13 +550,13 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
550 | this.itemMenu.showAt(e.getXY()); | 550 | this.itemMenu.showAt(e.getXY()); |
551 | }, | 551 | }, |
552 | groupcontextmenu : function(view, node, group, e) | 552 | groupcontextmenu : function(view, node, group, e) |
553 | - { | 553 | + { |
554 | e.stopEvent(); | 554 | e.stopEvent(); |
555 | this.groupMenu.crtGroup = group; | 555 | this.groupMenu.crtGroup = group; |
556 | this.groupMenu.showAt(e.getXY()); | 556 | this.groupMenu.showAt(e.getXY()); |
557 | }, | 557 | }, |
558 | scope : this | 558 | scope : this |
559 | - | 559 | + |
560 | } | 560 | } |
561 | }; | 561 | }; |
562 | Ext.apply (this , Ext.apply (arguments, myConf)); | 562 | Ext.apply (this , Ext.apply (arguments, myConf)); |
@@ -564,7 +564,7 @@ Ext.define('amdaUI.FilterGridPanel', { | @@ -564,7 +564,7 @@ Ext.define('amdaUI.FilterGridPanel', { | ||
564 | }); | 564 | }); |
565 | 565 | ||
566 | /* | 566 | /* |
567 | - * Filters main interface | 567 | + * Filters main interface |
568 | */ | 568 | */ |
569 | 569 | ||
570 | Ext.define('amdaUI.FiltersUI', { | 570 | Ext.define('amdaUI.FiltersUI', { |
@@ -575,27 +575,27 @@ Ext.define('amdaUI.FiltersUI', { | @@ -575,27 +575,27 @@ Ext.define('amdaUI.FiltersUI', { | ||
575 | 'amdaModel.FilterInfo', | 575 | 'amdaModel.FilterInfo', |
576 | 'amdaModel.FilterDef' | 576 | 'amdaModel.FilterDef' |
577 | ], | 577 | ], |
578 | - | 578 | + |
579 | newFilterName : 'New_Filter_', | 579 | newFilterName : 'New_Filter_', |
580 | - | 580 | + |
581 | //filters info to build interface | 581 | //filters info to build interface |
582 | filtersInfoStore : null, | 582 | filtersInfoStore : null, |
583 | filtersListStore : null, | 583 | filtersListStore : null, |
584 | - | ||
585 | - constructor: function(config) { | 584 | + |
585 | + constructor: function(config) { | ||
586 | this.init(config); | 586 | this.init(config); |
587 | this.callParent(arguments); | 587 | this.callParent(arguments); |
588 | }, | 588 | }, |
589 | - | 589 | + |
590 | onSelect : function(combo,records,eOpts) | 590 | onSelect : function(combo,records,eOpts) |
591 | { | 591 | { |
592 | if (!records || (records.length != 1)) | 592 | if (!records || (records.length != 1)) |
593 | - return; | 593 | + return; |
594 | var record = records[0]; | 594 | var record = records[0]; |
595 | this.setFilterName(record.get('name')); | 595 | this.setFilterName(record.get('name')); |
596 | this.grid.setConditions(record); | 596 | this.grid.setConditions(record); |
597 | }, | 597 | }, |
598 | - | 598 | + |
599 | onBeforeSelect: function(combo, record, index) | 599 | onBeforeSelect: function(combo, record, index) |
600 | { | 600 | { |
601 | /*var me = this; | 601 | /*var me = this; |
@@ -617,12 +617,12 @@ Ext.define('amdaUI.FiltersUI', { | @@ -617,12 +617,12 @@ Ext.define('amdaUI.FiltersUI', { | ||
617 | }*/ | 617 | }*/ |
618 | return true; | 618 | return true; |
619 | }, | 619 | }, |
620 | - | 620 | + |
621 | onAddFilter : function(t) | 621 | onAddFilter : function(t) |
622 | { | 622 | { |
623 | this.addFilter(null,null); | 623 | this.addFilter(null,null); |
624 | }, | 624 | }, |
625 | - | 625 | + |
626 | addFilter : function(name,conds,successfn) | 626 | addFilter : function(name,conds,successfn) |
627 | { | 627 | { |
628 | var combo = this.getFilterCombo(); | 628 | var combo = this.getFilterCombo(); |
@@ -630,20 +630,20 @@ Ext.define('amdaUI.FiltersUI', { | @@ -630,20 +630,20 @@ Ext.define('amdaUI.FiltersUI', { | ||
630 | return null; | 630 | return null; |
631 | 631 | ||
632 | var newRec = Ext.create('amdaModel.FilterDef'); | 632 | var newRec = Ext.create('amdaModel.FilterDef'); |
633 | - | 633 | + |
634 | if (name != null) | 634 | if (name != null) |
635 | newRec.set('name',name); | 635 | newRec.set('name',name); |
636 | - | 636 | + |
637 | newRec.conditions(); | 637 | newRec.conditions(); |
638 | - | 638 | + |
639 | if (conds != null) | 639 | if (conds != null) |
640 | Ext.each(conds, function(cond) | 640 | Ext.each(conds, function(cond) |
641 | { | 641 | { |
642 | newRec.conditions().add(cond); | 642 | newRec.conditions().add(cond); |
643 | },this); | 643 | },this); |
644 | - | 644 | + |
645 | combo.store.add(newRec); | 645 | combo.store.add(newRec); |
646 | - | 646 | + |
647 | //sync store with the server | 647 | //sync store with the server |
648 | combo.store.sync({ | 648 | combo.store.sync({ |
649 | scope: this, | 649 | scope: this, |
@@ -655,27 +655,27 @@ Ext.define('amdaUI.FiltersUI', { | @@ -655,27 +655,27 @@ Ext.define('amdaUI.FiltersUI', { | ||
655 | newRec.conditions().removeAll(); | 655 | newRec.conditions().removeAll(); |
656 | newRec.conditions().add(resRec.conditions); | 656 | newRec.conditions().add(resRec.conditions); |
657 | combo.select(newRec); | 657 | combo.select(newRec); |
658 | - combo.fireEvent('select', combo, [newRec] ); | 658 | + combo.fireEvent('select', combo, [newRec] ); |
659 | if (successfn) | 659 | if (successfn) |
660 | successfn.call(this,newRec); | 660 | successfn.call(this,newRec); |
661 | }}); | 661 | }}); |
662 | - | 662 | + |
663 | return newRec; | 663 | return newRec; |
664 | }, | 664 | }, |
665 | - | 665 | + |
666 | onDeleteFilter : function(t) | 666 | onDeleteFilter : function(t) |
667 | { | 667 | { |
668 | var combo = this.getFilterCombo(); | 668 | var combo = this.getFilterCombo(); |
669 | if (!combo) | 669 | if (!combo) |
670 | return; | 670 | return; |
671 | - | 671 | + |
672 | var rec = this.getCrtFilterRecord(); | 672 | var rec = this.getCrtFilterRecord(); |
673 | - | 673 | + |
674 | if (!rec) | 674 | if (!rec) |
675 | return; | 675 | return; |
676 | if (rec.get("id") == "0") | 676 | if (rec.get("id") == "0") |
677 | Ext.Msg.show( { | 677 | Ext.Msg.show( { |
678 | - title : 'Filter', | 678 | + title : 'Filter', |
679 | msg : 'Cannot delete the Default Filter', | 679 | msg : 'Cannot delete the Default Filter', |
680 | modal : false, | 680 | modal : false, |
681 | icon : Ext.Msg.ERROR, | 681 | icon : Ext.Msg.ERROR, |
@@ -691,47 +691,44 @@ Ext.define('amdaUI.FiltersUI', { | @@ -691,47 +691,44 @@ Ext.define('amdaUI.FiltersUI', { | ||
691 | //fire select event | 691 | //fire select event |
692 | combo.fireEvent('select', combo, [combo.store.getAt(0)]); | 692 | combo.fireEvent('select', combo, [combo.store.getAt(0)]); |
693 | } | 693 | } |
694 | - // the same in WS explorer combobox | 694 | + // the same in WS explorer combobox |
695 | myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id, true, function (module) { | 695 | myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id, true, function (module) { |
696 | var store = module.filtersStore; | 696 | var store = module.filtersStore; |
697 | - var win = module.getUiContent(); | 697 | + var win = module.getUiContent(); |
698 | var comboList = win.dockedItems.getAt(1).items.items[0]; | 698 | var comboList = win.dockedItems.getAt(1).items.items[0]; |
699 | - | ||
700 | - var recList = store.getById(rec.get("id")); | ||
701 | - store.remove(recList); | 699 | + |
700 | + var recList = store.getById(rec.get("id")); | ||
701 | + store.remove(recList); | ||
702 | if (store.getCount() > 0) | 702 | if (store.getCount() > 0) |
703 | - { | ||
704 | - comboList.select(store.getAt(0)); | 703 | + { |
704 | + comboList.select(store.getAt(0)); | ||
705 | //fire select event | 705 | //fire select event |
706 | comboList.fireEvent('select', comboList, [store.getAt(0)]); | 706 | comboList.fireEvent('select', comboList, [store.getAt(0)]); |
707 | - } | 707 | + } |
708 | }); | 708 | }); |
709 | - | 709 | + |
710 | } | 710 | } |
711 | }, | 711 | }, |
712 | - | 712 | + |
713 | onSaveFilter : function(t) | 713 | onSaveFilter : function(t) |
714 | { | 714 | { |
715 | var filters = this.getFilterCombo().getStore().data.items; | 715 | var filters = this.getFilterCombo().getStore().data.items; |
716 | for (key in filters) { | 716 | for (key in filters) { |
717 | if (filters[key].get('name') === this.getFilterName()) { | 717 | if (filters[key].get('name') === this.getFilterName()) { |
718 | - Ext.Msg.show({ | ||
719 | - title:'Duplicated name', | ||
720 | - msg: 'This name is already used.<br/>Please choose an other one or remove the old filter.', | ||
721 | - icon: Ext.Msg.WARNING | ||
722 | - }); | 718 | + myDesktopApp.infoMsg('This name is already used.<br/>' + |
719 | + 'Please choose an other one or remove the old filter.'); | ||
723 | return null; | 720 | return null; |
724 | } | 721 | } |
725 | } | 722 | } |
726 | 723 | ||
727 | var rec = this.getCrtFilterRecord(); | 724 | var rec = this.getCrtFilterRecord(); |
728 | - | 725 | + |
729 | if (!rec) | 726 | if (!rec) |
730 | return; | 727 | return; |
731 | - | 728 | + |
732 | this.saveFilter(rec); | 729 | this.saveFilter(rec); |
733 | }, | 730 | }, |
734 | - | 731 | + |
735 | onApplyFilter : function(t) | 732 | onApplyFilter : function(t) |
736 | { | 733 | { |
737 | var me = this; | 734 | var me = this; |
@@ -748,27 +745,27 @@ Ext.define('amdaUI.FiltersUI', { | @@ -748,27 +745,27 @@ Ext.define('amdaUI.FiltersUI', { | ||
748 | ); | 745 | ); |
749 | return; | 746 | return; |
750 | } | 747 | } |
751 | - | 748 | + |
752 | this.requestApplyFilter(rec); | 749 | this.requestApplyFilter(rec); |
753 | }, | 750 | }, |
754 | - | 751 | + |
755 | requestApplyFilter : function(rec) | 752 | requestApplyFilter : function(rec) |
756 | { | 753 | { |
757 | - AmdaAction.setCrtFilterId({id : rec.get('id')}, | 754 | + AmdaAction.setCrtFilterId({id : rec.get('id')}, |
758 | function (result, e) | 755 | function (result, e) |
759 | { | 756 | { |
760 | var t = e.getTransaction(); | 757 | var t = e.getTransaction(); |
761 | - if (e.status) | ||
762 | - { | 758 | + if (e.status) |
759 | + { | ||
763 | if (result) | 760 | if (result) |
764 | { | 761 | { |
765 | myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id, true, function (module) { | 762 | myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id, true, function (module) { |
766 | - module.setCrtFilter(); | ||
767 | - }); | 763 | + module.setCrtFilter(); |
764 | + }); | ||
768 | } | 765 | } |
769 | else | 766 | else |
770 | Ext.Msg.show( { | 767 | Ext.Msg.show( { |
771 | - title : 'Filter', | 768 | + title : 'Filter', |
772 | msg : 'Cannot apply filter', | 769 | msg : 'Cannot apply filter', |
773 | modal : true, | 770 | modal : true, |
774 | icon : Ext.Msg.ERROR, | 771 | icon : Ext.Msg.ERROR, |
@@ -779,10 +776,10 @@ Ext.define('amdaUI.FiltersUI', { | @@ -779,10 +776,10 @@ Ext.define('amdaUI.FiltersUI', { | ||
779 | { | 776 | { |
780 | // FAILURE | 777 | // FAILURE |
781 | Ext.Msg.show({title:'Error System', msg: e.message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK}); | 778 | Ext.Msg.show({title:'Error System', msg: e.message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK}); |
782 | - } | 779 | + } |
783 | },this); | 780 | },this); |
784 | }, | 781 | }, |
785 | - | 782 | + |
786 | isDirty : function(filter) | 783 | isDirty : function(filter) |
787 | { | 784 | { |
788 | if (filter.dirty) | 785 | if (filter.dirty) |
@@ -798,7 +795,7 @@ Ext.define('amdaUI.FiltersUI', { | @@ -798,7 +795,7 @@ Ext.define('amdaUI.FiltersUI', { | ||
798 | ); | 795 | ); |
799 | return dirty; | 796 | return dirty; |
800 | }, | 797 | }, |
801 | - | 798 | + |
802 | getFilterCombo : function() | 799 | getFilterCombo : function() |
803 | { | 800 | { |
804 | var comboField = this.query('#filter_combo'); | 801 | var comboField = this.query('#filter_combo'); |
@@ -806,7 +803,7 @@ Ext.define('amdaUI.FiltersUI', { | @@ -806,7 +803,7 @@ Ext.define('amdaUI.FiltersUI', { | ||
806 | return null; | 803 | return null; |
807 | return comboField[0]; | 804 | return comboField[0]; |
808 | }, | 805 | }, |
809 | - | 806 | + |
810 | getNameField : function() | 807 | getNameField : function() |
811 | { | 808 | { |
812 | var nameField = this.query('#filter_name'); | 809 | var nameField = this.query('#filter_name'); |
@@ -814,11 +811,11 @@ Ext.define('amdaUI.FiltersUI', { | @@ -814,11 +811,11 @@ Ext.define('amdaUI.FiltersUI', { | ||
814 | return null; | 811 | return null; |
815 | return nameField[0]; | 812 | return nameField[0]; |
816 | }, | 813 | }, |
817 | - | 814 | + |
818 | saveFilter : function(rec,successfn) | 815 | saveFilter : function(rec,successfn) |
819 | { | 816 | { |
820 | var me = this; | 817 | var me = this; |
821 | - | 818 | + |
822 | var filterName = this.getFilterName(); | 819 | var filterName = this.getFilterName(); |
823 | if (!filterName) | 820 | if (!filterName) |
824 | return; | 821 | return; |
@@ -842,13 +839,13 @@ Ext.define('amdaUI.FiltersUI', { | @@ -842,13 +839,13 @@ Ext.define('amdaUI.FiltersUI', { | ||
842 | }); | 839 | }); |
843 | return; | 840 | return; |
844 | } | 841 | } |
845 | - | 842 | + |
846 | var msg; | 843 | var msg; |
847 | if (rec.get('id') == 0) | 844 | if (rec.get('id') == 0) |
848 | msg = 'The name of the default filter cannot be modified. Do you want to create a new instance of this filter?'; | 845 | msg = 'The name of the default filter cannot be modified. Do you want to create a new instance of this filter?'; |
849 | else | 846 | else |
850 | msg = 'Filter name has been changed. Do you want to create a new instance of this filter?'; | 847 | msg = 'Filter name has been changed. Do you want to create a new instance of this filter?'; |
851 | - | 848 | + |
852 | Ext.Msg.confirm('Filters', msg, | 849 | Ext.Msg.confirm('Filters', msg, |
853 | function(btn) { | 850 | function(btn) { |
854 | if (btn == 'yes') | 851 | if (btn == 'yes') |
@@ -861,33 +858,33 @@ Ext.define('amdaUI.FiltersUI', { | @@ -861,33 +858,33 @@ Ext.define('amdaUI.FiltersUI', { | ||
861 | conds[i] = cond.getJsonValues(); | 858 | conds[i] = cond.getJsonValues(); |
862 | }, | 859 | }, |
863 | this); | 860 | this); |
864 | - | 861 | + |
865 | //reload conditions of the current filter | 862 | //reload conditions of the current filter |
866 | amdaModel.FilterDef.load(rec.get('id'), | 863 | amdaModel.FilterDef.load(rec.get('id'), |
867 | { | 864 | { |
868 | scope : this, | 865 | scope : this, |
869 | - callback : function(r, operation) | 866 | + callback : function(r, operation) |
870 | { | 867 | { |
871 | //reset modifications on current record | 868 | //reset modifications on current record |
872 | rec.conditions().removeAll(); | 869 | rec.conditions().removeAll(); |
873 | rec.conditions().loadData(r.conditions().data.items); | 870 | rec.conditions().loadData(r.conditions().data.items); |
874 | //create the new filter | 871 | //create the new filter |
875 | var newRec = this.addFilter(filterName,conds,successfn); | 872 | var newRec = this.addFilter(filterName,conds,successfn); |
876 | - | 873 | + |
877 | } | 874 | } |
878 | - } | 875 | + } |
879 | ); | 876 | ); |
880 | return; | 877 | return; |
881 | - } | ||
882 | - | 878 | + } |
879 | + | ||
883 | if (rec.get('id') == 0) | 880 | if (rec.get('id') == 0) |
884 | { | 881 | { |
885 | filterName = rec.get('name'); //cannot change default filter name | 882 | filterName = rec.get('name'); //cannot change default filter name |
886 | this.setFilterName(filterName); | 883 | this.setFilterName(filterName); |
887 | } | 884 | } |
888 | - | 885 | + |
889 | //change the name of the filter | 886 | //change the name of the filter |
890 | - rec.set('name',filterName); | 887 | + rec.set('name',filterName); |
891 | //save modifications | 888 | //save modifications |
892 | rec.save({ | 889 | rec.save({ |
893 | success: function() { | 890 | success: function() { |
@@ -905,9 +902,9 @@ Ext.define('amdaUI.FiltersUI', { | @@ -905,9 +902,9 @@ Ext.define('amdaUI.FiltersUI', { | ||
905 | }); | 902 | }); |
906 | }, | 903 | }, |
907 | this | 904 | this |
908 | - ); | 905 | + ); |
909 | }, | 906 | }, |
910 | - | 907 | + |
911 | setFilterName : function(n) | 908 | setFilterName : function(n) |
912 | { | 909 | { |
913 | var nameField = this.getNameField(); | 910 | var nameField = this.getNameField(); |
@@ -915,13 +912,13 @@ Ext.define('amdaUI.FiltersUI', { | @@ -915,13 +912,13 @@ Ext.define('amdaUI.FiltersUI', { | ||
915 | return; | 912 | return; |
916 | nameField.setValue(n); | 913 | nameField.setValue(n); |
917 | }, | 914 | }, |
918 | - | 915 | + |
919 | getFilterName : function() | 916 | getFilterName : function() |
920 | { | 917 | { |
921 | var nameField = this.getNameField(); | 918 | var nameField = this.getNameField(); |
922 | return nameField.getValue(); | 919 | return nameField.getValue(); |
923 | }, | 920 | }, |
924 | - | 921 | + |
925 | getCrtFilterRecord : function() | 922 | getCrtFilterRecord : function() |
926 | { | 923 | { |
927 | var combo = this.getFilterCombo(); | 924 | var combo = this.getFilterCombo(); |
@@ -929,14 +926,14 @@ Ext.define('amdaUI.FiltersUI', { | @@ -929,14 +926,14 @@ Ext.define('amdaUI.FiltersUI', { | ||
929 | return null; | 926 | return null; |
930 | return combo.store.getById(combo.getValue()); | 927 | return combo.store.getById(combo.getValue()); |
931 | }, | 928 | }, |
932 | - | 929 | + |
933 | setCrtFilter : function() | 930 | setCrtFilter : function() |
934 | - { | 931 | + { |
935 | AmdaAction.getCrtFilterId(function (result, e) | 932 | AmdaAction.getCrtFilterId(function (result, e) |
936 | { | 933 | { |
937 | var t = e.getTransaction(); | 934 | var t = e.getTransaction(); |
938 | - if (e.status) | ||
939 | - { | 935 | + if (e.status) |
936 | + { | ||
940 | if (result) | 937 | if (result) |
941 | { | 938 | { |
942 | var crtId = result; | 939 | var crtId = result; |
@@ -960,17 +957,17 @@ Ext.define('amdaUI.FiltersUI', { | @@ -960,17 +957,17 @@ Ext.define('amdaUI.FiltersUI', { | ||
960 | { | 957 | { |
961 | // FAILURE | 958 | // FAILURE |
962 | Ext.Msg.show({title:'Error System', msg: e.message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK}); | 959 | Ext.Msg.show({title:'Error System', msg: e.message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK}); |
963 | - } | 960 | + } |
964 | },this); | 961 | },this); |
965 | }, | 962 | }, |
966 | - | 963 | + |
967 | createFilterStore : function() | 964 | createFilterStore : function() |
968 | { | 965 | { |
969 | return Ext.create('Ext.data.Store', | 966 | return Ext.create('Ext.data.Store', |
970 | { | 967 | { |
971 | model: 'amdaModel.FilterDef', | 968 | model: 'amdaModel.FilterDef', |
972 | autoLoad : true, | 969 | autoLoad : true, |
973 | - listeners : | 970 | + listeners : |
974 | { | 971 | { |
975 | 'load' : function(store, records, successful) | 972 | 'load' : function(store, records, successful) |
976 | { | 973 | { |
@@ -987,10 +984,10 @@ Ext.define('amdaUI.FiltersUI', { | @@ -987,10 +984,10 @@ Ext.define('amdaUI.FiltersUI', { | ||
987 | }, | 984 | }, |
988 | scope : this | 985 | scope : this |
989 | } | 986 | } |
990 | - | 987 | + |
991 | }); | 988 | }); |
992 | }, | 989 | }, |
993 | - | 990 | + |
994 | reloadFilter : function() | 991 | reloadFilter : function() |
995 | { | 992 | { |
996 | var combo = this.getFilterCombo(); | 993 | var combo = this.getFilterCombo(); |
@@ -998,7 +995,7 @@ Ext.define('amdaUI.FiltersUI', { | @@ -998,7 +995,7 @@ Ext.define('amdaUI.FiltersUI', { | ||
998 | return; | 995 | return; |
999 | combo.getStore().reload(); | 996 | combo.getStore().reload(); |
1000 | }, | 997 | }, |
1001 | - | 998 | + |
1002 | createToolBar : function() | 999 | createToolBar : function() |
1003 | { | 1000 | { |
1004 | var me = this; | 1001 | var me = this; |
@@ -1041,10 +1038,10 @@ Ext.define('amdaUI.FiltersUI', { | @@ -1041,10 +1038,10 @@ Ext.define('amdaUI.FiltersUI', { | ||
1041 | 'beforeselect' : this.onBeforeSelect | 1038 | 'beforeselect' : this.onBeforeSelect |
1042 | } | 1039 | } |
1043 | } | 1040 | } |
1044 | - | 1041 | + |
1045 | ]; | 1042 | ]; |
1046 | }, | 1043 | }, |
1047 | - | 1044 | + |
1048 | createInfoPanel : function() | 1045 | createInfoPanel : function() |
1049 | { | 1046 | { |
1050 | var me = this; | 1047 | var me = this; |
@@ -1080,21 +1077,21 @@ Ext.define('amdaUI.FiltersUI', { | @@ -1080,21 +1077,21 @@ Ext.define('amdaUI.FiltersUI', { | ||
1080 | ] | 1077 | ] |
1081 | }; | 1078 | }; |
1082 | }, | 1079 | }, |
1083 | - | 1080 | + |
1084 | createGridPanel : function() | 1081 | createGridPanel : function() |
1085 | { | 1082 | { |
1086 | this.grid = Ext.create('amdaUI.FilterGridPanel',{}); | 1083 | this.grid = Ext.create('amdaUI.FilterGridPanel',{}); |
1087 | return this.grid; | 1084 | return this.grid; |
1088 | }, | 1085 | }, |
1089 | - | ||
1090 | - init : function(config) | 1086 | + |
1087 | + init : function(config) | ||
1091 | { | 1088 | { |
1092 | var me = this; | 1089 | var me = this; |
1093 | - | 1090 | + |
1094 | var myConf = { | 1091 | var myConf = { |
1095 | layout: 'border', | 1092 | layout: 'border', |
1096 | tbar : this.createToolBar(), | 1093 | tbar : this.createToolBar(), |
1097 | - items: [ | 1094 | + items: [ |
1098 | { | 1095 | { |
1099 | xtype : 'panel', | 1096 | xtype : 'panel', |
1100 | region: 'center', | 1097 | region: 'center', |
@@ -1107,10 +1104,10 @@ Ext.define('amdaUI.FiltersUI', { | @@ -1107,10 +1104,10 @@ Ext.define('amdaUI.FiltersUI', { | ||
1107 | items : [ | 1104 | items : [ |
1108 | this.createInfoPanel(), | 1105 | this.createInfoPanel(), |
1109 | this.createGridPanel() | 1106 | this.createGridPanel() |
1110 | - ] | 1107 | + ] |
1111 | }, | 1108 | }, |
1112 | { | 1109 | { |
1113 | - xtype: 'panel', | 1110 | + xtype: 'panel', |
1114 | region: 'south', | 1111 | region: 'south', |
1115 | title: 'Information', | 1112 | title: 'Information', |
1116 | collapsible: true, | 1113 | collapsible: true, |
@@ -1121,12 +1118,12 @@ Ext.define('amdaUI.FiltersUI', { | @@ -1121,12 +1118,12 @@ Ext.define('amdaUI.FiltersUI', { | ||
1121 | loader: { | 1118 | loader: { |
1122 | autoLoad: true, | 1119 | autoLoad: true, |
1123 | url: helpDir+'filterHOWTO' | 1120 | url: helpDir+'filterHOWTO' |
1124 | - } | 1121 | + } |
1125 | } | 1122 | } |
1126 | ] | 1123 | ] |
1127 | }; | 1124 | }; |
1128 | Ext.apply (me , Ext.apply (arguments, myConf)); | 1125 | Ext.apply (me , Ext.apply (arguments, myConf)); |
1129 | - | 1126 | + |
1130 | this.filtersInfoStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterInfo'}); | 1127 | this.filtersInfoStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterInfo'}); |
1131 | this.filtersListStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterSelectList'}); | 1128 | this.filtersListStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterSelectList'}); |
1132 | 1129 | ||
@@ -1138,7 +1135,7 @@ Ext.define('amdaUI.FiltersUI', { | @@ -1138,7 +1135,7 @@ Ext.define('amdaUI.FiltersUI', { | ||
1138 | this.filtersListStore.load({ | 1135 | this.filtersListStore.load({ |
1139 | scope : me, | 1136 | scope : me, |
1140 | callback: function(records, operation, success) | 1137 | callback: function(records, operation, success) |
1141 | - { | 1138 | + { |
1142 | me.grid.setFiltersListStore(this.filtersListStore); | 1139 | me.grid.setFiltersListStore(this.filtersListStore); |
1143 | } | 1140 | } |
1144 | }); | 1141 | }); |
php/RemoteDataCenter/getRemoteDDBaseProxies.php
@@ -45,19 +45,27 @@ | @@ -45,19 +45,27 @@ | ||
45 | exit("No Bases.xml file at DDBase/INFO ? IMPEX only".PHP_EOL); | 45 | exit("No Bases.xml file at DDBase/INFO ? IMPEX only".PHP_EOL); |
46 | 46 | ||
47 | $basesRemote = $basesDomRemote->getElementsByTagName("dataCenter"); | 47 | $basesRemote = $basesDomRemote->getElementsByTagName("dataCenter"); |
48 | - | 48 | + echo INFOSITE.PHP_EOL; |
49 | foreach ($basesRemote as $baseRemote) { | 49 | foreach ($basesRemote as $baseRemote) { |
50 | $baseId = $baseRemote->getAttribute("xml:id"); | 50 | $baseId = $baseRemote->getAttribute("xml:id"); |
51 | + | ||
51 | // add remote base if it doesn't exist | 52 | // add remote base if it doesn't exist |
52 | if (!$basesDom->getElementById($baseId)) { | 53 | if (!$basesDom->getElementById($baseId)) { |
53 | - $baseClone = $basesDom->importNode($baseRemote); | ||
54 | - $basesDom->documentElement->appendChild($baseClone); | ||
55 | $baseDir = DATAPATH."/RemoteData/$baseId"; | 54 | $baseDir = DATAPATH."/RemoteData/$baseId"; |
56 | $baseDirRemote = INFOSITE."INFO/bases/$baseId"; | 55 | $baseDirRemote = INFOSITE."INFO/bases/$baseId"; |
57 | if (!is_dir($baseDir)) mkdir($baseDir); | 56 | if (!is_dir($baseDir)) mkdir($baseDir); |
58 | - | ||
59 | - if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml")) | ||
60 | - echo "Cannot copy base.xml for $baseId".PHP_EOL; | 57 | + if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml")) { |
58 | + echo "Cannot copy base.xml for $baseId".PHP_EOL; | ||
59 | + } | ||
60 | + else { | ||
61 | + $baseClone = $basesDom->importNode($baseRemote); | ||
62 | + $basesDom->documentElement->appendChild($baseClone); | ||
63 | + echo "Added $baseId".PHP_EOL; | ||
64 | + if ($baseId == "THEMIS") { | ||
65 | + $center = new THEMIS(); | ||
66 | + $center->makeAllParams(); | ||
67 | + } | ||
68 | + } | ||
61 | } | 69 | } |
62 | } | 70 | } |
63 | } | 71 | } |
php/RemoteDataCenter/makeRemoteParamInternal.php deleted
@@ -1,20 +0,0 @@ | @@ -1,20 +0,0 @@ | ||
1 | -<?php | ||
2 | -/* | ||
3 | -* Executable to make | ||
4 | -*/ | ||
5 | - | ||
6 | - if (!function_exists('__autoload')) { | ||
7 | - function __autoload($class_name) { | ||
8 | - require_once $class_name . '.php'; | ||
9 | - } | ||
10 | - } | ||
11 | - | ||
12 | - $AMDA_IHM = getenv('AMDA_IHM'); | ||
13 | - | ||
14 | - require_once $AMDA_IHM."/php/config.php"; | ||
15 | - | ||
16 | - $center = new THEMIS(); | ||
17 | - | ||
18 | - $center->makeAllParams(); | ||
19 | - | ||
20 | -?> | ||
21 | \ No newline at end of file | 0 | \ No newline at end of file |
php/classes/AmdaAction.php
@@ -2,10 +2,8 @@ | @@ -2,10 +2,8 @@ | ||
2 | /** | 2 | /** |
3 | * @class AmdaAction | 3 | * @class AmdaAction |
4 | * @version $Id: AmdaAction.php 2976 2015-07-01 15:05:40Z benjamin $ | 4 | * @version $Id: AmdaAction.php 2976 2015-07-01 15:05:40Z benjamin $ |
5 | - * | 5 | + * @brief |
6 | */ | 6 | */ |
7 | - | ||
8 | - | ||
9 | class AmdaAction | 7 | class AmdaAction |
10 | { | 8 | { |
11 | private $xmlFiles = array('localParam' => 'LocalParams.xml', 'remoteParam' => 'RemoteParams.xml', | 9 | private $xmlFiles = array('localParam' => 'LocalParams.xml', 'remoteParam' => 'RemoteParams.xml', |
@@ -483,14 +481,7 @@ class AmdaAction | @@ -483,14 +481,7 @@ class AmdaAction | ||
483 | else | 481 | else |
484 | { | 482 | { |
485 | $restricted = FALSE; | 483 | $restricted = FALSE; |
486 | -// if ($child->tagName == 'dataCenter') | ||
487 | -// { | ||
488 | -// $restricted = ($child->getAttribute('available') != "1"); | ||
489 | -// } | ||
490 | -// | ||
491 | - if ($id == 'CDAWEB' || $id == 'THEMIS'|| $id == 'MAPSKP') | ||
492 | - $restricted = FALSE; | ||
493 | - | 484 | + |
494 | if ($child->tagName == 'dataset') | 485 | if ($child->tagName == 'dataset') |
495 | { | 486 | { |
496 | $nonavailable = ($child->getAttribute('disabled')); | 487 | $nonavailable = ($child->getAttribute('disabled')); |
@@ -683,8 +674,7 @@ class AmdaAction | @@ -683,8 +674,7 @@ class AmdaAction | ||
683 | case 'request' : | 674 | case 'request' : |
684 | $objectMgr = new RequestMgr($nodeType); | 675 | $objectMgr = new RequestMgr($nodeType); |
685 | break; | 676 | break; |
686 | - case 'bkgWorks' : | ||
687 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | 677 | + case 'bkgWorks' : |
688 | return $this->executeRequest($id, FunctionTypeEnumClass::PROCESSGETINFO); | 678 | return $this->executeRequest($id, FunctionTypeEnumClass::PROCESSGETINFO); |
689 | break; | 679 | break; |
690 | case 'myData' : | 680 | case 'myData' : |
@@ -722,7 +712,6 @@ class AmdaAction | @@ -722,7 +712,6 @@ class AmdaAction | ||
722 | $obj->id = substr($obj->id,strlen('alias_')); | 712 | $obj->id = substr($obj->id,strlen('alias_')); |
723 | break; | 713 | break; |
724 | case 'bkgWorks' : | 714 | case 'bkgWorks' : |
725 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
726 | return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSDELETE); | 715 | return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSDELETE); |
727 | 716 | ||
728 | case 'myData' : | 717 | case 'myData' : |
@@ -857,8 +846,7 @@ class AmdaAction | @@ -857,8 +846,7 @@ class AmdaAction | ||
857 | */ | 846 | */ |
858 | public function getJobs() | 847 | public function getJobs() |
859 | { | 848 | { |
860 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
861 | - $obj = (object) array(); | 849 | + $obj = (object) array(); |
862 | return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO); | 850 | return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO); |
863 | } | 851 | } |
864 | 852 | ||
@@ -906,7 +894,7 @@ class AmdaAction | @@ -906,7 +894,7 @@ class AmdaAction | ||
906 | } | 894 | } |
907 | 895 | ||
908 | private function executeRequest($obj, $function) | 896 | private function executeRequest($obj, $function) |
909 | - { | 897 | + { |
910 | // Check user if access to DD Server and / or possible 'space consuming' action | 898 | // Check user if access to DD Server and / or possible 'space consuming' action |
911 | if ( $function == FunctionTypeEnumClass::PARAMS || | 899 | if ( $function == FunctionTypeEnumClass::PARAMS || |
912 | $function == FunctionTypeEnumClass::ACTION || | 900 | $function == FunctionTypeEnumClass::ACTION || |
@@ -917,7 +905,6 @@ class AmdaAction | @@ -917,7 +905,6 @@ class AmdaAction | ||
917 | } | 905 | } |
918 | 906 | ||
919 | $requestManager = new RequestManagerClass(); | 907 | $requestManager = new RequestManagerClass(); |
920 | - | ||
921 | try { | 908 | try { |
922 | $res = $requestManager->runIHMRequest($this->user, !empty($res['userHost']) ? $res['userHost'] : NULL, $function, $obj); | 909 | $res = $requestManager->runIHMRequest($this->user, !empty($res['userHost']) ? $res['userHost'] : NULL, $function, $obj); |
923 | } catch (Exception $e) { | 910 | } catch (Exception $e) { |
@@ -932,8 +919,6 @@ class AmdaAction | @@ -932,8 +919,6 @@ class AmdaAction | ||
932 | */ | 919 | */ |
933 | public function execute($node, $obj) | 920 | public function execute($node, $obj) |
934 | { | 921 | { |
935 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
936 | - | ||
937 | // just convert TT / Catalog | 922 | // just convert TT / Catalog |
938 | if ($obj->nodeType == "download" && $obj->downloadSrc == "1") | 923 | if ($obj->nodeType == "download" && $obj->downloadSrc == "1") |
939 | return $this->executeRequest($obj, FunctionTypeEnumClass::TTCONVERT); | 924 | return $this->executeRequest($obj, FunctionTypeEnumClass::TTCONVERT); |
@@ -953,7 +938,6 @@ class AmdaAction | @@ -953,7 +938,6 @@ class AmdaAction | ||
953 | */ | 938 | */ |
954 | public function compilParam($obj) | 939 | public function compilParam($obj) |
955 | { | 940 | { |
956 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
957 | return $this->executeRequest($obj, FunctionTypeEnumClass::PARAMSGEN); | 941 | return $this->executeRequest($obj, FunctionTypeEnumClass::PARAMSGEN); |
958 | } | 942 | } |
959 | 943 | ||
@@ -962,7 +946,6 @@ class AmdaAction | @@ -962,7 +946,6 @@ class AmdaAction | ||
962 | */ | 946 | */ |
963 | public function compilParamDelete($obj) | 947 | public function compilParamDelete($obj) |
964 | { | 948 | { |
965 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
966 | $res = $this->checkUser($obj); | 949 | $res = $this->checkUser($obj); |
967 | 950 | ||
968 | if (!$res['success']) | 951 | if (!$res['success']) |
@@ -981,7 +964,6 @@ class AmdaAction | @@ -981,7 +964,6 @@ class AmdaAction | ||
981 | 964 | ||
982 | public function killPlotRequest() | 965 | public function killPlotRequest() |
983 | { | 966 | { |
984 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
985 | return $this->executeRequest((object) array('nodeType' => 'killplot'), FunctionTypeEnumClass::PARAMS); | 967 | return $this->executeRequest((object) array('nodeType' => 'killplot'), FunctionTypeEnumClass::PARAMS); |
986 | } | 968 | } |
987 | 969 | ||
@@ -1323,7 +1305,6 @@ class AmdaAction | @@ -1323,7 +1305,6 @@ class AmdaAction | ||
1323 | public function cleanUserWS() | 1305 | public function cleanUserWS() |
1324 | { | 1306 | { |
1325 | $this->rrmdir(USERDIR.'DOWNLOAD.TEMP'); | 1307 | $this->rrmdir(USERDIR.'DOWNLOAD.TEMP'); |
1326 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
1327 | IHMConfigClass::setUserName($this->user); | 1308 | IHMConfigClass::setUserName($this->user); |
1328 | 1309 | ||
1329 | // delete impex params and data | 1310 | // delete impex params and data |
@@ -1359,7 +1340,6 @@ class AmdaAction | @@ -1359,7 +1340,6 @@ class AmdaAction | ||
1359 | 1340 | ||
1360 | public function interactivePlot($obj, $multiPlotState) | 1341 | public function interactivePlot($obj, $multiPlotState) |
1361 | { | 1342 | { |
1362 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
1363 | $inputobj = (Object)array( | 1343 | $inputobj = (Object)array( |
1364 | 'action' => $obj, | 1344 | 'action' => $obj, |
1365 | 'multiPlotState' => $multiPlotState | 1345 | 'multiPlotState' => $multiPlotState |
@@ -1369,7 +1349,6 @@ class AmdaAction | @@ -1369,7 +1349,6 @@ class AmdaAction | ||
1369 | 1349 | ||
1370 | public function getParamPlotInit($obj) | 1350 | public function getParamPlotInit($obj) |
1371 | { | 1351 | { |
1372 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
1373 | // IMPEX param | 1352 | // IMPEX param |
1374 | if (preg_match("#^spase___IMPEX_#",$obj->paramId)) | 1353 | if (preg_match("#^spase___IMPEX_#",$obj->paramId)) |
1375 | $type = 'impex_plot_init'; | 1354 | $type = 'impex_plot_init'; |
@@ -1385,7 +1364,6 @@ class AmdaAction | @@ -1385,7 +1364,6 @@ class AmdaAction | ||
1385 | 1364 | ||
1386 | public function getParamInfo($obj) | 1365 | public function getParamInfo($obj) |
1387 | { | 1366 | { |
1388 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
1389 | // IMPEX param | 1367 | // IMPEX param |
1390 | if (preg_match("#^spase___IMPEX_#",$obj->paramId)) | 1368 | if (preg_match("#^spase___IMPEX_#",$obj->paramId)) |
1391 | $type = 'impex_param_info'; | 1369 | $type = 'impex_param_info'; |
@@ -1437,8 +1415,6 @@ class AmdaAction | @@ -1437,8 +1415,6 @@ class AmdaAction | ||
1437 | 1415 | ||
1438 | public function getRequestByProcessId($obj) | 1416 | public function getRequestByProcessId($obj) |
1439 | { | 1417 | { |
1440 | - require_once(INTEGRATION_SRC_DIR."RequestManager.php"); | ||
1441 | - | ||
1442 | return $this->executeRequest($obj->processId, FunctionTypeEnumClass::PROCESSGETREQUEST); | 1418 | return $this->executeRequest($obj->processId, FunctionTypeEnumClass::PROCESSGETREQUEST); |
1443 | } | 1419 | } |
1444 | } | 1420 | } |
php/classes/TimeTableMgr.php
@@ -162,25 +162,28 @@ class TimeTableMgr extends AmdaObjectMgr | @@ -162,25 +162,28 @@ class TimeTableMgr extends AmdaObjectMgr | ||
162 | $description="Uploaded Time Table".PHP_EOL; | 162 | $description="Uploaded Time Table".PHP_EOL; |
163 | 163 | ||
164 | foreach ($lines as $line){ | 164 | foreach ($lines as $line){ |
165 | - if ($line[0] == '#') $description=$description."\n".substr($line,1,-1); | 165 | + if ($line[0] == '#') $description=$description.PHP_EOL.substr($line,1,-1); |
166 | else { | 166 | else { |
167 | - $date = explode(' ',$line); | 167 | + $date = explode(' ', preg_replace('!\s+!', ' ', $line)); |
168 | if (!strtotime(trim($date[0]))) { | 168 | if (!strtotime(trim($date[0]))) { |
169 | - $description=$description."\n".$line; | 169 | + $description=$description.PHP_EOL.$line; |
170 | continue; | 170 | continue; |
171 | } | 171 | } |
172 | // check if it is ISO format | 172 | // check if it is ISO format |
173 | if (!isset($isIso)) $isIso = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/', trim($date[0])); | 173 | if (!isset($isIso)) $isIso = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/', trim($date[0])); |
174 | if (!$isIso) { | 174 | if (!$isIso) { |
175 | - $tempT = strtotime(trim($date[0])); | ||
176 | - $startDate = date('Y-m-d',$tempT)."T".date('H:i:s',$tempT); | ||
177 | - $tempT = strtotime(trim($date[1])); | ||
178 | - $stopDate = date('Y-m-d',$tempT)."T".date('H:i:s',$tempT); | ||
179 | - //TODO convert time into non standard formats | ||
180 | - // $startDate = DateTime::createFromFormat($timeFormat, trim($date[0]); | ||
181 | - // $start = $startDate->format('Y-m-d')."T".$startDate->format('H:i:s'); | ||
182 | - // $stopDate = DateTime::createFromFormat($timeFormat, trim($date[1]); | ||
183 | - // $stop = $stopDate->format('Y-m-d')."T".$stopDate->format('H:i:s'); | 175 | + if (count($date) == 2) { |
176 | + $tempStartT = strtotime(trim($date[0])); | ||
177 | + $tempStopT = strtotime(trim($date[1])); | ||
178 | + } | ||
179 | + else { // y-m-d h:m:s for example | ||
180 | + $tempStartT = strtotime($date[0]." ".$date[1]); | ||
181 | + $tempStopT = strtotime($date[2]." ".$date[3]); | ||
182 | + } | ||
183 | + | ||
184 | + $startDate = date('Y-m-d\TH:i:s',$tempStartT); | ||
185 | + $stopDate = date('Y-m-d\TH:i:s',$tempStopT); | ||
186 | + | ||
184 | if (!$onlyDescription) | 187 | if (!$onlyDescription) |
185 | $attributesToReturn['intervals'][] = array('start' => $startDate, 'stop' => $stopDate); | 188 | $attributesToReturn['intervals'][] = array('start' => $startDate, 'stop' => $stopDate); |
186 | } | 189 | } |
@@ -193,7 +196,7 @@ class TimeTableMgr extends AmdaObjectMgr | @@ -193,7 +196,7 @@ class TimeTableMgr extends AmdaObjectMgr | ||
193 | 196 | ||
194 | $attributesToReturn['description'] = $description; | 197 | $attributesToReturn['description'] = $description; |
195 | $attributesToReturn['name'] = basename($tmp_file, '.'.$suffix[1]); | 198 | $attributesToReturn['name'] = basename($tmp_file, '.'.$suffix[1]); |
196 | - $attributesToReturn['created'] = date('Y-m-d')."T".date('H:i:s'); | 199 | + $attributesToReturn['created'] = date('Y-m-d\TH:i:s'); |
197 | 200 | ||
198 | return $attributesToReturn; | 201 | return $attributesToReturn; |
199 | } | 202 | } |
php/config.php
@@ -2,49 +2,31 @@ | @@ -2,49 +2,31 @@ | ||
2 | /** | 2 | /** |
3 | * @file config.php | 3 | * @file config.php |
4 | * @version $Id: config.php 2368 2014-05-21 08:46:23Z elena $ | 4 | * @version $Id: config.php 2368 2014-05-21 08:46:23Z elena $ |
5 | - * | ||
6 | */ | 5 | */ |
7 | 6 | ||
8 | /* | 7 | /* |
9 | - * ob_start | ||
10 | - * This function will turn output buffering on. | ||
11 | - * While output buffering is active no output is sent from the script (other than headers), | ||
12 | - * instead the output is stored in an internal buffer. | ||
13 | - * The contents of this internal buffer may be copied into a string variable using ob_get_contents(). | ||
14 | - * To output what is stored in the internal buffer, use ob_end_flush(). | ||
15 | - * Alternatively, ob_end_clean() will silently discard the buffer contents. | ||
16 | -*/ | ||
17 | -// ob_start(); | ||
18 | - | ||
19 | -/* | ||
20 | * Installation-dependent settings | 8 | * Installation-dependent settings |
21 | */ | 9 | */ |
22 | require_once 'my_config.php'; | 10 | require_once 'my_config.php'; |
23 | 11 | ||
24 | -if (is_file('amda_version.php')) | ||
25 | - require_once 'amda_version.php'; | 12 | +error_reporting(E_ERROR); |
26 | 13 | ||
27 | -if (is_file('errors.php')) | ||
28 | - require_once 'errors.php'; | 14 | +if (is_file('amda_version.php')) require_once 'amda_version.php'; |
15 | +if (is_file('errors.php')) require_once 'errors.php'; | ||
29 | 16 | ||
30 | -/*----------------------- SYSTEM config section --------*/ | ||
31 | -if (!defined('PHP_VERSION_ID')) | ||
32 | -{ | 17 | +// SYSTEM config section |
18 | +if (!defined('PHP_VERSION_ID')) { | ||
33 | $version = explode('.', PHP_VERSION); | 19 | $version = explode('.', PHP_VERSION); |
34 | define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); | 20 | define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); |
35 | } | 21 | } |
36 | - | ||
37 | -if (!defined('MAGIC_FILE')) | ||
38 | - define('MAGIC_FILE','/usr/share/misc/magic'); | ||
39 | - | 22 | +if (!defined('MAGIC_FILE')) define('MAGIC_FILE','/usr/share/misc/magic'); |
40 | date_default_timezone_set('UTC'); | 23 | date_default_timezone_set('UTC'); |
41 | -/*-----------------------END SYSTEM config section --------*/ | ||
42 | 24 | ||
43 | -/*----------------------- GUESTS LOGIN section --------*/ | ||
44 | -define("MaxGuests", 10); // Max Guests number | 25 | +// GUESTS LOGIN section |
26 | +define("MaxGuests", 10); // Max Guests number | ||
45 | define("GuestSessionDuration", 300); //300 minutes | 27 | define("GuestSessionDuration", 300); //300 minutes |
46 | -define("MaxGuestTimeInterval", 10); // days | ||
47 | -/*-----------------------END GUESTS LOGIN section --------*/ | 28 | +define("MaxGuestTimeInterval", 10); // days |
29 | + | ||
48 | 30 | ||
49 | // user WS size limit | 31 | // user WS size limit |
50 | define('DISK_QUOTA_standard', 1024*1024*200); // 200MB | 32 | define('DISK_QUOTA_standard', 1024*1024*200); // 200MB |
@@ -53,21 +35,18 @@ define('MAX_FILE_INDEX_TO_SHOW', 100); | @@ -53,21 +35,18 @@ define('MAX_FILE_INDEX_TO_SHOW', 100); | ||
53 | // private key used to be considerate as a trust client for some functions of DD web service | 35 | // private key used to be considerate as a trust client for some functions of DD web service |
54 | define('DDSERVICE_PRIVATEKEY','!%p856Dc'); | 36 | define('DDSERVICE_PRIVATEKEY','!%p856Dc'); |
55 | 37 | ||
56 | -define('IMPEX_INTERVAL_LIMIT', 86400); // one day for impex request | ||
57 | 38 | ||
58 | -/*----------------------- BATCH JOBS section --------*/ | ||
59 | -define('JOBTIMEOUT', '1'); // one cycle secs to sleep to allow job be executed | ||
60 | -define('PLOT_CYCLES_NUMBER', 500); // cycles number for PNG | ||
61 | -define('JOB_CYCLES_NUMBER', 5); // cycles number for all the jobs | 39 | +// BATCH JOBS section |
40 | +//define('JOBTIMEOUT', '1'); // one cycle secs to sleep to allow job be executed | ||
41 | +//define('PLOT_CYCLES_NUMBER', 500); // cycles number for PNG | ||
42 | +//define('JOB_CYCLES_NUMBER', 5); // cycles number for all the jobs | ||
62 | //define('TIMEOUT', '100'); //TODO secs wait before job is killed OR 'max_execution_time' - kill automatic? | 43 | //define('TIMEOUT', '100'); //TODO secs wait before job is killed OR 'max_execution_time' - kill automatic? |
63 | 44 | ||
64 | -/*-----------------------END BATCH JOBS section --------*/ | ||
65 | - | ||
66 | // EPN-TAP services | 45 | // EPN-TAP services |
67 | define('EPNTAP_APIS','http://voparis-tap.obspm.fr/__system__/tap/run/tap/sync'); | 46 | define('EPNTAP_APIS','http://voparis-tap.obspm.fr/__system__/tap/run/tap/sync'); |
68 | define('EPNTAP_AMDA','http://cdpp-epntap.irap.omp.eu/__system__/tap/run/tap/sync'); | 47 | define('EPNTAP_AMDA','http://cdpp-epntap.irap.omp.eu/__system__/tap/run/tap/sync'); |
69 | 48 | ||
70 | -/*----------------------- PHP run-time settings --------*/ | 49 | +// PHP run-time settings |
71 | ini_set('memory_limit',128000000); | 50 | ini_set('memory_limit',128000000); |
72 | ini_set('max_execution_time',600); // max PHP execution | 51 | ini_set('max_execution_time',600); // max PHP execution |
73 | ini_set('default_socket_timeout', 600); //TODO if this is needed ? IMPEX LONG DURATION WEBSERVICES | 52 | ini_set('default_socket_timeout', 600); //TODO if this is needed ? IMPEX LONG DURATION WEBSERVICES |
@@ -77,7 +56,6 @@ ini_set('user_agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:7.0) Gecko/201 | @@ -77,7 +56,6 @@ ini_set('user_agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:7.0) Gecko/201 | ||
77 | // ini_set('upload_max_filesize',100000000); | 56 | // ini_set('upload_max_filesize',100000000); |
78 | // ini_set('post_max_size',1050000000); | 57 | // ini_set('post_max_size',1050000000); |
79 | 58 | ||
80 | -/*-----------------------END PHP run-time settings --------*/ | ||
81 | 59 | ||
82 | // General Info dirs | 60 | // General Info dirs |
83 | define('DATAPATH', IHM_SRC_DIR.'generic_data/'); | 61 | define('DATAPATH', IHM_SRC_DIR.'generic_data/'); |
@@ -97,10 +75,11 @@ define('specialGrpsXml',SpecialSettingsDir.'Groups.xml'); | @@ -97,10 +75,11 @@ define('specialGrpsXml',SpecialSettingsDir.'Groups.xml'); | ||
97 | define('specialSettingsXml',SpecialSettingsDir.'Settings.xml'); | 75 | define('specialSettingsXml',SpecialSettingsDir.'Settings.xml'); |
98 | 76 | ||
99 | //Help info dirs | 77 | //Help info dirs |
100 | -define('HELPPATH', IHM_SRC_DIR."help/"); | 78 | +define('HELPPATH', IHM_SRC_DIR."help/"); |
101 | 79 | ||
102 | -// IMPEX special files | 80 | +// IMPEX section |
103 | define('SimuTargetsXml', DATAPATH.'SimuTemplate/TargetsSimu.xml'); | 81 | define('SimuTargetsXml', DATAPATH.'SimuTemplate/TargetsSimu.xml'); |
82 | +define('IMPEX_INTERVAL_LIMIT', 86400); // one day for impex request | ||
104 | 83 | ||
105 | // Root User dir : All user dirs are defined in UserMgr.php | 84 | // Root User dir : All user dirs are defined in UserMgr.php |
106 | define('USERPATH', IHM_SRC_DIR.'data/'); | 85 | define('USERPATH', IHM_SRC_DIR.'data/'); |
@@ -108,18 +87,15 @@ define('USERPATH', IHM_SRC_DIR.'data/'); | @@ -108,18 +87,15 @@ define('USERPATH', IHM_SRC_DIR.'data/'); | ||
108 | // Shared dir | 87 | // Shared dir |
109 | define('SHAREDPATH', IHM_SRC_DIR.'shared_data/'); | 88 | define('SHAREDPATH', IHM_SRC_DIR.'shared_data/'); |
110 | 89 | ||
111 | -/*------------------- WEB SERVICES section ---------*/ | 90 | +// WEB SERVICES section |
112 | define('WSRESULT', USERPATH.'WSRESULT/'); // Web Services result directory | 91 | define('WSRESULT', USERPATH.'WSRESULT/'); // Web Services result directory |
113 | define('wsResultsXml',WSRESULT.'WSresults.xml'); // Web Service result file | 92 | define('wsResultsXml',WSRESULT.'WSresults.xml'); // Web Service result file |
114 | - | ||
115 | define('plotsXml', IHM_SRC_DIR.'public/WebServices/XML/AmdaPlots.xml'); // Web Service getPlot : list of parameters to plot | 93 | define('plotsXml', IHM_SRC_DIR.'public/WebServices/XML/AmdaPlots.xml'); // Web Service getPlot : list of parameters to plot |
116 | 94 | ||
117 | // Web Service servers WSDL : $_SERVER['SERVER_NAME'] (par apache) gethostname() (par command) | 95 | // Web Service servers WSDL : $_SERVER['SERVER_NAME'] (par apache) gethostname() (par command) |
118 | $SERVER_NAME = $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : gethostname(); | 96 | $SERVER_NAME = $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : gethostname(); |
119 | - | ||
120 | define('webAlias',"http://".$SERVER_NAME.APACHE_ALIAS); | 97 | define('webAlias',"http://".$SERVER_NAME.APACHE_ALIAS); |
121 | define('wsdl_AMDA', webAlias."public/wsdl/Methods_AMDA.wsdl"); | 98 | define('wsdl_AMDA', webAlias."public/wsdl/Methods_AMDA.wsdl"); |
122 | -/*-------------------END WEB SERVICES section ---------*/ | ||
123 | 99 | ||
124 | // AKKA - KERNELBIN is now the new kernel bin dir | 100 | // AKKA - KERNELBIN is now the new kernel bin dir |
125 | define('KERNELBIN',NEWKERNEL_INSTALL_DIR.'bin/'); | 101 | define('KERNELBIN',NEWKERNEL_INSTALL_DIR.'bin/'); |
@@ -128,21 +104,9 @@ putenv("LD_LIBRARY_PATH=".SYS_LIBS.":".DDLIB.":".CEFLIB.":".CDFLIB); | @@ -128,21 +104,9 @@ putenv("LD_LIBRARY_PATH=".SYS_LIBS.":".DDLIB.":".CEFLIB.":".CDFLIB); | ||
128 | putenv("PATH=./:".DDBIN.":".SYS_BIN.":".IHM_SRC_DIR."php/bin"); | 104 | putenv("PATH=./:".DDBIN.":".SYS_BIN.":".IHM_SRC_DIR."php/bin"); |
129 | 105 | ||
130 | putenv("DDPATH=".DDRES_DIR); | 106 | putenv("DDPATH=".DDRES_DIR); |
131 | - | ||
132 | -// PHP classes | ||
133 | define('XMLPATH', IHM_SRC_DIR.'php/XML/'); | 107 | define('XMLPATH', IHM_SRC_DIR.'php/XML/'); |
134 | -define('CLASSPATH', IHM_SRC_DIR.'php/classes/'); | ||
135 | -define('REMOTE_CLASSPATH', IHM_SRC_DIR.'php/RemoteDataCenter/'); | ||
136 | -define('OLD_CLASSPATH', IHM_SRC_DIR.'php/old_amda/'); | ||
137 | - | ||
138 | -set_include_path(".:".CLASSPATH.":".REMOTE_CLASSPATH.":".OLD_CLASSPATH); | ||
139 | 108 | ||
140 | -if (!function_exists('__autoload')) | ||
141 | -{ | ||
142 | - function __autoload($class_name) { | ||
143 | - require_once $class_name . '.php'; | ||
144 | - } | ||
145 | -} | 109 | +require_once(INTEGRATION_BASE_PATH.'src/amdaintegration_autoload.php'); |
146 | 110 | ||
147 | global $API; | 111 | global $API; |
148 | $API = array( | 112 | $API = array( |
update_amda/makeRemote
@@ -35,10 +35,7 @@ | @@ -35,10 +35,7 @@ | ||
35 | # "DDBASE side" ( CDAWEB-like ) data centers | 35 | # "DDBASE side" ( CDAWEB-like ) data centers |
36 | # | 36 | # |
37 | php $AMDA_IHM/php/RemoteDataCenter/getRemoteDDBaseProxies.php | 37 | php $AMDA_IHM/php/RemoteDataCenter/getRemoteDDBaseProxies.php |
38 | - | ||
39 | - # make THEMIS Remote Params descriptions | ||
40 | - php $AMDA_IHM/php/RemoteDataCenter/makeRemoteParamInternal.php | ||
41 | - | 38 | + |
42 | # copy "DDBASE" Remote Params descriptions | 39 | # copy "DDBASE" Remote Params descriptions |
43 | if [ -d $AMDA_IHM/generic_data/RemoteData/PARAMS ]; then | 40 | if [ -d $AMDA_IHM/generic_data/RemoteData/PARAMS ]; then |
44 | cp $AMDA_IHM/generic_data/RemoteData/PARAMS/* $AMDA_IHM/generic_data/newKernelDDBase/ | 41 | cp $AMDA_IHM/generic_data/RemoteData/PARAMS/* $AMDA_IHM/generic_data/newKernelDDBase/ |