DB Form Builder
Important Information
This is currently an experimental plugin, available for download here While install, please remember to uncheck "Group items by category".
Introduction
DB Form Builder is a Wizard to help developers generate a Zeta DB Form [1] without typing any code. Please follow Zeta DB Form Builder Step by Step Guide or Zeta DB Form Builder Detailed Guide for more detailed information.
Zeta DB Form Builder Step by Step Guide
Prerequisite
1. You are required to use the Java SE Development Kit (JDK) as Eclipse's default JRE to build Java Projects, please follow the link Setting_Default_JRE_In_Eclipse to set the JDK as the default JRE
2. Be sure to finish configuring the ZK Library and define a server runtime.
3. Zeta DB Form Builder is only for use with ZK Library version 3.6.0 and above
4. If you're using JDK 5, you are required to manually copy the file jsr250-api.jar to your project's \WEB-INF\lib directory
- Due to licensing issues, we cannot provide the jsr250-api.jar file with ZK Studio. Please click here and download the file "com_annotations-1_0-fr-api-doc.zip". This package contains the jsr250-api.jar file.
5. Setup the Database Connection within Eclipse, this will differ depending on which type of database you use:
*MySQL:
6. Currently the Zeta DB Form Builder does not support a table with foreign keys
Step by Step Usage
- On a dynamic web project with ZK support, right click the project and select [New]\[Other...]:
- Expand the ZK folder, select Zeta Form and then click Next .
- In the wizard screen select the type of Form Builder you require, in this case it will be the 「Single Form Builder」 and make sure that the appropriate project has been selected in the drop down box, then click Finish .Note: A Form Builder is a way to tell zeta how to manipulate data and present in Zeta form.
- Select a Database Profile (the Database Connection that you created in the Eclipse Data Source Explorer),
Note: If you can't see the profile that you previously added, click Refresh . - After selecting a Database Profile please make sure the connection settings shown on the right hand side panel are correct and then click Test Connection & Go next .
This action should prompt a connection successful message, click OK to continue. - On the next page, select the desired table from the Available Tables list on the left, then click Next > .
- On the UI Template Configuration page you are able to select a template from the listbox on the left. Having selected this, an example will be shown on the right hand side, click Next > to proceed.
- On the ORM Configuration page, map the data column type to the Java object making sure there are no red crosses in the far right column, then click Next >
- The List View Configuration page enables you to make modifications to the mapping of columns, position of columns and the presentation of all the columns for the <listbox> view, click Next > to continue.
- The Detail View Configuration page enables you to make modifications to the mapping of columns, position of columns and the presentation of all the columns for the <grid> view, click Next > to continue.
- On the Other Configuration page you are able to configure the generated Java source code and some Object-relational mapping settings:
By pressing Finish , the linking code will be auto generated within the project.
Show Result
- Make sure you have set web server as depicted here : Running the ZUL File
- Check if a ".zeta" configuration file which is generated by Zeta Form Builder is present in the project's folder (you can re-open this wizard by right clicking on this file and selecting [Zeta]/[Open Wizard]).
- Right click the new ZUL file and select [Run AS]/[Run on Server]:
- You should be able to see the generated Form in a browser
Note
- You can use multiple Zeta Forms on the same Dynamic Web Project, as long as the name is not the same.
- Be sure to stop the application server before running the form builder.
- Be sure to clean and rebuild your project after you generate a Zeta Form.
- For detailed explanations of each configuration page, please see the detailed explanation guide.
See Also
Zeta DB Form Builder Detailed Guide
Introduction
Zeta DB Form Builder comprises of many Form Builders which will help you create and modify various kinds of Zeta DB Form rapidly. You can follow the Step by Step Guide to create a Zeta DB Form quickly.
The Start Page
This start page enables you to select your dynamic web project and the type of Form Builder you would like to use:
- Using this combobox you are able to select the dynamic web project you want to use the DB Form Builder with. If you right click on a dynamic web project to invoke the Zeta Form Builder then that project is automatically selected. However, if you utilize the menu command [File]/[New]/[Other...] you will have to manually select the dynamic web project.
- All the available Form Building Wizards are available here, if no Form Builder is selected then the Finish button will not be activated.
Currently there is only a Single Form Builder wizard available, so select it and click Finish to continue the wizard.
The Select Database Page
This page is used to configure which DB the Form Builder will attempt to connect to and use that database to generate the DB Form.
- This box lists all available databases which have been setup in Eclipse
- The Refresh button refreshes the DB list
- This button opens the 『new connection profile window』 allowing you to setup a new database connection
- This button closes the Former Building Wizard and opens the Data Source Explorer
- The currently selected database』s information will be displayed here
- You are able to change the Username and Password of the connection here. However, this information will NOT be saved.
- Having finished selecting the database and configuring the Username and Password, click here to test the connection and proceed to the next step
The Choose Table Page
This page allows you to select which table will be used to generate the DB form.
- Available Tables: lists all available tables in the database.
- Table Columns: lists the schema of the currently selected data table, the Primary Key will be highlighted in a different color.
- Data Preview: lists the first 15 rows of the selected data table.
The UI Template Configuration Page
This page enables you to choose which template the Single Form Builder adopts to generate the DB form.
Please select a template from the list on the left hand side, the template's information and example will then be displayed on the right-hand side of the window.
ORM Configuration Page
This page enables you to configure the "Object Relation Mappings (ORM)" of the data. You are able to map the data tables types to Java types, any errors while doing this will be displayed by a red cross.
- This list displays all the mapping information needed for the data:
- Column: displays the name of the column
- Data Type: the original database』s data type
- Id: the Java Object name that this column will mapping to, you can type the name of the object into this field directly
- Java Type: the data type of the mapped Java Object, it is a data type which Java supports.
You are able to change the Java Type by selecting an appropriate type from the drop down list.Note: some data types that originated from Database may not be precisely detected by the Form Builder, therefore the mapping may be erroneous. This will cause the generated Zeta DB Form to produce some exception message when running in server, hence it will not be shown. - List View: check this field if you want it shown in the List View Configuration Page
- Detail View: check this field if you want it shown in the Detail View Configuration Page
- This option controls how the primary key is manipulated/incremented
-
- By Database (auto create) : this option allows the database to auto update the value of the Primary Key
- By Code/User Input : this option allows user programming logic to change the value of Primary Key
The list view configuration page
This page allows you to configure the content shown within the list view. You are able to change the order of the items by using the Up and Down buttons on the lower left-hand side and upon selecting an item its' configuration details can be modified in the right-hand side panel.
Note: If you are unable to proceed due to the Next > button being disabled, please check if a field in the left-hand side list has been marked with an error sign. If there is any field marked with an error sign please modify the configuration making sure that it is valid.
The detail view configuration page
This page allows you to configure the content shown within the detail view. You are able to change the order of the items by using the Up and Down buttons on the lower left-hand side and upon selecting an item it』s configuration details can be modified in the right-hand side panel.
Note: If you are unable to proceed due to the Next > button being disabled, please check if a field in the left-hand side list has been marked with an error sign. If there is any field marked with an error sign please modify the configuration making sure that it is valid.
The other configuration page
This page configures miscellaneous settings of the Form Builder.
- Name : the name of this DB Form, it is also the base name for the generated file.
- Package : the package name of the generated class.
- Source Folder : the Java source file location of the generated class.
- View Folder : the location where the zul file will be generated upon clicking the Finish button.
- Copy Zeta Jars : checking this will copy the Zeta library jar files into the project's lib folder : [Project_Name]/WebContent/WEB-INF/lib (you have to check this option if your project doesn't already contain these jar files.)
- Copy JDBC Jars : checking this will copy the JDBC library jar files (based upon the type of database connection profile) into the project's lib folder : [Project_Name]/WebContent/WEB-INF/lib (you have to check this option if your project doesn't already contain these jar files.)
- Copy JPA Jars : checking this will copy the JPA library jar files (such as spring, hibernate etc.) into the project's lib folder : [Project_Name]/WebContent/WEB-INF/lib (you have to check this option if your project doesn't already contain these jar files.)
- Create Configuration : checking this will create a Spring and JPA configuration within the location Source Folder/config and append some configuration to you web.xml (you are required to generate these at least once.)
- Dialect : set the dialect of the connected database.Note: Usually Zeta will detect the correct dialect if you have correctly setup Database connection in Data Source Explorer, however, in some cases you are required to set the dialect if Zeta did not automatically select it.
Note
- You are able to create multiple Zeta DB Forms within one dynamic web project, as long as the Name within the Other Configuration Page is different.
- If you create a Zeta DB Form that the name is the same as another Zeta DB Form that has been already created in this dynamic web project, Zeta will inform you if you want to replace the old one or not.
- If you selected an option from a previous Zeta DB Form Builder page, that caused Zeta to copy files into the dynamic web project, Zeta will ask you if you want to replace those files or not.