Location of files
explained. It is imperative to remember that duplicate table QDPHs DFURss GDWDEDsHs DGGHG WR WhH FRQfiJXUDWLRQ ZRXOG UDLsH D warning because the two tables would get duplicate class names during Codegen. Typically, Codegen will raise an error when sXFh LssXHs DULsH. 7R FRXQWHU WhLs, sHW SUHfix DQG/RU sXIfix YDOXHs for classNames in codegen_settings.xml for the database whose 250 FODss fiOHs yRX ZRXOG ZDQW WR FDUUy WhH SUHfix/sXIfix. 7hH ORFDWLRQ RI fiOHs JHQHUDWHG GXULQJ WhH CRGHJHQ SURFHss GHSHQGs RQ WhH WySH RI fiOH. HHUH Ls D OLsW RI ORFDWLRQs ZhHUH WhH CRGHJHQHG fiOHs DUH sWRUHG: 1. includes/meta_controls/generated/: 7hH fiOHs LQ WhLs directory contain the actual code for MetaControls and DataGrids (in MetaControl-Gen and DataGrid-Gen classes) and are overwritten each time Codegen runs. They should not be used to store any custom logic for the generated MetaControls and DataGrids. includes/meta_controls/: This directory will contain the FODss fiOHs ZhHUH yRX FDQ ZULWH yRXU FXsWRP ORJLF IRU WhH MetaControls and DataGrids because they are created once and are not overwritten on subsequent code generations. These are directly derived from the MetaControlGen classes. includes/model/generated/: CRQWDLQs 250-GHQ FODss fiOHs for each table with the functions we discussed earlier. They are overwritten on subsequent code generations and these too cannot hold any custom code you write in them. includes/model/: CRQWDLQs WhH 250 FODss fiOHs WhDW yRX should use while designing your application. They are not overwritten and are one great place to store your custom methods for each table separately! includes/formbase_classes_generated/: Contains the abstract classes to derive from, for creating pages to list and edit entries in tables, updated on each Codegen run. drafts/panels/: Contains Codegened panels that can be directly used for creating, editing and deleting entries in tables. They use MetaControls for the respective tables and add the ‘Save’, ‘Cancel’ and ‘Delete’ buttons for CRUD functionality. These panels are reusable in your application, and are recreated on each Codegen. drafts/: Contains individual pages for CRUD functionality for tables. They are overwritten each time Codegen runs. In addition to the files created to work upon tables, the QCubed Codegen system also updates three special files located in includes/model/generated. The files are: _class_ paths.inc.php, _type_class_paths.inc.php and QQN.class.php. These files are vital to the autoloading feature in QCubed, and must not be tampered with.
7. 'R QRW HYHU DOWHU DQy fiOHs ZhLFh DUH RYHU-ZULWWHQ RQ Codegen. You would only lose your work. UsH 250 FODss fiOHs WR ZULWH DQy FRGH WhDW ZRUNs RQ WDEOH data directly. This will facilitate organisation of code, and UHGXFH WhH QXPEHU RI FXsWRP fiOHs yRX QHHG WR FUHDWH; H.J., LI you want to create a method that loads objects using a nonLQGHxHG FROXPQ, WhH 250 FODss Ls ZhHUH yRX shRXOG GHfiQH LW. Choose drafts pages and the AJAX panel over phpPgAdmin (or phpMyAdmin) for inputting data—they are safer and come with validation logic. If you want to show a control on your Web page, which directly relates to a table in the DB, try to use MetaControls rather than creating a new control, time and again. You can alter the looks and behaviour of input controls you get via MetaControls. If you alter the columns (e.g., alter the length of varchar fiHOGs), Codegen will update the constraints on the MetaControls, making sure you do not have to rewrite the logic. Feel free to copy the MetaControls, Panels, Controls and Pages generated by Codegen and create your own classes by modifying them—they are there to help you, not to restrict you. However, do check for changes in schema since your FXsWRP fiOHs DUH QRW DXWRPDWLFDOOy XSGDWHG. ,I yRX sLPSOy want to ‘add’ a functionality, it is better to create a new class inheriting from the generated class (much the same way ORM classes are inherited from ORM-Gen classes). Directory locations are also controlled using variables GHfiQHG LQ CRQfigXUDWLRQ.LQC.ShS. If you want to change their location, you can. Though QCubed gives you the freedom to write your custom queries, do it when QQuery does not satisfy your needs perfectly. Try to stick to the generated classes wherever you can—it saves labour. DataGrids should be used to create simple tables with basic search functionality. DataGrids are not SEO friendly—they never provide a hyperlink to the second (and subsequent) page results; instead, work using actions and events. Use your own pagination if you require SEO. Your draft pages can be used to change data. Set ALLOW_ 5(027(BA'0,1 WR ‘)DOsH’ LQ WhH FRQfiJXUDWLRQ fiOH WR PDNH sure that access to them is restricted. All the above are suggestions, not rules. If you have a reason to, you can violate them (e.g., when you want to access the draft pages on your website from a remote computer, you should set ALLOW_ REMOTE_ADMIN to your public IP address). Use Codegen as an aid and it will reduce about 70 per cent of your workload straight away—you must have already realised how!