CatalogModule.js
3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
/**
* Project AMDA-NG
* Name CatalogModule.js
* @class amdaDesktop.CatalogModule
* @extends amdaDesktop.InteractiveModule
* @brief Catalog Module controller definition
* @author elena
*/
Ext.define('amdaDesktop.CatalogModule', {
extend: 'amdaDesktop.InteractiveModule',
requires: [
'amdaUI.CatalogUI',
'amdaUI.ShareObjectUI'
],
contentId : 'catalogUI',
isOperationOnShow : true,
/**
* @cfg {String} data models
* @required
*/
nodeDataModel : 'amdaModel.CatalogNode',
/**
* @cfg {String} window definitions
* @required
*/
width : 800,
height: 700,
uiType : 'panelCatalog',
helpTitle : 'Help on Catalog Module',
helpFile : 'catalogHelp',
shareCatalog : function(catObj) {
var win = myDesktopApp.desktop.getWindow('sharecat-win');
if(!win)
{
var me = this;
var win = myDesktopApp.desktop.createWindow(
{
border: false,
id : 'sharecat-win',
title : 'Share Catalog',
width : 400,
height : 300,
layout : 'fit',
maximizable : false,
items : [
{
xtype : 'shareobject',
id : 'shareCatUI',
onAfterShareObject : function(folder_id, object_id) {
win.close();
var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID);
var sharedCatRootNode = explorerTree.getRootNode().findChild('id','sharedcatalog-treeRootNode',true);
amdaModel.InteractiveNode.preloadNodes(sharedCatRootNode, function() {
sharedCatRootNode.expand();
var folderNode = explorerTree.getRootNode().findChild('id', folder_id, true);
if (!folderNode)
return;
folderNode.removeAll();
folderNode.set('loaded',false);
amdaModel.InteractiveNode.preloadNodes(folderNode, function() {
folderNode.expand();
var objectNode = explorerTree.getRootNode().findChild('id',object_id,true);
sharedCatRootNode.myGetOwnerTree().getSelectionModel().select(objectNode);
});
});
}
}
]
});
}
var sharePanel = win.down('#shareCatUI');
if (sharePanel)
sharePanel.setProperties('catalog', catObj);
AmdaAction.getObject(catObj.id, 'catalog', function(result,remoteEvent) {
if (result) {
if (result.description)
sharePanel.setDescription(result.description);
}
}, this.getObjectCallback, this);
win.show();
}
});