Pman.Tab.BuilderDatabase.bjs
[Pman.Builder] / Pman.Tab.BuilderDatabase.bjs
1 {
2     "id": "roo-file-93",
3     "name": "Pman.Tab.BuilderDatabase",
4     "parent": "Pman.Tab.Builder",
5     "title": "Pman.Tab.BuilderDatabase",
6     "path": "/home/alan/gitlive/Pman.Builder/Pman.Tab.BuilderDatabase.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "activate": "function (_self)\n{\n _this.treepanel.tree.root.reload();\n}"
11             },
12             "background": true,
13             "region": "center",
14             "title": "Manage Database",
15             "xtype": "NestedLayoutPanel",
16             "|xns": "Roo",
17             "items": [
18                 {
19                     "|xns": "Roo",
20                     "xtype": "BorderLayout",
21                     "*prop": "layout",
22                     "items": [
23                         {
24                             "*prop": "west",
25                             "split": true,
26                             "width": 150,
27                             "xtype": "LayoutRegion",
28                             "|xns": "Roo"
29                         },
30                         {
31                             "*prop": "center",
32                             "xtype": "LayoutRegion",
33                             "|xns": "Roo"
34                         },
35                         {
36                             "listeners": {
37                                 "render": "function (_self)\n{\n   _this.treepanel = _self;\n}"
38                             },
39                             "region": "west",
40                             "xtype": "TreePanel",
41                             "|xns": "Roo",
42                             "items": [
43                                 {
44                                     "|xns": "Roo",
45                                     "xtype": "Toolbar",
46                                     "*prop": "toolbar",
47                                     "items": [
48                                         {
49                                             "listeners": {
50                                                 "click": "function (_self, e)\n{\n _this.treepanel.tree.root.reload();\n}"
51                                             },
52                                             "text": "Refresh/Manage Tables",
53                                             "xtype": "SplitButton",
54                                             "|xns": "Roo.Toolbar",
55                                             "items": [
56                                                 {
57                                                     "|xns": "Roo.menu",
58                                                     "xtype": "Menu",
59                                                     "*prop": "menu",
60                                                     "items": [
61                                                         {
62                                                             "text": "Add Table/Container",
63                                                             "xtype": "Item",
64                                                             "|xns": "Roo.menu"
65                                                         },
66                                                         {
67                                                             "|xns": "Roo.menu",
68                                                             "xtype": "Separator"
69                                                         },
70                                                         {
71                                                             "listeners": {
72                                                                 "click": "function (_self, e)\n{\n    new Pman.Request({\n        method: 'GET',\n        url: baseURL + '/Roo/Builder_tables.php',\n        params : {\n             _sync : 1\n        }\n    });\n        \n}"
73                                                             },
74                                                             "text": "Sync Tables",
75                                                             "xtype": "Item",
76                                                             "|xns": "Roo.menu"
77                                                         }
78                                                     ]
79                                                 }
80                                             ]
81                                         }
82                                     ]
83                                 },
84                                 {
85                                     "listeners": {
86                                         "beforeload": "function (node)\n{\n    if (!_this.panel.active) {\n        return false;\n    }\n}"
87                                     },
88                                     "*prop": "tree",
89                                     "ddGroup": "dbtree",
90                                     "enableDrag": true,
91                                     "enableDrop": true,
92                                     "rootVisible": false,
93                                     "xtype": "TreePanel",
94                                     "|xns": "Roo.tree",
95                                     "items": [
96                                         {
97                                             "*prop": "sm",
98                                             "xtype": "MultiSelectionModel",
99                                             "|xns": "Roo.tree"
100                                         },
101                                         {
102                                             "listeners": {
103                                                 "create": "function (_self, attr)\n{\n    Roo.log(\"CREATE\");\n    try {\n        attr.text = '';\n        \n        attr.leaf = attr.name.length ? true : false;\n        attr.html = String.format('<B>{0}</B><i>{1}</i>',\n            attr.name,\n            attr.descrip\n        );\n    } catch(e) {\n        Roo.log(e);\n    }\n    Roo.log(attr);\n\n}"
104                                             },
105                                             "*prop": "loader",
106                                             "queryParam": "parent_id",
107                                             "requestMethod": "GET",
108                                             "root": "data",
109                                             "xtype": "TreeLoader",
110                                             "|baseParams": " { _tree: 1, 'sort': 'name', dir: 'ASC', limit : 9999 }",
111                                             "|dataUrl": "baseURL + '/Roo/Builder_tables.php'",
112                                             "|xns": "Roo.tree"
113                                         },
114                                         {
115                                             "*prop": "root",
116                                             "text": "TOP LEVEL",
117                                             "xtype": "AsyncTreeNode",
118                                             "|xns": "Roo.tree"
119                                         }
120                                     ]
121                                 }
122                             ]
123                         },
124                         {
125                             "listeners": {
126                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
127                             },
128                             "background": true,
129                             "fitContainer": true,
130                             "fitToframe": true,
131                             "region": "center",
132                             "tableName": "Tables",
133                             "title": "Tables",
134                             "xtype": "GridPanel",
135                             "|xns": "Roo",
136                             "items": [
137                                 {
138                                     "listeners": {
139                                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
140                                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
141                                     },
142                                     "*prop": "grid",
143                                     "autoExpandColumn": "table",
144                                     "loadMask": true,
145                                     "xtype": "Grid",
146                                     "|xns": "Roo.grid",
147                                     "items": [
148                                         {
149                                             "*prop": "dataSource",
150                                             "xtype": "Store",
151                                             "remoteSort": true,
152                                             "|sortInfo": "{ field : 'filename', direction: 'ASC' }",
153                                             "|xns": "Roo.data",
154                                             "items": [
155                                                 {
156                                                     "*prop": "proxy",
157                                                     "method": "GET",
158                                                     "xtype": "HttpProxy",
159                                                     "|url": "baseURL + '/Builder/ERM.php'",
160                                                     "|xns": "Roo.data"
161                                                 },
162                                                 {
163                                                     "|xns": "Roo.data",
164                                                     "xtype": "JsonReader",
165                                                     "totalProperty": "total",
166                                                     "root": "data",
167                                                     "*prop": "reader",
168                                                     "id": "id",
169                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'filename',\n        'type': 'string'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'width',\n        'type': 'int'\n    },\n    {\n        'name': 'height',\n        'type': 'int'\n    },\n    {\n        'name': 'filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'descript',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    },\n    {\n        'name': 'credit',\n        'type': 'string'\n    },\n    {\n        'name': 'source',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_filename',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_onid',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_width',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_height',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_created',\n        'type': 'date'\n    },\n    {\n        'name': 'parent_image_id_imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_descript',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_title',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_credit',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_source',\n        'type': 'string'\n    }\n]"
170                                                 }
171                                             ]
172                                         },
173                                         {
174                                             "*prop": "footer",
175                                             "xtype": "PagingToolbar",
176                                             "pageSize": 25,
177                                             "displayInfo": true,
178                                             "displayMsg": "Displaying Images{0} - {1} of {2}",
179                                             "emptyMsg": "No Images found",
180                                             "|xns": "Roo"
181                                         },
182                                         {
183                                             "*prop": "toolbar",
184                                             "xtype": "Toolbar",
185                                             "|xns": "Roo",
186                                             "items": [
187                                                 {
188                                                     "listeners": {
189                                                         "|click": "function()\n{\n    Roo.MessageBox.alert(\"Updating\", \"Updating the cache\");\n    new Pman.Request({\n        url : baseURL + '/Core/RefreshDatabaseCache',\n        method : 'GET',\n        success : function() {\n            Roo.MessageBox.hide();\n        }\n    });\n}\n"
190                                                     },
191                                                     "cls": "x-btn-text-icon",
192                                                     "text": "Refresh Schema",
193                                                     "xtype": "Button",
194                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
195                                                     "|xns": "Roo.Toolbar"
196                                                 }
197                                             ]
198                                         },
199                                         {
200                                             "*prop": "colModel[]",
201                                             "dataIndex": "table",
202                                             "header": "Table",
203                                             "width": 200,
204                                             "xtype": "ColumnModel",
205                                             "|renderer": "function(v) { return String.format('{0}', v); }",
206                                             "|xns": "Roo.grid"
207                                         }
208                                     ]
209                                 }
210                             ]
211                         }
212                     ]
213                 }
214             ]
215         }
216     ],
217     "permname": "",
218     "modOrder": "999"
219 }