Rapid Application Development with Qcubed
Total Page:16
File Type:pdf, Size:1020Kb
RAPID APPLICATION DEVELOPMENT WITH QCUBED A step by step introduction guide Updated for QCubed v21.0 Author: Gianni Rossini –Ma.Gi.A. Informatica [email protected] Copyright 2010 © QCubed Development Team, http://qcu.be Distributed under the MIT License, http://www.opensource.org/licenses/mit-license.php QCubed Framework Step by Step 1/105 TABLE OF CONTENTS Table of Contents ........................................................................................................................................................ 2 Introduction................................................................................................................................................................. 7 The Code Generator ............................................................................................................................................... 7 Event-driven, Stateful user interface Framework................................................................................................... 7 Project Vision.......................................................................................................................................................... 7 Note on Qcodo Backward Compatibility ..................................................................................................................... 8 Changelog and bug fixes: ................................................................................................................................. 8 Chapter 1: Installation ............................................................................................................................................... 10 1.1. Prerequisites........................................................................................................................................... 10 Intended audience ........................................................................................................................................... 10 Web Server....................................................................................................................................................... 10 PHP 5................................................................................................................................................................ 10 Database .......................................................................................................................................................... 10 1.2. Installation.............................................................................................................................................. 10 Windows .......................................................................................................................................................... 10 Step 1: Downloading QCubed .......................................................................................................................... 11 Step 2: Unpacking QCubed .............................................................................................................................. 11 Step 3: Moving files to their proper location................................................................................................... 11 Step 4: Setting permissions.............................................................................................................................. 11 Step 5: Setting the DOCROOT .......................................................................................................................... 11 STEP 6: Setting Database Parameters ......................................................................................................... 12 Linux................................................................................................................................................................. 14 Step 4: Setting permissions ......................................................................................................................... 14 Step 5: Setting the DOCROOT_SUBFOLDER and database parameters ...................................................... 14 Chapter 2: Introduction to QForms ........................................................................................................................... 15 2.1. Definition................................................................................................................................................ 15 2.2. Our first QForms application .................................................................................................................. 15 Example breakdown......................................................................................................................................... 16 QCubed Step By Step Tutorial 2/105 Adding Controls and State ............................................................................................................................... 17 Adding events .................................................................................................................................................. 18 Summary............................................................................................................................................................... 20 Chapter 3: Introduction to Code Generation ............................................................................................................ 21 What QCubed does for you .................................................................................................................................. 21 Code Generation of Data Objects......................................................................................................................... 21 HTML Form Drafts................................................................................................................................................. 21 What you still have to do...................................................................................................................................... 21 Example ................................................................................................................................................................ 21 Database layout ............................................................................................................................................... 21 Code generation ................................................................................................................................................... 22 Overview of the generated files ........................................................................................................................... 23 Viewing the result................................................................................................................................................. 24 Chapter 4: Understanding the generated code......................................................................................................... 25 Data Objects ......................................................................................................................................................... 25 QForm and QPanel - Drafts and Dashboard ......................................................................................................... 26 Meta Controls ....................................................................................................................................................... 26 meta Controls DataGrid ....................................................................................................................................... 27 Summary............................................................................................................................................................... 27 Chapter 5: More on code generation ........................................................................................................................ 28 Creating the database........................................................................................................................................... 28 Foreign keys ..................................................................................................................................................... 28 MyISAM and foreign keys........................................................................................................................... 29 Code generation – step 1...................................................................................................................................... 29 Adding data........................................................................................................................................................... 30 Overriding the default return string for an object ........................................................................................... 32 Extending the database ........................................................................................................................................ 33 Code generation – Step 2 ..................................................................................................................................... 33 Look and feel personalization............................................................................................................................... 34 QCubed Step By Step Tutorial 3/105 Adding time