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                                             "|xns": "Roo.menu",
137                                             "xtype": "Item"
138                                         }
139                                     ]
140                                 }
141                             ]
142                         },
143                         {
144                             "listeners": {
145                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
146                             },
147                             "background": true,
148                             "fitContainer": true,
149                             "fitToframe": true,
150                             "region": "center",
151                             "tableName": "Tables",
152                             "title": "Tables",
153                             "xtype": "GridPanel",
154                             "|xns": "Roo",
155                             "items": [
156                                 {
157                                     "listeners": {
158                                         "|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}",
159                                         "|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"
160                                     },
161                                     "*prop": "grid",
162                                     "autoExpandColumn": "table",
163                                     "loadMask": true,
164                                     "xtype": "Grid",
165                                     "|xns": "Roo.grid",
166                                     "items": [
167                                         {
168                                             "*prop": "dataSource",
169                                             "xtype": "Store",
170                                             "remoteSort": true,
171                                             "|sortInfo": "{ field : 'filename', direction: 'ASC' }",
172                                             "|xns": "Roo.data",
173                                             "items": [
174                                                 {
175                                                     "*prop": "proxy",
176                                                     "method": "GET",
177                                                     "xtype": "HttpProxy",
178                                                     "|url": "baseURL + '/Builder/ERM.php'",
179                                                     "|xns": "Roo.data"
180                                                 },
181                                                 {
182                                                     "|xns": "Roo.data",
183                                                     "xtype": "JsonReader",
184                                                     "totalProperty": "total",
185                                                     "root": "data",
186                                                     "*prop": "reader",
187                                                     "id": "id",
188                                                     "|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]"
189                                                 }
190                                             ]
191                                         },
192                                         {
193                                             "*prop": "footer",
194                                             "xtype": "PagingToolbar",
195                                             "pageSize": 25,
196                                             "displayInfo": true,
197                                             "displayMsg": "Displaying Images{0} - {1} of {2}",
198                                             "emptyMsg": "No Images found",
199                                             "|xns": "Roo"
200                                         },
201                                         {
202                                             "*prop": "toolbar",
203                                             "xtype": "Toolbar",
204                                             "|xns": "Roo",
205                                             "items": [
206                                                 {
207                                                     "listeners": {
208                                                         "|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"
209                                                     },
210                                                     "cls": "x-btn-text-icon",
211                                                     "text": "Refresh Schema",
212                                                     "xtype": "Button",
213                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
214                                                     "|xns": "Roo.Toolbar"
215                                                 }
216                                             ]
217                                         },
218                                         {
219                                             "*prop": "colModel[]",
220                                             "dataIndex": "table",
221                                             "header": "Table",
222                                             "width": 200,
223                                             "xtype": "ColumnModel",
224                                             "|renderer": "function(v) { return String.format('{0}', v); }",
225                                             "|xns": "Roo.grid"
226                                         }
227                                     ]
228                                 }
229                             ]
230                         }
231                     ]
232                 }
233             ]
234         }
235     ],
236     "permname": "",
237     "modOrder": "999"
238 }