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