Pman.Tab.BuilderDatabase.bjs
[Pman.Builder] / Pman.Tab.BuilderDatabase.bjs
1 {
2     "id": "roo-file-92",
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                                     "containerScroll": true,
90                                     "ddGroup": "dbtree",
91                                     "enableDD": true,
92                                     "rootVisible": false,
93                                     "xtype": "TreePanel",
94                                     "|xns": "Roo.tree",
95                                     "items": [
96                                         {
97                                             "listeners": {
98                                                 "create": "function (_self, attr)\n{\n    Roo.log(\"CREATE\");\n    try {\n        attr.text = attr.name.length ? attr.name : attr.descrip;\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}"
99                                             },
100                                             "*prop": "loader",
101                                             "queryParam": "parent_id",
102                                             "requestMethod": "GET",
103                                             "root": "data",
104                                             "xtype": "TreeLoader",
105                                             "|baseParams": " { _tree: 1, 'sort': 'name', dir: 'ASC', limit : 9999 }",
106                                             "|dataUrl": "baseURL + '/Roo/Builder_tables.php'",
107                                             "|xns": "Roo.tree"
108                                         },
109                                         {
110                                             "*prop": "root",
111                                             "text": "TOP LEVEL",
112                                             "xtype": "AsyncTreeNode",
113                                             "|xns": "Roo.tree"
114                                         },
115                                         {
116                                             "|xns": "Roo.tree",
117                                             "xtype": "DefaultSelectionModel",
118                                             "*prop": "sm"
119                                         },
120                                         {
121                                             "listeners": {
122                                                 "beforenodeedit": "function (_self,node)\n{\n    Roo.log('before start edit');\n    Roo.log(this.editNode);\n    if (node.attributes.name.length) {\n        return false;\n    }\n    return true;\n    \n}"
123                                             },
124                                             "*prop": "editor",
125                                             "xtype": "TreeEditor",
126                                             "|xns": "Roo.tree"
127                                         }
128                                     ]
129                                 },
130                                 {
131                                     "|xns": "Roo.menu",
132                                     "xtype": "Menu",
133                                     "*prop": "menu",
134                                     "items": [
135                                         {
136                                             "text": "Add Group",
137                                             "xtype": "Item",
138                                             "|xns": "Roo.menu"
139                                         }
140                                     ]
141                                 }
142                             ]
143                         },
144                         {
145                             "listeners": {
146                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
147                             },
148                             "background": true,
149                             "fitContainer": true,
150                             "fitToframe": true,
151                             "region": "center",
152                             "tableName": "Tables",
153                             "title": "Tables",
154                             "xtype": "GridPanel",
155                             "|xns": "Roo",
156                             "items": [
157                                 {
158                                     "listeners": {
159                                         "|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}",
160                                         "|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"
161                                     },
162                                     "*prop": "grid",
163                                     "autoExpandColumn": "table",
164                                     "loadMask": true,
165                                     "xtype": "Grid",
166                                     "|xns": "Roo.grid",
167                                     "items": [
168                                         {
169                                             "*prop": "dataSource",
170                                             "xtype": "Store",
171                                             "remoteSort": true,
172                                             "|sortInfo": "{ field : 'filename', direction: 'ASC' }",
173                                             "|xns": "Roo.data",
174                                             "items": [
175                                                 {
176                                                     "*prop": "proxy",
177                                                     "method": "GET",
178                                                     "xtype": "HttpProxy",
179                                                     "|url": "baseURL + '/Builder/ERM.php'",
180                                                     "|xns": "Roo.data"
181                                                 },
182                                                 {
183                                                     "|xns": "Roo.data",
184                                                     "xtype": "JsonReader",
185                                                     "totalProperty": "total",
186                                                     "root": "data",
187                                                     "*prop": "reader",
188                                                     "id": "id",
189                                                     "|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]"
190                                                 }
191                                             ]
192                                         },
193                                         {
194                                             "*prop": "footer",
195                                             "xtype": "PagingToolbar",
196                                             "pageSize": 25,
197                                             "displayInfo": true,
198                                             "displayMsg": "Displaying Images{0} - {1} of {2}",
199                                             "emptyMsg": "No Images found",
200                                             "|xns": "Roo"
201                                         },
202                                         {
203                                             "*prop": "toolbar",
204                                             "xtype": "Toolbar",
205                                             "|xns": "Roo",
206                                             "items": [
207                                                 {
208                                                     "listeners": {
209                                                         "|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"
210                                                     },
211                                                     "cls": "x-btn-text-icon",
212                                                     "text": "Refresh Schema",
213                                                     "xtype": "Button",
214                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
215                                                     "|xns": "Roo.Toolbar"
216                                                 }
217                                             ]
218                                         },
219                                         {
220                                             "*prop": "colModel[]",
221                                             "dataIndex": "table",
222                                             "header": "Table",
223                                             "width": 200,
224                                             "xtype": "ColumnModel",
225                                             "|renderer": "function(v) { return String.format('{0}', v); }",
226                                             "|xns": "Roo.grid"
227                                         }
228                                     ]
229                                 }
230                             ]
231                         }
232                     ]
233                 }
234             ]
235         }
236     ],
237     "permname": "",
238     "modOrder": "999"
239 }