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