dbgenerate.js
[app.Builder.js] / dbgenerate.js
1 //<script type="text/javascript">
2
3 /**
4  * This is a hacky generator to generate element definitions for the Roo version from the database
5  * 
6  * Let's see if libgda can be used to generate our Readers for roo...
7  * 
8  * Concept - conect to database..
9  * 
10  * list tables
11  * 
12  * extra schemas..
13  * 
14  * write readers..
15  * 
16  * usage: seed generate.js
17  *
18  *
19  *
20  *
21  *Hack needed to latest GLib-2.0.gir 
22  *
23  * <record name="KeyFile" c:type="GKeyFile" disguised="1">
24         <constructor name="new" c:identifier="g_key_file_new">
25         <return-value transfer-ownership="full">
26           <type name="KeyFile" c:type="GKeyFile*"/>
27         </return-value>
28       </constructor>
29  *
30  *
31  * remove introspectable =0 from g_key_file_get_groups
32  *
33  *
34  * 
35  * 
36  */
37 Gda  = imports.gi.Gda;
38 GObject = imports.gi.GObject;
39
40 GLib = imports.gi.GLib;
41
42 console = imports.console;
43 File = imports.File.File;
44 Options = imports.Options.Options;
45
46 //Gda.init();
47
48 var prov = Gda.Config.list_providers ();
49 //print(prov.dump_as_string());
50
51 var o = new Options({
52     help_description : 'Element builder for App Builder based on database schema',
53     
54     options:  [
55         { arg_long : 'DBNAME' , arg_short : 'd', description : 'Database Name' },
56         { arg_long : 'USERNAME' , arg_short : 'u', description : 'Username'},
57         { arg_long : 'PASSWORD' , arg_short : 'p', description : '' , arg_default :'' },
58         { arg_long : 'INI' , arg_short : 'I', description : 'Either base directory which has Pman/***/DataObjects/***.ini or location of ini file.' },
59     ]
60            
61 })
62
63
64
65 var cfg = o.parse(Seed.argv);
66 print(JSON.stringify(cfg, null,4));
67
68 var   cnc = Gda.Connection.open_from_string ("MySQL", "DB_NAME=" + cfg.DBNAME, 
69                                               "USERNAME=" + cfg.USERNAME + ';PASSWORD=' + cfg.PASSWORD,
70                                               Gda.ConnectionOptions.NONE, null);
71
72
73
74                                               
75
76  
77 Gda.DataSelect.prototype.fetchAll = function()
78 {
79     var cols = [];
80     
81     for (var i =0;i < this.get_n_columns(); i++) {
82         cols.push(this.get_column_name(i));
83     }
84     //print(JSON.stringify(cols, null,4));
85     var iter = this.create_iter();
86     var res = [];
87     //print(this.get_n_rows());
88     var _this = this;
89     for (var r = 0; r < this.get_n_rows(); r++) {
90         
91         // single clo..
92         //print("GOT ROW");
93         if (cols.length == 1) {
94             res.push(this.get_value_at(0,r).get_string());
95             continue;
96         }
97         var add = { };
98         
99         cols.forEach(function(n,i) {
100             var val = _this.get_value_at(i,r);
101             var type = GObject.type_name(val.g_type) ;
102             var vs = ['GdaBinary', 'GdaBlob' ].indexOf(type) > -1 ? val.value.to_string(1024) : val.value;
103             //print(n + " : TYPE: " + GObject.type_name(val.g_type) + " : " + vs);
104             //print (n + '=' + iter.get_value_at(i).value);
105             add[n] = vs;
106         });
107         
108         res.push(add);
109         
110     }
111     return res;
112
113 }
114
115 var map = {
116     'date' : 'date',
117     'datetime' : 'date',
118     'time' : 'string', //bogus
119     'int' : 'int',
120     'bigint' : 'int',
121     'double' : 'float',
122     'tinyint' : 'int',
123     'decimal' : 'float',
124     'float' : 'float',
125     'char' : 'string',
126     'varchar' : 'string',
127     'text' : 'string',
128     'longtext' : 'string',
129     'tinytext' : 'string',
130     'mediumtext' : 'string',
131     'enum' : 'string',
132     'timestamp' : 'number',
133     'blob' : 'text'
134     
135 }
136
137 var ini = { }
138
139 function readIni(fn)
140 {
141     print('Read INI : ' + fn);
142     var key_file = new GLib.KeyFile.c_new();
143     if (!key_file.load_from_file (fn , GLib.KeyFileFlags.NONE )) {
144         return;
145     }
146    
147     var groups = key_file.get_groups();
148     groups.forEach(function(g) {
149         ini[g] = {}
150            
151         var keys = key_file.get_keys(g);
152         keys.forEach(function(k) {
153             ini[g][k] = key_file.get_value(g,k);
154         })
155     })
156     
157 }
158 if (File.isFile(cfg.INI)) {
159     if (cfg.INI.match(/links\.ini$/)) {
160         readIni(cfg.INI);
161     } else {
162         readIni(cfg.INI.replace(/\.ini$/, ".links.ini"));
163     }
164 }
165
166 if (File.isDirectory(cfg.INI)) {
167         
168
169     //--- load ini files..
170     // this is very specific.
171     
172     var dirs = File.list( cfg.INI + '/Pman').filter( 
173         function(e) { 
174             if (!File.isDirectory(cfg.INI + '/Pman/' + e + '/DataObjects')) {
175                 return false;
176             }
177             return true;
178         }
179     );
180     
181      
182     dirs.forEach(function(d) {
183         // this currently misses the web.*/Pman/XXXX/DataObjects..
184         var path = cfg.INI + '/Pman/' + d + '/DataObjects';
185          
186         if (!File.isDirectory(path)) {
187             return; //skip
188         }
189         var inis = File.list(path).filter(
190             function(e) { return e.match(/\.links\.ini$/); }
191         );
192         if (!inis.length) {
193             return;
194         }
195         
196         inis.forEach(function(i) {
197             readIni(path + '/' + i); 
198             
199         })
200  
201     });
202     // look at web.XXXX/Pman/XXX/DataObjects/*.ini
203     var inis = File.list(cfg.INI).filter(
204         function(e) { return e.match(/\.links\.ini$/); }
205     )
206     
207      inis.forEach(function(i) {
208         readIni(path + '/' + i); 
209         
210     })
211     
212     
213 }
214 //print(JSON.stringify(ini, null,4));
215  //console.dump(ini);
216
217
218  //Seed.quit();
219
220 //GLib.key_file_load_from_file (key_file, String file, KeyFileFlags flags) : Boolean
221
222
223
224  
225
226 var tables = Gda.execute_select_command(cnc, "SHOW TABLES").fetchAll();
227 var readers = [];
228 tables.forEach(function(table) {
229     //print(table);
230     var schema = Gda.execute_select_command(cnc, "DESCRIBE `" + table+'`').fetchAll();
231     var reader = []; 
232     var colmodel = []; 
233     var combofields= [ { name : 'id', type: 'int' } ]; // technically the primary key..
234          
235     var form = {}
236        
237     var firstTxtCol = '';
238     
239     //print(JSON.stringify(schema, null,4));
240     
241     schema.forEach(function(e)  {
242         var type = e.Type.match(/([^(]+)\(([^\)]+)\)/);
243         var row  = { }; 
244         if (type) {
245             e.Type = type[1];
246             e.Size = type[2];
247         }
248         
249         
250         
251         row.name = e.Field;
252         
253         
254         if (typeof(map[e.Type]) == 'undefined') {
255            console.dump(e);
256            throw {
257                 name: "ArgumentError", 
258                 message: "Unknown mapping for type : " + e.Type
259             };
260         }
261         row.type = map[e.Type];
262         
263         if (row.type == 'string' && !firstTxtCol.length) {
264             firstTxtCol = row.name;
265         }
266         
267         if (row.type == 'date') {
268             row.dateFormat = 'Y-m-d';
269         }
270         reader.push(row);
271         
272         if (combofields.length == 1 && row.type == 'string') {
273             combofields.push(row);
274         }
275         
276         
277         var title = row.name.replace(/_id/, '').replace(/_/g, ' ');
278         title  = title[0].toUpperCase() + title.substring(1);
279         
280         colmodel.push({
281             "xtype": "ColumnModel",
282             "header": title,
283             "width":  row.type == 'string' ? 200 : 75,
284             "dataIndex": row.name,
285             "|renderer": row.type != 'date' ? 
286                     "function(v) { return String.format('{0}', v); }" :
287                     "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }" , // special for date
288             "|xns": "Roo.grid",
289             "*prop": "colModel[]"
290         });
291         var xtype = 'TextField';
292         if (row.type == 'number') {
293             xtype = 'NumberField';
294         }
295         if (row.type == 'date') {
296             xtype = 'DateField';
297         }
298         if (e.Type == 'text') {
299             xtype = 'TextArea';
300         }
301         if (row.name == 'id') {
302             xtype = 'Hidden';
303         } 
304         // what about booleans.. -> checkboxes..
305         
306         
307         
308         form[row.name] = {
309             fieldLabel : title,
310             name : row.name,
311             width : row.type == 'string' ? 200 : 75,
312             '|xns' : 'Roo.form',
313             xtype : xtype
314         }
315         if (xtype == 'TextArea') {
316             form[row.name].height = 100;
317         }
318         if (xtype == 'Hidden') {
319             delete form[row.name].fieldLabel;
320             delete form[row.name].width;
321         }
322         
323     });
324     
325     var combo = {
326         '|xns' : 'Roo.form',
327         xtype: 'ComboBox',
328         allowBlank : 'false',
329         editable : 'false',
330         emptyText : 'Select ' + table,
331         forceSelection : true,
332         listWidth : 400,
333         loadingText: 'Searching...',
334         minChars : 2,
335         pageSize : 20,
336         qtip: 'Select ' + table,
337         selectOnFocus: true,
338         triggerAction : 'all',
339         typeAhead: true,
340         
341         width: 300,
342         
343         
344         
345         tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>', // SET WHEN USED
346         queryParam : '',// SET WHEN USED
347         fieldLabel : table,  // SET WHEN USED
348         valueField : 'id',
349         displayField : '', // SET WHEN USED eg. project_id_name
350         hiddenName : '', // SET WHEN USED eg. project_id
351         name : '', // SET WHEN USED eg. project_id_name
352         items : [
353             {
354                     
355                 '*prop' : 'store',
356                 'xtype' : 'Store',
357                 '|xns' : 'Roo.data',
358                 'remoteSort' : true,
359                 '|sortInfo' : '{ direction : \'ASC\', field: \'id\' }',
360                 listeners : {
361                     '|beforeload' : 'function (_self, o)' +
362                     "{\n" +
363                     "    o.params = o.params || {};\n" +
364                     "    // set more here\n" +
365                     "}\n"
366                 },
367                 items : [
368                     {
369                         '*prop' : 'proxy',
370                         'xtype' : 'HttpProxy',
371                         'method' : 'GET',
372                         '|xns' : 'Roo.data',
373                         '|url' : "baseURL + '/Roo/" + table + ".php'",
374                     },
375                     
376                     {
377                         '*prop' : 'reader',
378                         'xtype' : 'JsonReader',
379                         '|xns' : 'Roo.data',
380                         'id' : 'id',
381                         'root' : 'data',
382                         'totalProperty' : 'total',
383                         '|fields' : JSON.stringify(combofields)
384                         
385                     }
386                 ]
387             }
388         ]
389     }
390     
391     
392     
393     
394     //print(JSON.stringify(reader,null,4));
395     readers.push({
396         table : table ,
397         combo : combo,
398         combofields : combofields,
399         reader :  reader,
400         oreader : JSON.parse(JSON.stringify(reader)), // dupe it..
401         colmodel : colmodel,
402         firstTxtCol : firstTxtCol,
403         form : form
404     });
405     
406     //console.dump(schema );
407     
408      
409 });
410
411
412
413 // merge in the linked tables..
414 readers.forEach(function(reader) {
415     if (typeof(ini[reader.table]) == 'undefined') {
416      
417         return;
418     }
419     print("OVERLAY - " + reader.table);
420     // we have a map..
421     for (var col in ini[reader.table]) {
422         var kv = ini[reader.table][col].split(':');
423         
424         
425         var add = readers.filter(function(r) { return r.table == kv[0] })[0];
426         if (!add) {
427             continue;
428         }
429         // merge in data (eg. project_id => project_id_*****
430      
431         add.oreader.forEach(function(or) {
432             reader.reader.push({
433                 name : col + '_' + or.name,
434                 type : or.type
435             });
436         });
437         
438         // col is mapped to something..
439         var combofields = add.combofields;
440         if (add.combofields.length < 2) {
441             continue;
442         }
443         if (typeof(reader.form[col]) == 'undefined') {
444             print (JSON.stringify(reader.form, null,4));
445             print("missing linked column " + col);
446             continue;
447         }
448         
449         var combofields_name = add.combofields[1].name;
450         var old =   reader.form[col];
451         reader.form[col] = JSON.parse(JSON.stringify(add.combo)); // clone
452         reader.form[col].queryParam  = 'query[' + combofields_name + ']';// SET WHEN USED
453         reader.form[col].fieldLabel = old.fieldLabel;  // SET WHEN USED
454         reader.form[col].hiddenName = old.name; // SET WHEN USED eg. project_id
455         reader.form[col].displayField = combofields_name; // SET WHEN USED eg. project_id
456         reader.form[col].name  = old.name + '_' + combofields_name; // SET WHEN USED eg. project_id_name
457         reader.form[col].tpl = '<div class="x-grid-cell-text x-btn button"><b>{' + combofields_name +'}</b> </div>'; // SET WHEN USED
458         
459              
460     };
461     
462     
463 });
464
465 //readers.forEach(function(reader) {
466 //    delete reader.oreader;
467 //});
468
469  
470
471
472
473 //print(JSON.stringify(readers, null, 4));
474
475 readers.forEach(function(reader) {
476     
477
478     var dir = GLib.get_home_dir() + '/.Builder/Roo.data.JsonReader'; 
479     if (!File.isDirectory(dir)) {
480         print("mkdir " + dir);
481         File.mkdir(dir);
482     }
483     
484     // READERS
485     print("WRITE: " +  dir + '/' + cfg.DBNAME + '_' + reader.table + '.json');
486     
487                 
488     var jreader = {
489         '|xns' : 'Roo.data',
490         xtype : "JsonReader",
491         totalProperty : "total",
492         root : "data",
493         '*prop' : "reader",
494         id : 'id', // maybe no..
495        
496         '|fields' :  JSON.stringify(reader.reader, null,4).replace(/"/g,"'")
497     };
498     
499     File.write(
500         dir + '/' + cfg.DBNAME + '_' + reader.table + '.json',
501         JSON.stringify(jreader, null, 4)
502     )
503     
504     
505     // GRIDS
506     dir = GLib.get_home_dir() + '/.Builder/Roo.GridPanel'; 
507     if (!File.isDirectory(dir)) {
508         print("mkdir " + dir);
509         File.mkdir(dir);
510     }
511     
512
513     print("WRITE: " +  dir + '/' + cfg.DBNAME + '_' + reader.table + '.json');
514     
515     File.write(
516         dir + '/' + cfg.DBNAME + '_' + reader.table + '.json',
517             
518        
519         JSON.stringify({
520             '|xns' : 'Roo',
521             xtype : "GridPanel",
522             "title": reader.table,
523             "fitToframe": true,
524             "fitContainer": true,
525             "tableName": reader.table,
526             "background": true,
527             "region" : 'center',
528             "listeners": {
529                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
530             },
531             "items": [
532                 {
533                     "*prop": "grid",
534                     "xtype": "Grid",
535                     "autoExpandColumn": reader.firstTxtCol,
536                     "loadMask": true,
537                     "listeners": {
538                         "|render": "function() \n" +
539                             "{\n" +
540                             "    _this.grid = this; \n" +
541                             "    //_this.dialog = Pman.Dialog.FILL_IN\n" +
542                             "    if (_this.panel.active) {\n" +
543                             "       this.footer.onClick('first');\n" +
544                             "    }\n" +
545                             "}",
546                         "|rowdblclick": "function (_self, rowIndex, e)\n" + 
547                             "{\n" + 
548                             "    if (!_this.dialog) return;\n" + 
549                             "    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n" + 
550                             "        _this.grid.footer.onClick('first');\n" + 
551                             "    }); \n" + 
552                             "}\n"
553                     },
554                     "|xns": "Roo.grid",
555
556                     "items": [
557                         {
558                             "*prop": "dataSource",
559                             "xtype": "Store",
560                              remoteSort : true,
561                             '|sortInfo' : "{ field : '" + reader.firstTxtCol  +  "', direction: 'ASC' }", 
562                             "|xns": "Roo.data",
563                             "items": [
564                                 
565                                 {
566                                     "*prop": "proxy",
567                                     "xtype": "HttpProxy",
568                                     "method": "GET",
569                                     "|url": "baseURL + '/Roo/" + reader.table + ".php'",
570                                     "|xns": "Roo.data"
571                                 },
572                                 jreader
573                             ]
574                         },
575                         {
576                             "*prop": "footer",
577                             "xtype": "PagingToolbar",
578                             "pageSize": 25,
579                             "displayInfo": true,
580                             "displayMsg": "Displaying " + reader.table + "{0} - {1} of {2}",
581                             "emptyMsg": "No " + reader.table + " found",
582                             "|xns": "Roo"
583                         },
584                         {
585                             "*prop": "toolbar",
586                             "xtype": "Toolbar",
587                             "|xns": "Roo",
588                             "items": [
589                                 {
590                                     "text": "Add",
591                                     "xtype": "Button",
592                                     "cls": "x-btn-text-icon",
593                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
594                                     "listeners": {
595                                         "|click": "function()\n"+
596                                             "{\n"+
597                                             "    if (!_this.dialog) return;\n" +
598                                             "    _this.dialog.show( { id : 0 } , function() {\n"+
599                                             "        _this.grid.footer.onClick('first');\n"+
600                                             "   }); \n"+
601                                             "}\n"
602                                     },
603                                     "|xns": "Roo.Toolbar"
604                                 },
605                                 {
606                                     "text": "Edit",
607                                     "xtype": "Button",
608                                     "cls": "x-btn-text-icon",
609                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
610                                     "listeners": {
611                                         "|click": "function()\n"+
612                                             "{\n"+
613                                             "    var s = _this.grid.getSelectionModel().getSelections();\n"+
614                                             "    if (!s.length || (s.length > 1))  {\n"+
615                                             "        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n"+
616                                             "        return;\n"+
617                                             "    }\n"+
618                                             "    if (!_this.dialog) return;\n" +
619                                             "    _this.dialog.show(s[0].data, function() {\n"+
620                                             "        _this.grid.footer.onClick('first');\n"+
621                                             "    }); \n"+
622                                             "    \n"+
623                                             "}\n" 
624                                         
625                                     },
626                                     "|xns": "Roo.Toolbar"
627                                 },
628                                 {
629                                     "text": "Delete",
630                                     "cls": "x-btn-text-icon",
631                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
632                                     "xtype": "Button",
633                                     "listeners": {
634                                         "|click": "function()\n"+
635                                             "{\n"+
636                                             "     Pman.genericDelete(_this, '" + reader.table + "'); \n"+
637                                             "}\n"+
638                                             "        "
639                                     },
640                                     "|xns": "Roo.Toolbar"
641                                 }
642                             ]
643                         }, // end toolbar
644                     ].concat( reader.colmodel)
645                 }
646             ]
647             
648             
649         }, null, 4)
650     )
651     
652     /// FORMS..
653     
654     dir = GLib.get_home_dir() + '/.Builder/Roo.form.Form'; 
655     if (!File.isDirectory(dir)) {
656         print("mkdir " + dir);
657         File.mkdir(dir);
658     }
659     var formElements = [];
660     var formHeight = 50;
661     for (var k in reader.form) {
662         if (k == 'id') { // should really do primary key testing..
663             continue;
664         }
665         formHeight += reader.form[k].xtype == 'TextArea' ? 100 : 30;
666         
667         formElements.push(reader.form[k]);
668     }
669     if (reader.form['id']) {
670         formElements.push(reader.form['id']);
671     }
672     
673
674     print("WRITE: " +  dir + '/' + cfg.DBNAME + '_' + reader.table + '.json');
675     var frmCfg = 
676     {
677         '|xns' : 'Roo.form',
678         xtype : "Form",
679         listeners : {
680             "|actioncomplete" : "function(_self,action)\n"+
681                 "{\n"+
682                 "    if (action.type == 'setdata') {\n"+
683                 "       //_this.dialog.el.mask(\"Loading\");\n"+
684                 "       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n"+
685                 "       return;\n"+
686                 "    }\n"+
687                 "    if (action.type == 'load') {\n"+
688                 "        _this.dialog.el.unmask();\n"+
689                 "        return;\n"+
690                 "    }\n"+
691                 "    if (action.type =='submit') {\n"+
692                 "    \n"+
693                 "        _this.dialog.el.unmask();\n"+
694                 "        _this.dialog.hide();\n"+
695                 "    \n"+
696                 "         if (_this.callback) {\n"+
697                 "            _this.callback.call(_this, _this.form.getValues());\n"+
698                 "         }\n"+
699                 "         _this.form.reset();\n"+
700                 "         return;\n"+
701                 "    }\n"+
702                 "}\n",
703             
704             "|rendered" : "function (form)\n"+
705                 "{\n"+
706                 "    _this.form= form;\n"+
707                 "}\n"
708         },
709         method : "POST",
710         style : "margin:10px;",
711         "|url" : "baseURL + '/Roo/" + reader.table + ".php'",
712         items : formElements
713     };
714     
715     
716     File.write(
717         dir + '/' + cfg.DBNAME + '_' + reader.table + '.json',
718             
719        
720         JSON.stringify( frmCfg, null, 4)
721     );
722             
723             
724    
725    
726    
727      /// COMBO..
728     
729     dir = GLib.get_home_dir() + '/.Builder/Roo.form.ComboBox'; 
730     if (!File.isDirectory(dir)) {
731         print("mkdir " + dir);
732         File.mkdir(dir);
733     }
734    
735     print("WRITE: " +  dir + '/' + cfg.DBNAME + '_' + reader.table + '.json');
736     
737     File.write(
738         dir + '/' + cfg.DBNAME + '_' + reader.table + '.json',
739             
740        
741         JSON.stringify(reader.combo, null, 4)
742     );
743             
744    
745    
746    
747    
748    
749     // DIALOG.
750    
751    
752     dir = GLib.get_home_dir() + '/.Builder/Roo.LayoutDialog'; 
753     if (!File.isDirectory(dir)) {
754         print("mkdir " + dir);
755         File.mkdir(dir);
756     }
757     var formElements = [];
758     for (var k in reader.form) {
759         if (k == 'id') { // should really do primary key testing..
760             continue;
761         }
762         formElements.push(reader.form[k]);
763     }
764     formElements.push(reader.form['id']);
765
766     print("WRITE: " +  dir + '/' + cfg.DBNAME + '_' + reader.table + '.json');
767     
768     File.write(
769         dir + '/' + cfg.DBNAME + '_' + reader.table + '.json',
770             
771        
772         JSON.stringify({
773        
774             "closable": false,
775             "collapsible": false,
776             "height": formHeight,
777             "resizable": false,
778             "title": "Edit / Create " + reader.table,
779             "width": 400,
780             "xtype": "LayoutDialog",
781             "|xns": "Roo",
782             "items": [
783                 {
784                     "|xns": "Roo",
785                     "xtype": "LayoutRegion",
786                     "*prop": "center"
787                 },
788                 {
789                     "region": "center",
790                     "xtype": "ContentPanel",
791                     "|xns": "Roo",
792                     "items": [
793                         frmCfg
794                     ]
795                 },
796                 
797                 {
798                     "listeners": {
799                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
800                     },
801                     "*prop": "buttons[]",
802                     "text": "Cancel",
803                     "xtype": "Button",
804                     "|xns": "Roo"
805                 },
806                 {
807                     "listeners": {
808                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
809                     },
810                     "*prop": "buttons[]",
811                     "text": "Save",
812                     "xtype": "Button",
813                     "|xns": "Roo"
814                 }
815             ]
816         }, null,4)
817     );
818    
819    
820    
821 });
822
823