Blame view

js/app/views/SearchUI.js 17.8 KB
16035364   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
/**
 * Project   : AMDA-NG
 * Name      : SearchUI.js
 * @class 	 amdaUI.SearchUI
 * @extends      Ext.container.Container 
 * @brief    Search Module UI definition (View)
 * @author CDA
 * @version $Id: SearchUI.js 2467 2014-07-10 16:06:26Z myriam $  
 */

3ec6bc73   Erdogan Furkan   8950 - Positionne...
11
Ext.define('amdaUI.SearchUI',
3ab0bee9   Elena.Budnik   aprams with args ...
12
	{
3ec6bc73   Erdogan Furkan   8950 - Positionne...
13
14
15
16
17
18
		extend: 'Ext.container.Container',
		alias: 'widget.panelSearch',

		requires: [
			'amdaUI.CalculatorUI',
			'amdaUI.TimeSelectorUI',
533ea933   Benjamin Renard   Show description ...
19
			'amdaUI.DescriptionField',
3ec6bc73   Erdogan Furkan   8950 - Positionne...
20
21
			'extensions.SelectableTextArea',
			'amdaUI.ParamArgumentsPlug',
e995f4ad   Erdogan Furkan   Added codeTextAre...
22
23
			'amdaModel.RequestParamObject',
			'amdaUI.CodeArea'
3ec6bc73   Erdogan Furkan   8950 - Positionne...
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
		],

		constructor: function (config) {
			this.init(config);
			this.callParent(arguments);
			// load object into view    
			this.loadObject();

			var searchArgsPlug = this.getPlugin('search-param-components-plugin');
			if (searchArgsPlug)
				searchArgsPlug.onApply = this.onApplyParameterArgs;
		},

		addTT: function (newTTName, newTTid) {
			this.timeSelector.addTT(newTTName, newTTid);
		},

		addTTs: function (TTarray) {
			// set TTTab	    
			this.timeSelector.setTTTab(TTarray);
		},

		addParam: function (newParamName, isLeaf, needArgs, components) {
			if (needArgs || components)
3ab0bee9   Elena.Budnik   aprams with args ...
48
				this.editParameterArgs(newParamName, components);
3ec6bc73   Erdogan Furkan   8950 - Positionne...
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
			else
				this.addParamInEditor(newParamName);
		},

		addParamInEditor: function (param) {
			var selection = this.constructionField.getSelection();
			this.constructionField.setValue(selection.beforeText + param + selection.afterText);
			this.constructionField.focus();
			this.constructionField.setCaretPosition(this.constructionField.getValue().length);
		},

		onApplyParameterArgs: function (uiScope, paramRequestObject) {
			var fullParam = paramRequestObject.getParamFullName();
			uiScope.addParamInEditor(fullParam);
		},

		editParameterArgs: function (name, components) {
			var paramObj = amdaModel.RequestParamObject.getEmptyObj();
			paramObj.paramid = name;

			if (components) {
				if (components['index1']) {
					paramObj['dim1-index'] = components['index1'];
					++paramObj['type'];
				}

				if (components['index2']) {
					paramObj['dim2-index'] = components['index2'];
					++paramObj['type'];
				}
3ab0bee9   Elena.Budnik   aprams with args ...
79
			}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
80
81
82
83
84

			var paramArgsPlug = this.getPlugin('search-param-components-plugin');
			if (paramArgsPlug) {
				var workinRequestParamObject = Ext.create('amdaModel.RequestParamObject', paramObj);
				paramArgsPlug.show('search-param-components-plugin', workinRequestParamObject);
3ab0bee9   Elena.Budnik   aprams with args ...
85
			}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
		},

		/**
		* Set Start-Stop from parameter info (Local & MyData)
		*/
		setTimeFromData: function (obj) {
			if (!obj.start || !obj.stop)
				return;
			var dateStart = new Date(obj.start.replace(/[T|Z]/g, ' ').replace(/\-/g, '\/'));
			var dateStop = new Date(obj.stop.replace(/[T|Z]/g, ' ').replace(/\-/g, '\/'));

			this.down('form').getForm().setValues({ startDate: dateStart, stopDate: dateStop });
		},

		setObject: function (obj) {
			this.object = obj;
			this.loadObject();
		},

		/**
		 * update this.object from form
		 */
		updateObject: function () {
			// get the basic form
			var basicForm = this.formPanel.getForm();
			// get the timeSource selected
			var timeSource = this.timeSelector.getActiveTimeSource();
			var updateStatus = true;

			var fieldsWithoutName = basicForm.getFields().items;
			Ext.Array.each(fieldsWithoutName, function (item, index, allItems) {
				if (item !== this.fieldName) {
					if (!item.isValid()) {
						if ((timeSource === amdaModel.AmdaTimeObject.inputTimeSrc[0]) &&
3ab0bee9   Elena.Budnik   aprams with args ...
120
							((item.name == 'startDate') || (item.name == 'stopDate') || (item.name == 'duration'))) {
3ec6bc73   Erdogan Furkan   8950 - Positionne...
121
							updateStatus = true;
3ab0bee9   Elena.Budnik   aprams with args ...
122
						}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
						else {
							// set update isn't allowed
							updateStatus = false;
							return false;
						}
					}
				}
			}, this);

			if (timeSource === amdaModel.AmdaTimeObject.inputTimeSrc[0] // timeSource  'TimeTable'
				&& this.timeSelector.TTGrid.getStore().count() == 0) {

				Ext.Msg.show({
					title: 'Warning', msg: 'You chose Time Selection `by TimeTable` but no timeTable was added!'
						+ '<br>You must add one or choose Time Selection `by Interval`',
					icon: Ext.MessageBox.WARNING, buttons: Ext.Msg.OK
				});
				updateStatus = false;
			}
			// if the update is allowed
			if (updateStatus) {
				/// real object update
				// update TimeTable object with the content of form
				basicForm.updateRecord(this.object);
				this.object.set('timesrc', timeSource);
				// set valid intervals into TimeTable object
				if (timeSource === amdaModel.AmdaTimeObject.inputTimeSrc[0]) {
					this.object.set('timeTables', this.timeSelector.TTGrid.getStore().data.items);
3ab0bee9   Elena.Budnik   aprams with args ...
151
152
				}
			}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
153
154
155
			// return the update status
			return updateStatus;
		},
16035364   Benjamin Renard   First commit
156

3ec6bc73   Erdogan Furkan   8950 - Positionne...
157
158
159
160
161
162
163
164
165
		/**
			* load this.object into form
			*/
		loadObject: function () {
			// load object into form		
			this.formPanel.getForm().loadRecord(this.object);
			// set object's TTs into the timeselector
			this.addTTs(this.object.get('timeTables'));
		},
16035364   Benjamin Renard   First commit
166

3ec6bc73   Erdogan Furkan   8950 - Positionne...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
		/**
		 * save method called by Save button to launch the save process
		 */
		saveProcess: function (toRename) {
			// if the TimeTable object has been modified	  
			if (this.object.dirty) {
				// Search module
				var searchModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.search.id);//('search-win');           
				// if the name has been modified this is a creation
				if (this.object.isModified('name')) {
					// if object already has an id : it's a 'rename' of an existing Condition
					if (this.object.get('id')) {
						// the context Node is the parent node of current edited one
						var contextNode = searchModule.linkedNode.parentNode;
						// link a new node to the TimeTableModule
						searchModule.createLinkedNode();
						// set the contextNode
						searchModule.linkedNode.set('contextNode', contextNode);
						// create a new object linked
						searchModule.createObject(this.object.getJsonValues());
						var searchObj = searchModule.linkedNode.get('object');
						// synchronisation of objects		     
						this.object = searchObj;
						if (toRename) searchModule.linkedNode.toRename = true;
					}
					searchModule.linkedNode.create();
				} else {
					searchModule.linkedNode.set('contextNode', searchModule.contextNode);
					// this.object.fireEvent('modify');
					searchModule.linkedNode.update();
				}
3ab0bee9   Elena.Budnik   aprams with args ...
198
			}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
		},

		/**
		 * overwrite metod called by Save button
		 */
		overwriteProcess: function (btn) {
			if (btn == 'cancel') return;

			this.fieldName.clearInvalid();
			this.saveProcess(true);
		},

		/**
		 * search method called by 'Do Search' button to launch the search process
		 */
		doSearch: function () {
			var searchModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.search.id);
			searchModule.linkedNode.execute();
			// fire execution  
			//  this.object.fireEvent('execute',this.object.dirty);
		},

		/**
		*   Check if brackets are balanced
3ab0bee9   Elena.Budnik   aprams with args ...
223
		*/
3ec6bc73   Erdogan Furkan   8950 - Positionne...
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
		isBalanced: function (str) {
			str = ("" + str).replace(/[^()\[\]{}]/g, "");
			var bracket = {
				"]": "[",
				"}": "{",
				")": "("
			},
				openBrackets = [],
				isClean = true,
				i = 0,
				len = str.length;

			for (; isClean && i < len; i++) {
				if (bracket[str[i]]) {
					isClean = (openBrackets.pop() === bracket[str[i]]);
				} else {
3ab0bee9   Elena.Budnik   aprams with args ...
240
241
					openBrackets.push(str[i]);
				}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
			}
			if (!(isClean && !openBrackets.length)) return 'Brackets are not balanced';

			return true;
		},

		/**
		* Update constructionField (Search Condition) in window search        
		*/
		updateConstruct: function (oldval, newval) {
			var expression = this.constructionField.value;
			oldval = oldval.replace(/[(]/g, "\\(");
			oldval = oldval.replace(/[)]/g, "\\)");
			var reg = new RegExp(oldval, "g");
			expression = expression.replace(reg, newval);
			this.constructionField.setValue(expression);
		},

		/**
		 * Check if changes were made before closing window 
		 * @return true if changes
		 */
		fclose: function () {
			var form = this.formPanel.getForm();
			var isDirty = form.isDirty();
			return isDirty;
		},

		/**
		*  Component configiration / init
		*/
		init: function (config) {
			this.timeSelector = new amdaUI.TimeSelectorUI({ id: 'SearchTimeSelector', flex: 2 });

			this.fieldName = new Ext.form.field.Text({
3ab0bee9   Elena.Budnik   aprams with args ...
277
				labelAlign: 'top', itemId: 'formParamName',
5e6d074f   Elena.Budnik   infobull for para...
278
				fieldLabel: 'Request Name',
69c5bc1e   Benjamin Renard   Add modif. time f...
279
				labelPad: 0,
3ec6bc73   Erdogan Furkan   8950 - Positionne...
280
				name: 'name',
69c5bc1e   Benjamin Renard   Add modif. time f...
281
				width: 165,
3ec6bc73   Erdogan Furkan   8950 - Positionne...
282
				allowBlank: false,
3ab0bee9   Elena.Budnik   aprams with args ...
283
284
285
286
				stripCharsRe: /(^\s+|\s+$)/g,
				validateOnChange: false,
				validateOnBlur: false,
				validFlag: false,
3ec6bc73   Erdogan Furkan   8950 - Positionne...
287
				validator: function () {
3ab0bee9   Elena.Budnik   aprams with args ...
288
289
					return this.validFlag;
				}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
290
			});
16035364   Benjamin Renard   First commit
291

e995f4ad   Erdogan Furkan   Added codeTextAre...
292
			this.constructionField =  Ext.create('amdaUI.CodeArea',{type:"search"});
3ec6bc73   Erdogan Furkan   8950 - Positionne...
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323

			var samplingmode_store = new Ext.data.ArrayStore({
				fields: ['id', 'name'],
				data: [
					['timestep', 'Time Step'],
					['refparam', 'Ref. Parameter']
				]
			});

			this.timeStepField = new Ext.form.NumberField({
				fieldLabel: '<img amda_clicktip="resamplingStep" src="js/resources/images/16x16/info_mini.png"/>&nbsp;Time Step (sec)',
				labelAlign: 'top',
				labelPad: 0,
				blankText: 'Time Step is required',
				name: 'sampling',
				minValue: 0.001,
				decimalPrecision: 10,
				hideTrigger: true,
				width: 165,
				validateOnBlur: false,
				allowBlank: false,
				isValid: function () {
					var me = this,
						disabled = me.disabled,
						validate = me.forceValidation || !disabled;

					if (!me.isVisible()) {
						return true;
					}

					return validate ? me.validateValue(me.processRawValue(me.getRawValue())) : disabled;
3ab0bee9   Elena.Budnik   aprams with args ...
324
				}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
325
			});
b78325f1   Benjamin Renard   Add validation fo...
326

3ec6bc73   Erdogan Furkan   8950 - Positionne...
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
			this.refParamField = new Ext.form.TextField({
				fieldLabel: '<img amda_clicktip="resamplingRefParam" src="js/resources/images/16x16/info_mini.png"/>&nbsp;Reference Param.',
				labelAlign: 'top',
				labelPad: 0,
				name: 'reference_param',
				width: 165,
				hidden: true,
				allowBlank: false,
				listeners: {
					afterrender: function (field, eOpts) {
						var paramTarget = new Ext.dd.DropTarget(field.el.dom,
							{
								ddGroup: 'explorerTree',
								notifyEnter: function (ddSource, e, data) {
								},
								notifyDrop: function (ddSource, e, data) {
									var selectedRecord = ddSource.dragData.records[0];
									switch (selectedRecord.$className) {
										case 'amdaModel.LocalParamNode':
										case 'amdaModel.RemoteParamNode':
										case 'amdaModel.RemoteSimuParamNode':
											if (!selectedRecord.get('isParameter') || selectedRecord.get('disable'))
												return false;
											if (selectedRecord.get('alias') != "")
												field.setValue("#" + selectedRecord.get('alias'));
											else
												field.setValue(selectedRecord.get('id'));
											return true;
										case 'amdaModel.AliasNode':
											if (!selectedRecord.isLeaf())
												return false;
											field.setValue("#" + selectedRecord.get('text'));
											return true;
										case 'amdaModel.DerivedParamNode':
											if (!selectedRecord.isLeaf())
												return false;
											field.setValue("ws_" + selectedRecord.get('text'));
											return true;
										case 'amdaModel.MyDataParamNode':
											if (!selectedRecord.isLeaf())
												return false;
											field.setValue("wsd_" + selectedRecord.get('text'));
											return true;
										default:
69c5bc1e   Benjamin Renard   Add modif. time f...
371
											return false;
3ec6bc73   Erdogan Furkan   8950 - Positionne...
372
373
									}
									return true;
69c5bc1e   Benjamin Renard   Add modif. time f...
374
								}
69c5bc1e   Benjamin Renard   Add modif. time f...
375
							}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
376
377
378
						);
					},
					scope: this
69c5bc1e   Benjamin Renard   Add modif. time f...
379
				},
3ec6bc73   Erdogan Furkan   8950 - Positionne...
380
381
382
383
				isValid: function () {
					var me = this,
						disabled = me.disabled,
						validate = me.forceValidation || !disabled;
b78325f1   Benjamin Renard   Add validation fo...
384

3ec6bc73   Erdogan Furkan   8950 - Positionne...
385
386
387
388
389
					if (!me.isVisible()) {
						return true;
					}

					return validate ? me.validateValue(me.processRawValue(me.getRawValue())) : disabled;
b78325f1   Benjamin Renard   Add validation fo...
390
				}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
391
			});
b78325f1   Benjamin Renard   Add validation fo...
392

3ec6bc73   Erdogan Furkan   8950 - Positionne...
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
			this.samplingDefContainer = new Ext.container.Container({
				border: false,
				items: [
					this.timeStepField,
					this.refParamField
				],
				width: 165
			});

			this.formPanel = new Ext.form.Panel(
				{
					region: 'center',
					bodyStyle: { background: '#dfe8f6' },
					border: false, buttonAlign: 'left',
					trackResetOnLoad: true,  //reset to the last loaded record
3ab0bee9   Elena.Budnik   aprams with args ...
408
					layout: {
3ec6bc73   Erdogan Furkan   8950 - Positionne...
409
410
411
412
413
414
415
						type: 'vbox',
						align: 'stretch',
						defaultMargins: { top: 5, left: 5, bottom: 10, right: 10 }
					},
					id: 'formSearch',
					defaults: {
						border: false
3ab0bee9   Elena.Budnik   aprams with args ...
416
417
418
					},
					items: [
						{
3ab0bee9   Elena.Budnik   aprams with args ...
419
							xtype: 'container',
3ec6bc73   Erdogan Furkan   8950 - Positionne...
420
							flex: 2.5,
3ab0bee9   Elena.Budnik   aprams with args ...
421
							layout: {
3ec6bc73   Erdogan Furkan   8950 - Positionne...
422
423
								type: 'hbox',
								align: 'stretch'
3ab0bee9   Elena.Budnik   aprams with args ...
424
							},
3ec6bc73   Erdogan Furkan   8950 - Positionne...
425
							items: [
3ab0bee9   Elena.Budnik   aprams with args ...
426
								{
3ec6bc73   Erdogan Furkan   8950 - Positionne...
427
428
429
430
431
432
									flex: 3,
									xtype: 'container',
									border: false,
									layout: {
										type: 'table',
										columns: 3
69c5bc1e   Benjamin Renard   Add modif. time f...
433
									},
3ec6bc73   Erdogan Furkan   8950 - Positionne...
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
									defaultType: 'textfield',
									defaults: {
										labelAlign: 'top',
										labelPad: 0
									},
									items: [
										this.fieldName,
										{ xtype: 'component', width: 45 },
										{
											fieldLabel: 'Last modification',
											xtype: 'displayfield',
											name: 'last_update',
											width: 165,
											renderer: function (value, field) {
												var tpl = new Ext.XTemplate('<p style="font-style:italic;color:gray;margin:0;">{date}</>');
												var mod_date = 'Not saved';
												if (value > 0)
													mod_date = Ext.Date.format(new Date(value * 1000), "Y-m-d\\TH:i:s");
												return tpl.apply({ date: mod_date });
											},
69c5bc1e   Benjamin Renard   Add modif. time f...
454
										},
3ec6bc73   Erdogan Furkan   8950 - Positionne...
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
										{
											xtype: 'combo',
											fieldLabel: 'Sampling mode',
											name: 'sampling_mode',
											queryMode: 'local',
											editable: false,
											valueField: 'id',
											displayField: 'name',
											store: samplingmode_store,
											value: samplingmode_store.first(),
											width: 165,
											listeners: {
												change: function (field, value) {
													this.timeStepField.setVisible(value != 'refparam');
													this.refParamField.setVisible(value == 'refparam');
												},
												scope: this
											}
										},
										{
											xtype: 'component', width: 45
										},
										this.samplingDefContainer,
										{
											xtype: 'displayfield', width: 165,
											hideLabel: true,
											fieldStyle: 'display:inline-block;text-align:right',
											value: '<b style="top: 50%;position: relative;">Data Gap&nbsp;<img amda_clicktip="dataGap" src="js/resources/images/16x16/info_mini.png"/></b>'
										},
										{
											xtype: 'component', width: 45
										},
										{
											xtype: 'numberfield', name: 'gap',
											fieldLabel: 'if no data for interval', minValue: 1,
											labelAlign: 'top', hideTrigger: true, width: 165
										},
										{
533ea933   Benjamin Renard   Show description ...
493
											xtype: 'descriptionfield',
3ec6bc73   Erdogan Furkan   8950 - Positionne...
494
											name: 'description',
3ec6bc73   Erdogan Furkan   8950 - Positionne...
495
496
497
498
											width: 375, height: 70,
											colspan: 3
										}
									]
3ab0bee9   Elena.Budnik   aprams with args ...
499
								},
3ec6bc73   Erdogan Furkan   8950 - Positionne...
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
								this.timeSelector
							]
						},
						this.constructionField
					],
					fbar: [
						{
							text: 'Do Search',
							scope: this,
							handler: function (button) {
								// update object with user's values
								// if the return is true (object had been updated)
								if (this.updateObject()) {
									// launch the search process                           
									this.doSearch();
3ab0bee9   Elena.Budnik   aprams with args ...
515
								}
3ab0bee9   Elena.Budnik   aprams with args ...
516
							}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
517
						},
3ab0bee9   Elena.Budnik   aprams with args ...
518
						{
3ec6bc73   Erdogan Furkan   8950 - Positionne...
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
							text: 'Save Request',
							scope: this,
							handler: function () {
								// update object with user's values 
								// if the return is true (object had been updated)
								if (this.updateObject()) {
									var searchModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.search.id);
									if (!searchModule)
										return;
									var me = this;

									searchModule.linkedNode.isValidName(this.fieldName.getValue(), function (res) {
										if (!res) {
											me.fieldName.validFlag = 'Error during object validation';
											myDesktopApp.errorMsg(me.fieldName.validFlag);
											me.fieldName.validate();
											return;
3ab0bee9   Elena.Budnik   aprams with args ...
536
										}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566

										if (!res.valid) {
											if (res.error) {
												if (res.error.search('subtree') != -1) {
													Ext.MessageBox.show({
														title: 'Warning',
														msg: res.error + '<br/>Do you want to overwrite it?',
														width: 300,
														buttons: Ext.MessageBox.OKCANCEL,
														fn: me.overwriteProcess,
														icon: Ext.MessageBox.WARNING,
														scope: me
													});
													me.fieldName.validFlag = true;
												}
												else
													me.fieldName.validFlag = res.error;
											}
											else {
												me.fieldName.validFlag = 'Invalid object name';
												myDesktopApp.errorMsg(me.fieldName.validFlag);
											}
											me.fieldName.validate();
											return;
										}

										me.fieldName.validFlag = true;
										me.fieldName.validate();
										me.saveProcess(false);
									});
3ab0bee9   Elena.Budnik   aprams with args ...
567
								}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
							}
						},
						{
							text: 'Reset',
							scope: this,
							handler: function () {
								var searchModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.search.id);
								searchModule.createLinkedNode();
								searchModule.createObject();
								this.setObject(searchModule.getLinkedNode().get('object'));
							}
						}
					]
				});

			var myConf = {
				layout: 'border',
				defaults: { layout: 'fit', border: false },
				items:
					[
						this.formPanel,
						{
							xtype: 'panel', region: 'south',
							title: 'Information',
							collapsible: true,
							collapseMode: 'header',
							height: 100,
							autoHide: false,
							iconCls: 'icon-information',
							bodyStyle: 'padding:5px',
							loader:
							{
								autoLoad: true,
								url: helpDir + 'dataMiningHOWTO'
							}
						}
					],
				plugins: [
					{ ptype: 'calculator', myBtns: [], context: 'Condition' },
					{ ptype: 'paramArgumentsPlugin', pluginId: 'search-param-components-plugin' }
				],
				listeners: {
					click: {
						element: 'el',
						fn: function (e, t) {
							var me = t,
								text = me.getAttribute('amda_clicktip');
							if (text) {
								e.preventDefault();
								AmdaAction.getInfo({ name: text }, function (res, e) {
									if (res.success) myDesktopApp.infoMsg(res.result);
								});
							}
5e6d074f   Elena.Budnik   infobull for para...
621
622
623
						}
					}
				}
3ec6bc73   Erdogan Furkan   8950 - Positionne...
624
625
626
627
			};

			Ext.apply(this, Ext.apply(arguments, myConf));
		}
16035364   Benjamin Renard   First commit
628

3ec6bc73   Erdogan Furkan   8950 - Positionne...
629
	});