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             "region": "center",
10             "title": "Manage Database",
11             "xtype": "NestedLayoutPanel",
12             "|xns": "Roo",
13             "items": [
14                 {
15                     "|xns": "Roo",
16                     "xtype": "BorderLayout",
17                     "*prop": "layout",
18                     "items": [
19                         {
20                             "*prop": "west",
21                             "split": true,
22                             "width": 150,
23                             "xtype": "LayoutRegion",
24                             "|xns": "Roo"
25                         },
26                         {
27                             "*prop": "center",
28                             "xtype": "LayoutRegion",
29                             "|xns": "Roo"
30                         },
31                         {
32                             "listeners": {
33                                 "render": "function (_self)\n{\n   _this.treepanel = _self;\n}"
34                             },
35                             "region": "west",
36                             "xtype": "TreePanel",
37                             "|xns": "Roo",
38                             "items": [
39                                 {
40                                     "|xns": "Roo",
41                                     "xtype": "Toolbar",
42                                     "*prop": "toolbar",
43                                     "items": [
44                                         {
45                                             "listeners": {
46                                                 "click": "function (_self, e)\n{\n _this.treepanel.tree.root.reload();\n}"
47                                             },
48                                             "text": "Refresh/Manage Tables",
49                                             "xtype": "SplitButton",
50                                             "|xns": "Roo.Toolbar",
51                                             "items": [
52                                                 {
53                                                     "|xns": "Roo.menu",
54                                                     "xtype": "Menu",
55                                                     "*prop": "menu",
56                                                     "items": [
57                                                         {
58                                                             "text": "Add Table/Container",
59                                                             "xtype": "Item",
60                                                             "|xns": "Roo.menu"
61                                                         },
62                                                         {
63                                                             "|xns": "Roo.menu",
64                                                             "xtype": "Separator"
65                                                         },
66                                                         {
67                                                             "listeners": {
68                                                                 "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}"
69                                                             },
70                                                             "text": "Sync Tables",
71                                                             "xtype": "Item",
72                                                             "|xns": "Roo.menu"
73                                                         }
74                                                     ]
75                                                 }
76                                             ]
77                                         }
78                                     ]
79                                 },
80                                 {
81                                     "*prop": "tree",
82                                     "ddGroup": "dbtree",
83                                     "enableDrag": true,
84                                     "enableDrop": true,
85                                     "rootVisible": false,
86                                     "xtype": "TreePanel",
87                                     "|xns": "Roo.tree",
88                                     "items": [
89                                         {
90                                             "*prop": "loader",
91                                             "queryParam": "parent_id",
92                                             "requestMethod": "GET",
93                                             "root": "data",
94                                             "xtype": "TreeLoader",
95                                             "|baseParams": " { _tree: 1, 'sort': 'name', dir: 'ASC' }",
96                                             "|dataUrl": "baseURL + '/Roo/Builder_tables.php'",
97                                             "|xns": "Roo.tree"
98                                         },
99                                         {
100                                             "*prop": "root",
101                                             "text": "TOP LEVEL",
102                                             "xtype": "AsyncTreeNode",
103                                             "|xns": "Roo.tree"
104                                         }
105                                     ]
106                                 }
107                             ]
108                         },
109                         {
110                             "listeners": {
111                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
112                             },
113                             "background": true,
114                             "fitContainer": true,
115                             "fitToframe": true,
116                             "region": "center",
117                             "tableName": "Tables",
118                             "title": "Tables",
119                             "xtype": "GridPanel",
120                             "|xns": "Roo",
121                             "items": [
122                                 {
123                                     "listeners": {
124                                         "|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}",
125                                         "|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"
126                                     },
127                                     "*prop": "grid",
128                                     "autoExpandColumn": "table",
129                                     "loadMask": true,
130                                     "xtype": "Grid",
131                                     "|xns": "Roo.grid",
132                                     "items": [
133                                         {
134                                             "*prop": "dataSource",
135                                             "xtype": "Store",
136                                             "remoteSort": true,
137                                             "|sortInfo": "{ field : 'filename', direction: 'ASC' }",
138                                             "|xns": "Roo.data",
139                                             "items": [
140                                                 {
141                                                     "*prop": "proxy",
142                                                     "method": "GET",
143                                                     "xtype": "HttpProxy",
144                                                     "|url": "baseURL + '/Builder/ERM.php'",
145                                                     "|xns": "Roo.data"
146                                                 },
147                                                 {
148                                                     "|xns": "Roo.data",
149                                                     "xtype": "JsonReader",
150                                                     "totalProperty": "total",
151                                                     "root": "data",
152                                                     "*prop": "reader",
153                                                     "id": "id",
154                                                     "|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]"
155                                                 }
156                                             ]
157                                         },
158                                         {
159                                             "*prop": "footer",
160                                             "xtype": "PagingToolbar",
161                                             "pageSize": 25,
162                                             "displayInfo": true,
163                                             "displayMsg": "Displaying Images{0} - {1} of {2}",
164                                             "emptyMsg": "No Images found",
165                                             "|xns": "Roo"
166                                         },
167                                         {
168                                             "*prop": "toolbar",
169                                             "xtype": "Toolbar",
170                                             "|xns": "Roo",
171                                             "items": [
172                                                 {
173                                                     "listeners": {
174                                                         "|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"
175                                                     },
176                                                     "cls": "x-btn-text-icon",
177                                                     "text": "Refresh Schema",
178                                                     "xtype": "Button",
179                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
180                                                     "|xns": "Roo.Toolbar"
181                                                 }
182                                             ]
183                                         },
184                                         {
185                                             "*prop": "colModel[]",
186                                             "dataIndex": "table",
187                                             "header": "Table",
188                                             "width": 200,
189                                             "xtype": "ColumnModel",
190                                             "|renderer": "function(v) { return String.format('{0}', v); }",
191                                             "|xns": "Roo.grid"
192                                         }
193                                     ]
194                                 }
195                             ]
196                         }
197                     ]
198                 }
199             ]
200         }
201     ],
202     "permname": "",
203     "modOrder": "999"
204 }