DB Form Builder

From Documentation


Introduction

DB Form Builder is a Wizard to help developers generate a Zeta DB Form [1] without typing any code. Please follow Step by Step Guide or Detail explained guide for more detailed information.


Zeta step by step 005 new zeta strategy.png

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 as described in section "2. Define a Server Runtime" of this Small Talk

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:

http://docs.zkoss.org/wiki/Setup_MySQL_DB_in_Eclipse

6. Currently the Zeta DB Form Builder does not support a table with foreign keys

Step by Step Usage

  1. On a dynamic web project with ZK support, right click the project and select [New]\[Other...]:
    Zeta step by step 001 new zeta strategy.png

  2. Expand the ZK folder, select Zeta Form and then click  Next .
    Zeta step by step 002 new zeta strategy.png

  3. 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 .
    Zeta step by step 003 new zeta strategy.png
    Note: A Form Builder is a way to tell zeta how to manipulate data and present in Zeta form.

  4. Select a Database Profile (the Database Connection that you created in the Eclipse Data Source Explorer),
    Zeta step by step 004 new zeta strategy.png
    Note: If you can't see the profile that you previously added, click  Refresh .

  5. 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.
    Zeta step by step connect success.png

  6. On the next page, select the desired table from the Available Tables list on the left, then click  Next  > .
    Zeta step by step 005 new zeta strategy.png

  7. 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.
    Zeta step by step 006 new zeta strategy.png

  8. On the ORM Configuration page, map the data column type to the Java object making sure there are no red crosses Zeta column Invalid.png in the far right column, then click  Next  > 
    Zeta step by step 007 new zeta strategy.png

  9. 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.
    Zeta step by step 008 new zeta strategy.png

  10. 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.
    Zeta step by step 009 new zeta strategy.png

  11. On the Other Configuration page you are able to configure the generated Java source code and some Object-relational mapping settings:
    Zeta step by step 010 new zeta strategy.png
    By pressing  Finish , the linking code will be auto generated within the project.

Show Result

  1. Make sure you have set web server as depicted here : Run ZUL file

  2. 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]).
    Zeta config file location.png

  3. Right click the new ZUL file and select [Run AS]/[Run on Server]:
    Zeta verify result.png

  4. You should be able to see the generated Form in a browser

Note

  1. You can use multiple Zeta Forms on the same Dynamic Web Project, as long as the name is not the same.
  2. Be sure to stop the application server before running the form builder.
  3. Be sure to clean and rebuild your project after you generate a Zeta Form.
  4. For detailed explanations of each configuration page, please see the detailed explanation guide.

See Also

Form Builder and foreign keys

Zeta DB Form Buider detailed guide

see Zeta_DB_Form_Buider_Detail_Guide


Note: Zeta DB Form Builder is for ZK version 3.6.0 and above only.


Last Update : 2010/12/03

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.


  1. Zeta DB Form is a data operation process which is based on the MVC architecture of ZK + Spring + Datasource (ex: use JPA or Hibernate to connect Database).