Blame view

js/app/AmdaApp.js 17 KB
10200969   Roipoussiere   Remove whitespace...
1
/**
16035364   Benjamin Renard   First commit
2
3
 * Project  : AMDA-NG4
 * Name     : AmdaApp.js
10200969   Roipoussiere   Remove whitespace...
4
 * @class   amdaApp.AmdaApp
16035364   Benjamin Renard   First commit
5
6
7
 * @extends Ext.ux.desktop.App
 * @brief   Main class defining Amda Desktop and its Modules
 * @author  Ext JS Library 4.0 Copyright(c) 2006-2011 Sencha Inc. licensing@sencha.com
16035364   Benjamin Renard   First commit
8
9
 */

16035364   Benjamin Renard   First commit
10
Ext.define('amdaApp.AmdaApp', {
7baca0ef   Elena.Budnik   user special sett...
11
12
13
14
15
16
17
18
19
20
	extend: 'Ext.ux.desktop.App',

	requires: [
		'Ext.window.MessageBox',
		'Ext.ux.desktop.ShortcutModel',
		'amdaUI.SampToolBarUI',
		'amdaDesktop.DynamicModule',
		'MyDesktop.Settings'
	],

bf776dc8   Benjamin Renard   working
21
	dynamicModules: {
7baca0ef   Elena.Budnik   user special sett...
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
		visu : {
				id          : 'visu-win',
				icon        : 'icon-visu_catalog',
				title       : 'Visualization',
				source      : 'amdaDesktop.VisuModule',
				useLauncher : true
			},
		statistics : {
				id          : 'statistics-win',
				icon        : 'icon-statistics',
				title       : 'Statistics',
				source      : 'amdaDesktop.StatisticsModule',
				useLauncher : true
			},
		catalog : {
				id          : 'catalog-win',
				icon        : 'icon-catalog',
				title       : 'Manage catalogs',
				source      : 'amdaDesktop.CatalogModule',
				useLauncher : true
			},
		param : {
			id          : 'param-win',
			icon        : 'icon-parameters',
			title       : 'Create/modify parameters',
			source      : 'amdaDesktop.ParameterModule',
			useLauncher : true
		},
		tt : {
			id          : 'timetab-win',
			icon        : 'icon-manage-tt',
			title       : 'Manage Time Tables',
			source      : 'amdaDesktop.TimeTableModule',
			useLauncher : true
		},
		tt_op : {
			id          : 'ttsOpe-win',
			icon        : 'icon-tts',
			title       : 'Operations on Time Tables',
			source      : 'amdaDesktop.TimeTableOperationModule',
			useLauncher : true
		},
		plot : {
			id          : 'plot-win',
			icon         : 'icon-plot',
			title       : 'Plot Manager',
			source      : 'amdaDesktop.PlotModule',
			useLauncher : true
		},
		search : {
			id          : 'search-win',
			icon        : 'icon-search',
			title       : 'Data Mining',
			source      : 'amdaDesktop.SearchModule',
			useLauncher : true
		},
		download : {
			id          : 'down-win',
			icon        : 'icon-download',
			title       : 'Download data',
			source      : 'amdaDesktop.DownloadModule',
			useLauncher : true
		},
		upload : {
			id          : 'up-win',
			icon        : 'icon-mydata',
			title       : 'Upload data',
			source      : 'amdaDesktop.UploadModule',
			useLauncher : true
		},
		interop : {
			id          : 'interop-win',
			icon        : 'icon-interop',
			title       : 'Interoperability',
			source      : 'amdaDesktop.InteropModule',
			useLauncher : true
		},
b185823c   Nathanael Jourdane   Use IntervalUI mo...
99
100
		epntap : {
			id          : 'epntap-win',
d53e0fe6   Nathanael Jourdane   Move EPN-TAP modu...
101
			icon        : 'icon-interop',
b185823c   Nathanael Jourdane   Use IntervalUI mo...
102
103
			title       : 'EPN-TAP data',
			source      : 'amdaDesktop.EpnTapModule',
d53e0fe6   Nathanael Jourdane   Move EPN-TAP modu...
104
			useLauncher : false
b185823c   Nathanael Jourdane   Use IntervalUI mo...
105
		},
7baca0ef   Elena.Budnik   user special sett...
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
		info : {
			id          : 'info-win',
			icon        : 'icon-information',
			title       : 'About AMDA',
			source      : 'amdaDesktop.AboutModule',
			useLauncher : false
		},
		explorer : {
			id          : 'explorer-win',
			icon        : 'icon-elements',
			title       : 'Workspace Explorer',
			source      : 'amdaDesktop.ExplorerModule',
			useLauncher : false
		},
		my_data : {
			id          : 'mydata-win',
			icon        : 'icon-mydata',
			title       : 'Define parameter',
			source      : 'amdaDesktop.MyDataModule',
			useLauncher : false
		},
		help : {
			id          : 'help-win',
			icon        : 'icon-help',
			title       : 'Help',
			source      : 'amdaDesktop.HelpModule',
			useLauncher : false
		},
		feedback : {
			id          : 'feed-win',
			icon        : 'icon-feedback',
			title       : 'Feedback',
			source      : 'amdaDesktop.FeedbackModule',
			useLauncher : false
		},
		filters : {
			id          : 'filters-win',
			icon        : 'icon-filter',
			title       : 'Filters',
			source      : 'amdaDesktop.FiltersModule',
			useLauncher : false
		},
		result : {
			id          : 'result-win',
			contentId   : 'resultUI',
			icon        : 'icon-results',
			title       : 'Results',
			source      : 'amdaDesktop.ResultModule',
			useLauncher : false
		},
		astro : {
			id          : 'astroimages-win',
			icon        : 'icon-interop',
			title       : 'Astronomical Images',
			source      : 'amdaDesktop.AstroImagesModule',
			useLauncher : false
		}
	},

	// IDs of Modules working with  parameters; used in Alias Node
	//TODO stats-win
	paramModulesID : ['plot-win', 'param-win', 'search-win', 'down-win'],

	// Important system constants
	MAX_UPLOADED_FILE_SIZE : max_uploaded_file_size, // in B, from my_config.php

	listeners : {
16035364   Benjamin Renard   First commit
173
174
175
		scope : this,
		beforeunload : function ()
		{
16035364   Benjamin Renard   First commit
176
177
178
179
180
			var interopModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.interop.id);
			if (interopModule)
				interopModule.forceSampDisconnect();
			return true;
		},
10200969   Roipoussiere   Remove whitespace...
181
		ready : function ()
7baca0ef   Elena.Budnik   user special sett...
182
		{
7baca0ef   Elena.Budnik   user special sett...
183
			AmdaAction.cleanUserWS(function(res,e){},this);
aa94fd24   elena   Merge with last svn
184
		}
16035364   Benjamin Renard   First commit
185
	},
10200969   Roipoussiere   Remove whitespace...
186

7baca0ef   Elena.Budnik   user special sett...
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
	init: function() 
	{
		// custom logic before getXYZ methods get called...
		this.callParent();
		
		// now ready...
		//override createWindow method of desktop
		Ext.override(Ext.ux.desktop.Desktop, {
			createWindow: function (config, cls) {
				var me = this;
				var win = this.callParent([config,cls]);
				win.on({
					boxready: function (w) {
						w.dd.xTickSize = me.xTickSize;
						w.dd.yTickSize = me.yTickSize;

						if (w.resizer) {
								w.resizer.widthIncrement = me.xTickSize;
								w.resizer.heightIncrement = me.yTickSize;
						}

						if (w.y < 0)
								w.el.setY(0);

						if (w.x + w.width > me.el.getWidth())
								w.el.setX(me.el.getWidth()-w.width);

						if (w.y + w.height > me.el.getHeight())
								w.el.setY((me.el.getHeight()-w.height > 0) ? me.el.getHeight()-w.height : 0);

					},
					single: true
				});
				return win;
			}
		});
	},
	
	//create InfoBox
	infoMsg : function(msg) {
		Ext.Msg.show({
			title: 'AMDA Info',
			cls: 'infoMsg',
			msg: msg,
			modal: false,
			autoScroll: true,
			resizable: true,
			icon: Ext.Msg.INFO,
			buttons: Ext.Msg.OK
		});
	},
7034023d   Elena.Budnik   infoMsgLong class...
238
239
240
241
242
243
244
245
246
247
248
249
250
	//create InfoBox
	infoMsgLong : function(msg) {
		Ext.Msg.show({
			title: 'AMDA Info',
			cls: 'infoMsgLong',
			msg: msg,
			modal: false,
			autoScroll: true,
			resizable: true,
			icon: Ext.Msg.INFO,
			buttons: Ext.Msg.OK
		});
	},
7baca0ef   Elena.Budnik   user special sett...
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
	//create WarningBox
	warningMsg : function(msg) {
		Ext.Msg.show({
			title: 'Attention',
			msg: msg,
			icon: Ext.Msg.WARNING,
			buttons: Ext.Msg.OK
		});
	},

	//create ErrorBox
	errorMsg : function(msg) {
		Ext.Msg.show({
			title: 'Failure',
			msg: msg,
			icon: Ext.Msg.ERROR,
			buttons: Ext.Msg.OK
		});
	},

9b3f49e3   Elena.Budnik   info bulls Plot r...
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
	// add info icon; onCick AmdaHelp is shown
	addAmdaInfo : function(help, style) {
		if (style) {
			help +=  '" style="' + style;
		}
		var html =  '<img amda_clicktip="' + help + '" src="js/resources/images/16x16/info_mini.png"'
		return {
			xtype: 'label',
			html: html,
			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);
							}); 
						}
					}
				}
			}
		};
	},

7baca0ef   Elena.Budnik   user special sett...
298
299
300
301
302
303
304
305
306
	getModules : function(){
		var allModules = [];

		//Add dynamic modules
		Ext.Object.each(this.dynamicModules, function(key, def) {
			allModules.push(new amdaDesktop.DynamicModule(def.id, def.icon, def.title, def.source, def.useLauncher));
		});

		return allModules;
16035364   Benjamin Renard   First commit
307
	},
10200969   Roipoussiere   Remove whitespace...
308

7baca0ef   Elena.Budnik   user special sett...
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
	getDesktopConfig: function () 
	{
		var me = this, ret = me.callParent();

		var desktopId = 'AmdaDesktop';
		var wallpaper = Ext.state.Manager.getProvider().get(desktopId+'_wallpaper');
		if (!wallpaper)
				wallpaper = 'js/resources/images/desktop/wallpapers/Cdpp2.jpg';
		return Ext.apply(ret, {
			id       : desktopId,
			contextMenuItems: [
					{ text: 'Change Settings', handler: me.onSettings, scope: me }
			],
			shortcuts: Ext.create('Ext.data.Store', {
				model: 'Ext.ux.desktop.ShortcutModel',
				data: [
					{ name: 'Help',  iconCls: 'help', module: 'help-win' },
					{ name: 'Create/Modify parameter',  iconCls: 'edit', module: 'param-win' },
					{ name: 'Plot data',  iconCls: 'plot', module: 'plot-win'},
					{ name: 'Data mining',  iconCls: 'search', module: 'search-win'},
					{ name: 'Statistics',  iconCls: 'statistics', module: 'statistics-win'},
					{ name: 'Download data',  iconCls: 'download_manager', module: 'down-win'},
					{ name: 'Upload data',  iconCls: 'mydata', module: 'up-win'},
					{ name: 'Manage TimeTables',    iconCls: 'timeTable', module: 'timetab-win' },
					{ name: 'TimeTables operations',   iconCls: 'operations', module: 'ttsOpe-win' },
					{ name: 'Manage catalogs',  iconCls: 'catalog', module: 'catalog-win'},
					{ name: 'Visualize catalogs',  iconCls: 'visu_catalog', module: 'visu-win'},
					{ name: 'Interoperability',   iconCls: 'interop', module: 'interop-win' }
				]
			}),

			wallpaper: wallpaper,
			wallpaperStretch: false
		});
10200969   Roipoussiere   Remove whitespace...
343
344
	},

7baca0ef   Elena.Budnik   user special sett...
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
	// config for the start menu
	getStartConfig : function() 
	{
		var me = this, ret = me.callParent();
		return Ext.apply(ret, {
			title: sessionID,
			iconCls: 'icon-user',
			height: 270,
			toolConfig: {
				width: 130,
				items: [
					{
						text:'Settings',
						iconCls:'settings',
						handler: me.onSettings,
						scope: me
					}, '-',
					{
						text : 'Profile',
						iconCls : 'icon-user',
						id : 'profile-win-tool',
						handler : function(obj, e) {
								e.stopEvent();
								AmdaAction.getUserInfo(this.onGetUserInfo,this);
						},
						scope : this
					},
					{
						text : 'Feedback',
						iconCls : 'icon-feedback',
						id : 'feed-win-tool',
						handler : function(obj, e) {
								e.stopEvent();
								var moduleId = obj.el.id;
								this.getLoadedModule(moduleId.replace('-tool', ''), true, function(module) {
								module.createWindow();
								});
						},
						scope : this
					}, 
					{
						text : 'Help',
						iconCls : 'icon-help',
						id : 'help-win-tool',
						scope : this,
						handler : function(obj, e) {
								e.stopEvent();
								var moduleId = obj.el.id;
								this.getLoadedModule(moduleId.replace('-tool', ''), true, function(module) {
								module.createWindow();
							});
						}
					}, 
					{
						text : 'About AMDA',
						iconCls : 'icon-information',
						id : 'info-win-tool',
						scope : this,
						handler : function(obj, e) {
								e.stopEvent();
								var moduleId = obj.el.id;
								this.getLoadedModule(moduleId.replace('-tool', ''), true, function(module) {
								module.createWindow();
								});
						}
					}, '-', 
					{
						text : 'Workspaces',
						iconCls : 'icon-ws',
						disabled: true,
						scope : this
					}, '-', 
					{
						text : 'Logout',
						iconCls : 'logout',
						scope : this,
						handler : me.onLogout
					}
				]
			}
		});
	},

	getModuleDefinition: function(id) {
		return this.getModule(id);
	},

	getLoadedModule: function(id, forceLoad, onReady) {
		var moduleDef = this.getModuleDefinition(id);
		if (!moduleDef)
			return null;
		if (!moduleDef.isReady())
		{
			if (forceLoad)
			{
				//loadMask.show();
				moduleDef.get(function (module) {
					//loadMask.hide();
					if (onReady)
						onReady(module);
				});
			}
			return null;
		}
		if (onReady)
16035364   Benjamin Renard   First commit
450
			onReady(moduleDef.get());
7baca0ef   Elena.Budnik   user special sett...
451
452
453
454
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
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
		return moduleDef.get();
	},

	getTaskbarConfig: function () 
	{
		var ret = this.callParent();
		return Ext.apply(ret, {
			quickStart: [],
			trayItems: [
				{
					name: this.dynamicModules.feedback.title, iconCls: 'icon-feedback',
					tooltip: { text: this.dynamicModules.feedback.title, align: 'bl-tl' },
					overflowText: this.dynamicModules.feedback.title,
					iconCls: this.dynamicModules.feedback.icon,
					scope: this,
					handler : function(obj, e) {
						e.stopEvent();
						this.getLoadedModule(this.dynamicModules.feedback.id, true, function(module) {
								module.createWindow();
						});
					}
				},
				{
					name: this.dynamicModules.info.title, iconCls: 'icon-information',
					tooltip: { text: this.dynamicModules.info.title, align: 'bl-tl' },
					overflowText: this.dynamicModules.info.title,
					iconCls: this.dynamicModules.info.icon,
					scope: this,
					handler : function(obj, e) {
						e.stopEvent();
						this.getLoadedModule(this.dynamicModules.info.id, true, function(module) {
								module.createWindow();
						});
					}
				},
				{
					name: 'Logout', iconCls : 'logout',
					tooltip: { text: 'Logout', align: 'bl-tl' },
					overflowText: 'Logout',
					scope : this,
					handler : this.onLogout
				}, '-',
				{ xtype: 'trayclock', flex: 1 }
			]
		});
	},

	onLogout: function (obj,e) {
		e.stopEvent();
		if (isGuest) {
				this.guestLogout();
			}
		else {
			this.saveSessionState();
		}
	},

	onGetUserInfo : function (result, e){
		var t = e.getTransaction();
10200969   Roipoussiere   Remove whitespace...
510
511
		if (e.status)
		{
16035364   Benjamin Renard   First commit
512
513
			if (result && result.success)
			{
10200969   Roipoussiere   Remove whitespace...
514
				// SUCCESS
16035364   Benjamin Renard   First commit
515
				var msg = '<b>Login :</b> '+result['login']+'<br/>';
db4f24d1   Elena.Budnik   redmine #5385, #4...
516
				msg += ('<b> Name :</b> '+result['first_name']+' '+result['name']+'<br/>');
16035364   Benjamin Renard   First commit
517
518
519
				msg += ('<b>Groups :</b> '+result['group']+'<br/>');
				msg += ('<b>Email :</b> '+result['email']+'<br/>');
				msg += ('<b>Registration date :</b> '+result['date']+'<br/>');
db4f24d1   Elena.Budnik   redmine #5385, #4...
520
				msg += ('<b>Disk space total / used / available :</b> '+result['total']+' / '+result['used']+' / '+result['available']+' MB<br/>');
16035364   Benjamin Renard   First commit
521
522
523
524
525
526
527
528
529
530
531
532
				this.infoMsg(msg);
			}
			else
			{
				//ERROR
				this.errorMsg('Cannot get user info');
			}
		}
		else
		{
			// FAILURE
			this.errorMsg('Cannot get user info : '+e.message);
10200969   Roipoussiere   Remove whitespace...
533
		}
16035364   Benjamin Renard   First commit
534
	},
10200969   Roipoussiere   Remove whitespace...
535

7baca0ef   Elena.Budnik   user special sett...
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
	guestLogout: function() {
		Ext.Msg.show({
			title : 'Logout',
			msg   :'Your guest workspace is to be deleted. Continue logout ?',
			buttons : Ext.Msg.YESNO,
			iconCls : 'logout',
			fn : function(btn) {
				if (btn == 'yes'){
					AmdaAction.logout(true, function(){
						sessionID = '';
						window.location.href ='index.html';
					});
				}
			}
		});
	},
10200969   Roipoussiere   Remove whitespace...
552

7baca0ef   Elena.Budnik   user special sett...
553
554
555
556
557
	forceLogout: function(){
		//  myDesktopApp.warningMsg('Your guest session is finished');
		AmdaAction.logout(true, function(){
			sessionID = '';
			window.location.href ='index.html';
aa94fd24   elena   Merge with last svn
558
		});
7baca0ef   Elena.Budnik   user special sett...
559
	},
10200969   Roipoussiere   Remove whitespace...
560

7baca0ef   Elena.Budnik   user special sett...
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
	saveSessionState : function()
	{
		var me = this;
		Ext.Msg.show({
			title : 'Logout',
			msg   :'Do you want to keep current windows sizes and locations<br/> for the next sessions?',
			buttons : Ext.Msg.YESNOCANCEL,
			iconCls : 'logout',
			fn : function(btn) {
				if (btn == 'yes'){
					//set wallpaper
					Ext.state.Manager.getProvider().set(me.desktop.id+'_wallpaper',me.desktop.getWallpaper());
					Ext.state.Manager.getProvider().on({
						scope : this,
						aftersave : function(provider) {
							sessionID = '';
							window.location.href ='index.html';
						}
					});
					Ext.state.Manager.getProvider().saveState();
3bedf627   Elena.Budnik   correct logout() ...
581
					AmdaAction.logout(false);
7baca0ef   Elena.Budnik   user special sett...
582
583
584
585
586
587
588
589
590
591
592
593
				}
				else if (btn == 'no')
				{
					Ext.state.Manager.getProvider().on({
						scope : this,
						aftersave : function(provider) {
							sessionID = '';
							window.location.href ='index.html';
						}
					});
					Ext.state.Manager.getProvider().set(me.desktop.id+'_wallpaper',me.desktop.getWallpaper());
					Ext.state.Manager.getProvider().saveLastTime();
3bedf627   Elena.Budnik   correct logout() ...
594
					AmdaAction.logout(false);
7baca0ef   Elena.Budnik   user special sett...
595
596
				}
			}
aa94fd24   elena   Merge with last svn
597
		});
7baca0ef   Elena.Budnik   user special sett...
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
	},

	onSettings: function () {
		var dlg = new MyDesktop.Settings({
			desktop: this.desktop
		});
		dlg.show();
	},

	/**
	* initialization at the start of AMDA-NG webApplication
	*/
	initProject : function() 
	{
		moduleIds = new Ext.util.MixedCollection();
		// Adding Workspace Explorer Id
		moduleIds.add(this.dynamicModules.explorer.id);

		moduleIds.each(function(item) {
			this.getLoadedModule(item, true, function (module) {
				module.createWindow();
			});
		}, this);

		if (freeSpace < diskQuota / 20) {
			myDesktopApp.warningMsg('Think of cleaning up your work space.<br/>Only ' +
			Math.round(freeSpace/1024/1024)+ 'MB of '+Math.round(diskQuota/1024/1024) +
			'MB rests');
		}

c3976709   Elena.Budnik   rm 7589 + clean u...
628
629
630
631
		if (isFirstVisit && !isGuest) {
            myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.help.id, true, function(module) {
                module.createWindow();
            });
7baca0ef   Elena.Budnik   user special sett...
632
633
634
635
		}
		else {
			if (isSpecialInfo && !isNewInfo) {
				myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.info.id, true, function(module) {
d95e8421   Elena.Budnik   ws transfer : ini...
636
					module.createWindow(isSpecialInfo, 'Welcome on AMDA', true);
7baca0ef   Elena.Budnik   user special sett...
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
				});
			}
		}

		if (isNewInfo) {
			myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.info.id, true, function(module) {
				//  module.createWindow('releaseNotes.' + AMDAVERSION, 'New Release V'+ AMDAVERSION);
				module.createWindow(news, 'Amda Latest News');
			});
		}

		if (isGuest) {
			myDesktopApp.warningMsg("Welcome to Guest Session<br/>Guest session lasts for "+
				guestSessionDuration/3600+" h maximum<br/>"+
				"For extended use time and functionalities (saved sessions)<br/> please register at amda@irap.omp.eu");
			Ext.Function.defer(myDesktopApp.warningMsg,(guestSessionDuration-300)*1000, this, ["Your session will be closed in 5 min!"]);
			Ext.Function.defer(myDesktopApp.forceLogout, guestSessionDuration*1000);
		}

		this.desktop.taskbar.tray.width = 130;
		this.desktop.taskbar.insert(4,new amdaUI.SampToolBarUI({id : 'samptb', onSwitchConnect : function () {
			myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.interop.id, true, function(module) {
				module.switchSampConnect();
			});
		}}));
	}
16035364   Benjamin Renard   First commit
663
});