Place the customization code in the customize folder.There are the following rules.
In this example, we will create a Java customization code that embeds values as initial values at the time of new registration for the "customer" model.
In the project explorer, click the mouse right click button in the customize/java folder and select "New> Other ...".
Specify the Java class in the new wizard.
Specify package name, class name, super class.
In this example we are targeting the customer model.The package name is based on the standard "jp.jasminesoft.wagby".
As shown in this example, the customization class inherits the automatically generated class (CustomerHelper in this case) and sets the prefix with "My" as the class name.
A template of the customized class is generated.(FIG. 5)
Next, overwrite (override) the method that is automatically generated. Right click on the mouse on the edit screen to display the menu.Select "Source> Method Override/Implementation ...".
In this case, specify the autoize method initialize.(This method is provided to set the initial value of the object displayed on the new registration screen.)
A method is provided.Standard is to execute methods of parent class.
Add the following code.
Customer.setName ("Natsume Soseki");
We have set the initial value of the name field.
After creating customization code, you need to build (difference build) with WagbyDesigner.
Code in the customize folder is automatically placed in the web application when building with Wagby Designer. The contents of the java folder are compiled and stored in WEB-INF \ classes. The content of the resources folder is stored in WEB-INF \ classes as is. The content of the webapp folder is stored in the corresponding folder.
With the build process, WEB-INF \ applicationContext \ customer.xml will be overwritten.I will use MyCustomerHelper (which is a customized class) instead of CustomerHelper.
This is an example of executing a built application.On the new registration screen, you can see that the specified value is set.
After creating the customization code, it can be automatically generated again. The procedure in this case is as follows.