Writing the queries (reports) - dbdipview/dbdipview GitHub Wiki

Initial Metadata and Report Generation

The templates for a new package are available in the folder tools/template. However, it is much easier to use the utility as described here.

The tools/configPrep utility generates the initial metadata files for a dbDIPview package, including queries.xml, list.xml, createdb.sql, and createdb01.xml. In queries.xml, it also automatically creates initial versions of menus, reports, and control reports. These automatically generated files require manual review and refinement before the package is built.

The tool accepts either one or more SIARD files or an already prepared spreadsheet file containing table descriptions and other relevant information as input.

For quick deployment, also prepare an order file with the names of all the files that will be used for deployment.

Configuration File Refinement

When working with CSV files, the tool analyses them and creates a spreadsheet configuration file. Similarly, if you're using the SIARD format, a spreadsheet configuration file is also generated during the process.

You'll then manually refine this generated configuration file. This involves tasks like removing unwanted tables from search forms, omitting specific columns from display, setting the column headers, or adding search parameters and dictionaries. Once you've made your changes, you'll re-run the program, using this modified file as input. This iterative process is repeated until you're satisfied with the final result: the configuration files destined for the package. For practical examples, refer to the tools/configPrep\in_demo folder. Each sheet in the configuration file serves as the basis for a main report (e.g., "show all IDs") and a detailed report about a selected ID, which can include multiple sub-reports for the selected object.

Package Configuration Editing

In the next stage, you'll edit the package's configuration files. This primarily involves refining the queries.xml file by removing unneeded reports and adding new ones. This file can be tested and modified live within the dbdipview/www/data folder to implement any necessary improvements.

  • Edit the queries file in the data www/data folder and check them immediately. You can get the queries from the original database environment or use a query builder. Imitate the original application or work on what is expected use in the future.
  • Use double-quote characters for the database objects to prevent any ambiguity.
  • Compare the results with the original application, and let the original user (the creator) test your work.
  • Do not forget to copy the queries from www/data before you uninstall that database.
  • When typing commands in menu.php becomes time-consuming, create an order.xml file ordeploy.php instead.
  • Do not forget to check out the Test and Demo examples!