A builder is a discrete bundle of functionality in the construction of a WebApp.
Of the builders that are supplied in IBM® WebSphere® Portlet Factory, some are primitive and do very simple things, like adding a page to the WebApp, or putting a button on a page. Others are complex, and can construct an entire form along with the Java™ code required to move data between the form and a variable.
There are three critical pieces to a builder.
Builder Definition file (bdef)
This XML file defines the builder for the WebSphere Portlet Factory to know both how to invoke it and how to display instances of it to the user of the builder. Among other things, it defines what the inputs are to this builder. In our example, the builder has only two inputs, the name of the builder and the directory which contains the HTML files to which it is going to create links.Builder class
This is a Java class which performs the automation task. It is run at generate time, and it is expected to make some changes to the WebApp.Coordinator class (optional)
This Java class is run when you edit an instance of the builder, a builder call. The coordinator can modify the builder user interface on-the-fly to hide or show input fields, for example, to change the list of choices in a list. Typically, the coordinator is just used to set the initial value of one of the inputs to a value that is calculated. (If the initial value were static, you can set it in the builder definition file.)
Choosing builder base classes and interfaces
Depending on how your builder acts on the WebApp, you need to extend or implement a specific base class or interface for your generation class and specify an appropriate GenHandler
class in the builder definition.
Builder input widgets
This topic provides details on all builder input widget names and arguments provided by IBM WebSphere Portlet Factory Designer for use by builder authors.
The generation class implements all the logic to be executed by the builder during generation.
If you need to implement any sort of dynamic behavior for a builder call editor, create a coordinator class for your builder.
About creating builder definitions
The builder definition is an XML file that defines the builder characteristics.
Defining inputs for your builder
An input definition is a structure in the builder definition that describes the input for a builder.
About adding elements to pages in the web application
You can add or modify elements on the pages in the model by calling the individual builder APIs.
About model-based builder creation
A model-based builder is a builder that you create and is based on a model.
Multi-phase builder generation behavior
For some builders, the order of the builder calls can be important.
Setting properties for page automation elements
Page automation elements from builders such as Data Page, Data Column Modifier, or Rich Data Definition, have generic properties associated with them.
Using other builders in the generation class
You can add builder calls in the Java code for your own builder in two ways:
Parent topic: Creating a custom builder